• Re: Python (was Re: I did not inhale)

    From Lawrence D'Oliveiro@21:1/5 to Dmitry A. Kazakov on Sat Aug 17 21:51:13 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Sat, 17 Aug 2024 12:58:31 +0200, Dmitry A. Kazakov wrote:

    Windows inter-process API are far more advanced than what UNIX ever had.
    It would be enough to mention famous file locks.

    Except those file locks are more of a liability than an asset. They are
    what prevent you from continuing to use a Windows system while it is being updated, for example.

    The reason why processes are not included is that they are used to deal
    with some OS or design flaw that forces you to spawn some script or application.

    Or because the *nix tradition of being able to spawn a pipeline of
    multiple processes, all cooperating to perform a common task, is difficult
    and expensive, or even unreliable, under Windows.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dmitry A. Kazakov@21:1/5 to Lawrence D'Oliveiro on Sun Aug 18 10:10:09 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 2024-08-17 23:51, Lawrence D'Oliveiro wrote:
    On Sat, 17 Aug 2024 12:58:31 +0200, Dmitry A. Kazakov wrote:

    Windows inter-process API are far more advanced than what UNIX ever had.
    It would be enough to mention famous file locks.

    Except those file locks are more of a liability than an asset.

    Like so many things in UNIX...

    They are
    what prevent you from continuing to use a Windows system while it is being updated, for example.

    Windows mutex gets collected when the last process using it dies. UNIX
    file lock does not.

    The reason why processes are not included is that they are used to deal
    with some OS or design flaw that forces you to spawn some script or
    application.

    Or because the *nix tradition of being able to spawn a pipeline of
    multiple processes, all cooperating to perform a common task, is difficult and expensive, or even unreliable, under Windows.

    It is as expensive under Windows as it is under UNIX. There is no
    problem to produce the same mess as under UNIX. In fact Windows shells
    do this just same.

    Windows has a pipe object named and anonymous. No problem. Pipes are
    rarely used in applications because it is not how distributed systems
    (where multiple processes are indeed used) are designed. They usually
    require processes be able to run on different nodes.

    P.S. It is no wonder that Windows process API are far beyond UNIX.
    Historically UNIX started with singe fork() call. There was nothing but
    files, no system objects, nothing.
    On the other hand, Windows NT was developed by people influenced with
    the VMS design. VMS had a very elaborated process communication API. So
    Windows inherited much of that, but must importantly the concept of
    system resources managed by the OS.

    --
    Regards,
    Dmitry A. Kazakov
    http://www.dmitry-kazakov.de

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Muttley@dastardlyhq.com@21:1/5 to All on Sun Aug 18 08:30:28 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Sun, 18 Aug 2024 10:10:09 +0200
    "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> boringly babbled:
    On 2024-08-17 23:51, Lawrence D'Oliveiro wrote:
    Or because the *nix tradition of being able to spawn a pipeline of
    multiple processes, all cooperating to perform a common task, is difficult >> and expensive, or even unreliable, under Windows.

    It is as expensive under Windows as it is under UNIX. There is no
    problem to produce the same mess as under UNIX. In fact Windows shells
    do this just same.

    No they don't - cmd.exe only supports a very limited implemetation of pipelining. Powershell makes a better attempt at it but still doesn't get
    it right.

    Windows has a pipe object named and anonymous. No problem. Pipes are
    rarely used in applications because it is not how distributed systems
    (where multiple processes are indeed used) are designed. They usually

    Rubbish. You just made that up. Unix processes that need to talk to their
    child processes almost always create a pipe to do so before the fork. Thats
    how for example sshd talks to the shell process.

    require processes be able to run on different nodes.

    Again - rubbish.

    P.S. It is no wonder that Windows process API are far beyond UNIX.

    The windows process API is crippled which is why threading is the main
    parallel processing method in Windows and has been since 3.0. If you think otherwise please give some examples. However I distincly remember trying to port server to windows only to discover that sockets are some wierd
    structure in windows instead of a simple file descriptor meaning it was impossible to multiplex using poll() or select() on them, you had to have
    a seperate thread to manage each connection. What a fucking mess designed
    by idiots.

    Historically UNIX started with singe fork() call. There was nothing but >files, no system objects, nothing.

    fork() copies the entire process space. No idea what you mean by "system objects". Must be some windows thing.

    On the other hand, Windows NT was developed by people influenced with
    the VMS design. VMS had a very elaborated process communication API. So >Windows inherited much of that, but must importantly the concept of
    system resources managed by the OS.

    Windows NT was a slow unreliable dog. Even microsoft didn't use it for their heavy duty backend servers, they used BSD and AS400s instead.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kenny McCormack@21:1/5 to Dmitry A. Kazakov on Sun Aug 18 08:55:49 2024
    XPost: comp.unix.shell, comp.unix.programmer

    In article <v9sa91$2afht$1@dont-email.me>,
    Dmitry A. Kazakov <mailbox@dmitry-kazakov.de> wrote:
    On 2024-08-17 23:51, Lawrence D'Oliveiro wrote:
    On Sat, 17 Aug 2024 12:58:31 +0200, Dmitry A. Kazakov wrote:

    Windows inter-process API are far more advanced than what UNIX ever had. >>> It would be enough to mention famous file locks.

    Except those file locks are more of a liability than an asset.

    Like so many things in UNIX...

    Ah, funny!

    Yup - just what we need: Another Unix vs. Windows dick waving contest!!!

    So productive use of Usenet bandwidth.

    --
    If there is anything more pathetic than Dr. Donald Trump, MD, giving out medical
    advice, it is the pathetic followers of Dr. Trump trying to implement said advice.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Muttley@dastardlyhq.com@21:1/5 to All on Sun Aug 18 08:17:29 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Sat, 17 Aug 2024 12:58:31 +0200
    "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> boringly babbled:
    On 2024-08-17 11:01, Muttley@dastardlyhq.com wrote:
    On Fri, 16 Aug 2024 15:02:20 -0000 (UTC)
    kalevi@kolttonen.fi (Kalevi Kolttonen) gabbled:
    So it is indeed a vague question of what belongs in given programming
    languages.

    Indeed. And this gives rise to inconsistency. Why is threading now considered

    a core part of C++ but multi process isn't? Perhaps because Windows is >hopeless
    at the latter in user space but it could just be personal preference within >the
    C++ steering committee, who knows.

    Windows inter-process API are far more advanced than what UNIX ever had.

    No they're not. The core IPC is less sophisticated than unix but libraries build upon those shallow foundations.

    It would be enough to mention famous file locks. These days Linux has
    futex + file mapping. So, finally, you can create a system-wide mutex.
    Which under Windows is a single API call.

    No sane person uses system wide mutexes as they can cause horrendous
    problems.

    The reason why processes are not included is that they are used to deal
    with some OS or design flaw that forces you to spawn some script or >application. Then real-time embedded applications may have no processes

    Clearly you've never written a mission critical server backend. You never
    use threads if forking a seperate process can do the same job. If a thread crashes in a multi threaded server it brings down the entire server. If a
    child process crashes, well to bad, but at least the rest of the server processes are still running.

    Also shell pipelining is obviously not something you're familiar with.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Muttley@dastardlyhq.com@21:1/5 to All on Sun Aug 18 09:21:02 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Sun, 18 Aug 2024 08:55:49 -0000 (UTC)
    gazelle@shell.xmission.com (Kenny McCormack) boringly babbled:
    In article <v9sa91$2afht$1@dont-email.me>,
    Dmitry A. Kazakov <mailbox@dmitry-kazakov.de> wrote:
    On 2024-08-17 23:51, Lawrence D'Oliveiro wrote:
    On Sat, 17 Aug 2024 12:58:31 +0200, Dmitry A. Kazakov wrote:

    Windows inter-process API are far more advanced than what UNIX ever had. >>>> It would be enough to mention famous file locks.

    Except those file locks are more of a liability than an asset.

    Like so many things in UNIX...

    Ah, funny!

    Yup - just what we need: Another Unix vs. Windows dick waving contest!!!

    So productive use of Usenet bandwidth.

    Yes, no doubt the providers will be struggling under the kilobytes of data being used.

    Feel free to post something else of interest.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dmitry A. Kazakov@21:1/5 to Muttley@dastardlyhq.com on Sun Aug 18 12:19:10 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 2024-08-18 10:30, Muttley@dastardlyhq.com wrote:

    The windows process API is crippled which is why threading is the main parallel processing method in Windows and has been since 3.0.

    Threading is the main method because of its performance in a tight
    coupled application. Crossing the process borders is very expensive.

    If you think
    otherwise please give some examples. However I distincly remember trying to port server to windows only to discover that sockets are some wierd structure in windows instead of a simple file descriptor meaning it was impossible to multiplex using poll() or select() on them, you had to have
    a seperate thread to manage each connection. What a fucking mess designed
    by idiots.

    There is no problem using socket select with Windows. Here is an
    implementation of a server doing that:

    http://www.dmitry-kazakov.de/ada/components.htm#17.1

    You can check the Windows implementation of to learn how it is done with Windows sockets.

    Historically UNIX started with singe fork() call. There was nothing but
    files, no system objects, nothing.

    fork() copies the entire process space. No idea what you mean by "system objects". Must be some windows thing.

    Objects managed by the OS.

    On the other hand, Windows NT was developed by people influenced with
    the VMS design. VMS had a very elaborated process communication API. So
    Windows inherited much of that, but must importantly the concept of
    system resources managed by the OS.

    Windows NT was a slow unreliable dog.

    It is not slow. Actually you can get same or better performance under
    Windows as under Linux. The problem is the default settings of the
    scheduling time interval. It is 10ms by default. Set it to 1ms and you
    will see the difference. Unfortunately 1ms is the hard limit. If you
    want it better, OK, there is VxWorks where you can go under 1ms.

    --
    Regards,
    Dmitry A. Kazakov
    http://www.dmitry-kazakov.de

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Sebastian@21:1/5 to Dmitry A. Kazakov on Sun Aug 25 07:50:20 2024
    XPost: comp.unix.shell, comp.unix.programmer

    In comp.unix.programmer Dmitry A. Kazakov <mailbox@dmitry-kazakov.de> wrote:
    Windows did many things wrong, but accessing file descriptors by numbers
    is beyond even Windows. In Windows a file is an OS object. You access it getting an opaque handle to. Note that a handle can be marshaled from
    one process to another. Try that with process-local numbers!

    UNIX domain sockets support the passing of file descriptors between
    processes.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dmitry A. Kazakov@21:1/5 to Sebastian on Sun Aug 25 12:32:10 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 2024-08-25 09:50, Sebastian wrote:
    In comp.unix.programmer Dmitry A. Kazakov <mailbox@dmitry-kazakov.de> wrote:
    Windows did many things wrong, but accessing file descriptors by numbers
    is beyond even Windows. In Windows a file is an OS object. You access it
    getting an opaque handle to. Note that a handle can be marshaled from
    one process to another. Try that with process-local numbers!

    UNIX domain sockets support the passing of file descriptors between processes.

    File descriptor (a pointer to) is not file number.

    You cannot pass number 1 simply because 1 is already in use.

    --
    Regards,
    Dmitry A. Kazakov
    http://www.dmitry-kazakov.de

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Lawrence D'Oliveiro on Sat Aug 31 17:06:05 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 31/08/2024 01:49, Lawrence D'Oliveiro wrote:
    On Thu, 29 Aug 2024 14:05:41 +0200, David Brown wrote:

    ... put in so much extra
    crap and silliness that readers get caught up in that instead of
    noticing that most of the function is meaningless.

    Interesting. Now you are trying to claim that, because you don’t
    understand what the code does, that makes it somehow “meaningless”?

    I covered that in an earlier post. If you didn't bother reading it
    earlier, why should I bother posting it again?

    To be fair, it's possible that what you posted was only part of a real function.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From candycanearter07@21:1/5 to Lawrence D'Oliveiro on Sat Sep 7 18:30:03 2024
    XPost: comp.unix.shell, comp.unix.programmer

    Lawrence D'Oliveiro <ldo@nz.invalid> wrote at 22:57 this Thursday (GMT):
    On Thu, 29 Aug 2024 14:24:01 +0200, David Brown wrote:

    def foo(a, b, c) :
    if a :
    if b :
    if c :
    doThis()

    That looks unfinished to me. So I will add a "return" at the end (with
    a single tab indent, in this case).

    A redundant “return” ... kind of like my redundant “#end” comments, except
    yours work in a more restricted set of places ...

    Don't you ever just accept that a language is the way it is, and it is
    perfectly useable that way?

    Of course not.

    Or think that perhaps other people in the world know better than you do
    about how they want their language to work?

    And vice versa.

    Has it never occurred to you that the people behind a given
    language - such as Python - considered various alternatives and decided
    that making it the way they did was the best choice overall for the
    language they wanted?

    Barring a few obvious stupidities, yes of course they were, and are, smart people.


    Subjectively, I prefer early returns over nested ifs:

    def foo(a, b, c):
    if !a: return
    if !b: return
    if !c: return

    doThis()
    --
    user <candycane> is generated from /dev/urandom

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to All on Sat Sep 7 22:48:10 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Sat, 7 Sep 2024 18:30:03 -0000 (UTC), candycanearter07 wrote:

    Subjectively, I prefer early returns over nested ifs:

    Nested ifs nest, early returns don’t.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Scott Lurndal@21:1/5 to Lawrence D'Oliveiro on Sat Sep 14 19:10:06 2024
    XPost: comp.unix.shell, comp.unix.programmer

    Lawrence D'Oliveiro <ldo@nz.invalid> writes:
    On Sat, 14 Sep 2024 10:06:12 +0200, Janis Papanagnou wrote:

    On 30.08.2024 04:53, Lawrence D'Oliveiro wrote:

    Emacs makes no such assumption, and can also edit non-text files.

    You have obviously no clue.

    I have actually used it for that. That’s my “clue” to you.

    You elided context to make a bogus point. Typical.

    On 30.08.2024 04:53, Lawrence D'Oliveiro wrote:

    LDO: >> Vim is only good for text-editing, though.


    Janis:> You have obviously no clue.

    Janis is correct, you have no clue

    $ man vim | grep -i binary

    -b Binary mode. A few options will be set that makes it possible to edit a binary or executable file.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Scott Lurndal on Sat Sep 14 22:25:53 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Sat, 14 Sep 2024 19:10:06 GMT, Scott Lurndal wrote:

    $ man vim | grep -i binary

    -b Binary mode. A few options will be set that makes it
    possible to edit a binary or executable file.

    Wow, a special mode just to edit binary files, when Emacs can do it in
    its regular mode.

    More on vim’s “binary” mode here <https://vi.stackexchange.com/questions/343/how-to-edit-binary-files-with-vim>: It just sets a bunch of options to minimize the chance of screwing up
    the file in ways you don’t want. Apart from that, it’s still editing
    it as a text file.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Muttley@dastardlyhq.com@21:1/5 to All on Sun Sep 15 09:06:51 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Sat, 14 Sep 2024 22:25:53 -0000 (UTC)
    Lawrence D'Oliveiro <ldo@nz.invalid> boringly babbled:
    On Sat, 14 Sep 2024 19:10:06 GMT, Scott Lurndal wrote:

    $ man vim | grep -i binary

    -b Binary mode. A few options will be set that makes it
    possible to edit a binary or executable file.

    Wow, a special mode just to edit binary files, when Emacs can do it in
    its regular mode.

    The 1980s phoned, they want their editor wars back.

    It just sets a bunch of options to minimize the chance of screwing up
    the file in ways you don’t want. Apart from that, it’s still editing
    it as a text file.

    Any sane person uses a dedicated hex editor to edit binary files, not vim
    or emacs.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Muttley@dastardlyhq.com on Sun Aug 18 16:59:02 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 17/08/2024 11:01, Muttley@dastardlyhq.com wrote:
    On Fri, 16 Aug 2024 15:02:20 -0000 (UTC)
    kalevi@kolttonen.fi (Kalevi Kolttonen) gabbled:
    So it is indeed a vague question of what belongs in given programming
    languages.

    Indeed. And this gives rise to inconsistency. Why is threading now considered a core part of C++ but multi process isn't? Perhaps because Windows is hopeless
    at the latter in user space but it could just be personal preference within the
    C++ steering committee, who knows.


    No, it is because of what the term "program" usually means, along with
    the terms "process" and "thread" (at the OS level). With C++, you write "programs", and each process is a running program. Like most languages,
    C++ does not cover what happens outside the program - that's part of the
    OS specification, or specifications for other programs or other parts of
    the complete system. But threads are /within/ the program, and thus
    covered (to at least some extent) by the language used to write the program.

    It has nothing to do with OS's and their strengths or weaknesses (real
    or perceived).

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Kalevi Kolttonen on Sun Aug 18 16:55:00 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 16/08/2024 17:02, Kalevi Kolttonen wrote:
    In comp.unix.programmer Kaz Kylheku <643-408-1753@kylheku.com> wrote:
    On 2024-08-15, Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
    On Thu, 15 Aug 2024 19:48:36 -0000 (UTC), Kalevi Kolttonen wrote:

    The last I checked, the O'Reilly Python book is just absolutely
    *MASSIVE*. The language has a huge number of features now ...

    No, it hasn’t. The core language reference spec is only a small fraction >>> of, say, the Java language spec.

    It’s just that you can do so many things with Python. And that is down to >>> the huge variety of off-the-shelf addon libraries that build on that core >>> language spec. It has to be a strong, very solidly founded core in order >>> to be such a versatile basis for these addons, and it is.

    That's idiotic; you're saying that the standard library packages of
    Python are not part of Python, and do not contribute to its size.

    You seem to have a point. The core of C language is also small. I
    guess they even said in the original K & R book that C is a small
    language best described by a small book.

    But in order to do anything with C, you need to know the standard
    libraries. They have grown bigger and bigger during all these
    years. One could also well argue that to program on UNIX, you also
    need to know all the POSIX libraries.


    Absolute nonsense.

    In order to use a programming language for a given task, you need to
    know the basics of the language and libraries appropriate for the task.
    You most certainly do not need to know all about the language, or all
    about all the libraries provided as standard for the language or the
    host OS.

    You usually need to know /some/ of a language's standard libraries, but
    far from all of it. And unless you are writing a compiler, you don't
    need to know all of the core language for most languages. And that
    applies equally to languages with relatively small cores and standard libraries, like C.

    Without looking it up, what does the C standard library "fegetmode"
    function do? What does "static" mean inside square brackets in a C
    function prototype? What are the differences in the rules for integer constants in C90 and C99? What functions are in the POSIX header
    <libgen.h> ?

    Do you think people "can't do anything with C" if they can't answer
    those questions?


    So it is indeed a vague question of what belongs in given programming languages.


    That is true, but not for the reason you gave.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Muttley@dastardlyhq.com@21:1/5 to All on Sun Aug 18 15:45:58 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Sun, 18 Aug 2024 12:19:10 +0200
    "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> boringly babbled:
    On 2024-08-18 10:30, Muttley@dastardlyhq.com wrote:

    The windows process API is crippled which is why threading is the main
    parallel processing method in Windows and has been since 3.0.

    Threading is the main method because of its performance in a tight
    coupled application. Crossing the process borders is very expensive.

    Most (all?) versions of unix use copy-on-write when forking so while the processes are only reading its no different to threading. I doubt windows implements CoW since - in user space at least - it can't do fork and you wouldn't need it for executing a brand new process from scratch.

    Also shared memory is pretty cheap too.

    otherwise please give some examples. However I distincly remember trying to >> port server to windows only to discover that sockets are some wierd
    structure in windows instead of a simple file descriptor meaning it was
    impossible to multiplex using poll() or select() on them, you had to have
    a seperate thread to manage each connection. What a fucking mess designed
    by idiots.

    There is no problem using socket select with Windows. Here is an >implementation of a server doing that:

    http://www.dmitry-kazakov.de/ada/components.htm#17.1

    You can check the Windows implementation of to learn how it is done with >Windows sockets.

    No idea what the pages of all that crap is.

    Windows sockets are not integers , they can't be multiplexed with file descriptors, pipes etc in a single call.

    fork() copies the entire process space. No idea what you mean by "system
    objects". Must be some windows thing.

    Objects managed by the OS.

    Like what? Why does the OS need to manage "objects"?

    Windows NT was a slow unreliable dog.

    It is not slow. Actually you can get same or better performance under
    Windows as under Linux. The problem is the default settings of the

    I'm not talking about now, I was talking about when NT came out. Learn to
    read.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Muttley@dastardlyhq.com@21:1/5 to All on Sun Aug 18 15:23:04 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Sun, 18 Aug 2024 16:59:02 +0200
    David Brown <david.brown@hesbynett.no> boringly babbled:
    On 17/08/2024 11:01, Muttley@dastardlyhq.com wrote:
    On Fri, 16 Aug 2024 15:02:20 -0000 (UTC)
    kalevi@kolttonen.fi (Kalevi Kolttonen) gabbled:
    So it is indeed a vague question of what belongs in given programming
    languages.

    Indeed. And this gives rise to inconsistency. Why is threading now considered

    a core part of C++ but multi process isn't? Perhaps because Windows is >hopeless
    at the latter in user space but it could just be personal preference within >the
    C++ steering committee, who knows.


    No, it is because of what the term "program" usually means, along with
    the terms "process" and "thread" (at the OS level). With C++, you write >"programs", and each process is a running program. Like most languages,
    C++ does not cover what happens outside the program - that's part of the
    OS specification, or specifications for other programs or other parts of
    the complete system. But threads are /within/ the program, and thus
    covered (to at least some extent) by the language used to write the program.

    Sorry, thats just word salad. The program is the code, how many copies of it are running is irrelevant.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dmitry A. Kazakov@21:1/5 to Muttley@dastardlyhq.com on Sun Aug 18 18:13:37 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 2024-08-18 17:45, Muttley@dastardlyhq.com wrote:
    On Sun, 18 Aug 2024 12:19:10 +0200
    "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> boringly babbled:
    On 2024-08-18 10:30, Muttley@dastardlyhq.com wrote:

    The windows process API is crippled which is why threading is the main
    parallel processing method in Windows and has been since 3.0.

    Threading is the main method because of its performance in a tight
    coupled application. Crossing the process borders is very expensive.

    Most (all?) versions of unix use copy-on-write when forking

    You seems do not understand that spawning a process is not an issue of interprocess communications. It is synchronization, e.g. events, mutexes
    which is.

    Also shared memory is pretty cheap too.

    Again, you need to synchronize in order to access shared objects, not to mention elaboration of such objects, e.g. calling constructors and
    destructors. With threads there is a linker support in most languages.
    With processes you are on your own.

    In the same library you might find portable implementation of basic communication objects and compare Windows vs Linux vs BSD implementations:

    http://www.dmitry-kazakov.de/ada/components.htm#12

    No idea what the pages of all that crap is.

    Hmm, if you ever dealt with networking applications you should have had
    some idea...

    Windows sockets are not integers ,

    Windows did many things wrong, but accessing file descriptors by numbers
    is beyond even Windows. In Windows a file is an OS object. You access it getting an opaque handle to. Note that a handle can be marshaled from
    one process to another. Try that with process-local numbers!

    they can't be multiplexed with file
    descriptors, pipes etc in a single call.

    Of course it can. Windows overlapped I/O supports sockets.

    fork() copies the entire process space. No idea what you mean by "system >>> objects". Must be some windows thing.

    Objects managed by the OS.

    Like what? Why does the OS need to manage "objects"?

    Like a graphic context or a mutex. Things that leak if the process dies
    unless the OS takes care of.

    I'm not talking about now, I was talking about when NT came out. Learn to read.

    Honestly I do not know what you are talking about. The option to change
    the scheduling interval existed in Windows NT.

    If you want to compare Windows vs UNIX API, create a table and list
    commonly used process communication things. In the cells write the API
    call. E.g. mutex, pipe, pulse event etc.

    --
    Regards,
    Dmitry A. Kazakov
    http://www.dmitry-kazakov.de

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kaz Kylheku@21:1/5 to Dmitry A. Kazakov on Sun Aug 18 16:46:07 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 2024-08-18, Dmitry A. Kazakov <mailbox@dmitry-kazakov.de> wrote:
    On 2024-08-17 23:51, Lawrence D'Oliveiro wrote:
    On Sat, 17 Aug 2024 12:58:31 +0200, Dmitry A. Kazakov wrote:

    Windows inter-process API are far more advanced than what UNIX ever had. >>> It would be enough to mention famous file locks.

    Except those file locks are more of a liability than an asset.

    Like so many things in UNIX...

    They are
    what prevent you from continuing to use a Windows system while it is being >> updated, for example.

    Windows mutex gets collected when the last process using it dies. UNIX
    file lock does not.

    Windows mutexes are mainly useful only for ensuring the dubious feature of allowing only one instance of an application to run.

    If a mutex is actually used to protect shared data against concurrent
    access, and the owner dies while holding the mutex, the next thread
    to try to grab the mutex must be informed so it can try to recover
    the shared data into a sane state.

    POSIX process-shared mutexes have this "robust" feature as an option.

    --
    TXR Programming Language: http://nongnu.org/txr
    Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
    Mastodon: @Kazinator@mstdn.ca

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kaz Kylheku@21:1/5 to Dmitry A. Kazakov on Sun Aug 18 16:52:18 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 2024-08-18, Dmitry A. Kazakov <mailbox@dmitry-kazakov.de> wrote:
    If you want to compare Windows vs UNIX API, create a table and list
    commonly used process communication things. In the cells write the API
    call. E.g. mutex, pipe, pulse event etc.

    PulseEvent is an unreliable API left over from 16 bit Windows.
    It can only work meaningfully under cooperative multitasking on
    a single processor.

    Even Windows NT apologists from 1996 era comp.sys.os.advocacy
    knew things like this; when/where were you beamed in from?

    --
    TXR Programming Language: http://nongnu.org/txr
    Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
    Mastodon: @Kazinator@mstdn.ca

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dmitry A. Kazakov@21:1/5 to Kaz Kylheku on Sun Aug 18 20:07:39 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 2024-08-18 18:52, Kaz Kylheku wrote:
    On 2024-08-18, Dmitry A. Kazakov <mailbox@dmitry-kazakov.de> wrote:
    If you want to compare Windows vs UNIX API, create a table and list
    commonly used process communication things. In the cells write the API
    call. E.g. mutex, pipe, pulse event etc.

    PulseEvent is an unreliable API left over from 16 bit Windows.

    It has a race condition, yes. But the argument is "Green are the grapes."

    --
    Regards,
    Dmitry A. Kazakov
    http://www.dmitry-kazakov.de

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dmitry A. Kazakov@21:1/5 to Kaz Kylheku on Sun Aug 18 20:11:20 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 2024-08-18 18:46, Kaz Kylheku wrote:

    If a mutex is actually used to protect shared data against concurrent
    access, and the owner dies while holding the mutex, the next thread
    to try to grab the mutex must be informed so it can try to recover
    the shared data into a sane state.

    There is no recovery if a protected operation crashes, because the state
    of the object is unknown.

    --
    Regards,
    Dmitry A. Kazakov
    http://www.dmitry-kazakov.de

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Richard Kettlewell@21:1/5 to Muttley@dastardlyhq.com on Sun Aug 18 22:15:53 2024
    XPost: comp.unix.shell, comp.unix.programmer

    Muttley@dastardlyhq.com writes:
    Most (all?) versions of unix use copy-on-write when forking so while the processes are only reading its no different to threading. I doubt windows implements CoW since - in user space at least - it can't do fork and you wouldn't need it for executing a brand new process from scratch.

    It does. It’s still a handy optimization for the mutable parts of
    executables and (particularly) shared libraries even in the absence of
    fork.

    AIUI the kernel API gives you enough to implement fork (and that’s how
    the POSIX subsystem worked when that was still a thing), but good luck
    finding any public documentation about it.

    Windows sockets are not integers,

    They are an unsigned integer type, I think 64 bits currently.

    --
    https://www.greenend.org.uk/rjk/

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Dmitry A. Kazakov on Sun Aug 18 23:14:33 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Sun, 18 Aug 2024 10:10:09 +0200, Dmitry A. Kazakov wrote:

    On 2024-08-17 23:51, Lawrence D'Oliveiro wrote:

    On Sat, 17 Aug 2024 12:58:31 +0200, Dmitry A. Kazakov wrote:

    Windows inter-process API are far more advanced than what UNIX ever
    had. It would be enough to mention famous file locks.

    Except those file locks are more of a liability than an asset.

    Like so many things in UNIX...

    People voluntarily choose to use Unix-type OSes. There’s a reason why Unix-type OSes are the official de-facto standard in the computing world,
    not Windows.

    They are what prevent you from continuing to use a Windows system while
    it is being updated, for example.

    Windows mutex gets collected when the last process using it dies. UNIX
    file lock does not.

    What happens to a file lock when there is no file for it to lock?

    The reason why processes are not included is that they are used to
    deal with some OS or design flaw that forces you to spawn some script
    or application.

    Or because the *nix tradition of being able to spawn a pipeline of
    multiple processes, all cooperating to perform a common task, is
    difficult and expensive, or even unreliable, under Windows.

    It is as expensive under Windows as it is under UNIX.

    No it isn’t. An example is Git, which initially was built around the fork- multiple-processes model as with traditional *nix software, and ran fine
    that way on Linux, but had to compromise on that idea a bit in order to
    gain acceptance under Windows.

    Remember, the current Windows (aka Windows NT) was masterminded by Dave
    Cutler, who came from the nest of Unix-haters at DEC. He carried over many
    of the characteristics of his last major brainchild there, VMS. One of
    them is that creating multiple processes is expensive, so you try to avoid
    it.

    Windows has a pipe object named and anonymous. No problem.

    One problem: you can’t use them with poll/select calls.

    P.S. It is no wonder that Windows process API are far beyond UNIX.

    Linux has clone(2). This can create regular POSIX-style processes, as well
    as regular POSIX-style threads. And quite a few things in-between.

    On the other hand, Windows NT was developed by people influenced with
    the VMS design. VMS had a very elaborated process communication API.

    And single drive letters?

    They usually require processes be able to run on different nodes.

    Massive parallelism is something else Linux does better than Windows.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Dmitry A. Kazakov on Sun Aug 18 23:18:01 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Sun, 18 Aug 2024 18:13:37 +0200, Dmitry A. Kazakov wrote:

    Windows did many things wrong, but accessing file descriptors by numbers
    is beyond even Windows. In Windows a file is an OS object. You access it getting an opaque handle to. Note that a handle can be marshaled from
    one process to another. Try that with process-local numbers!

    Actually, that is a standard feature of “Unix” sockets, as available on Linux, the BSDs, and all the other *nixes: being able to pass file
    descriptors for open files from one process to another.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Eric Pozharski@21:1/5 to Dmitry A. Kazakov on Sun Aug 18 20:47:46 2024
    XPost: comp.unix.programmer

    ["Followup-To:" header set to comp.unix.programmer.]
    ["Newsgroups:" comp.unix.shell has been dropped.]
    with <v9pvoo$1sn55$1@dont-email.me> Dmitry A. Kazakov wrote:
    On 2024-08-17 11:01, Muttley@dastardlyhq.com wrote:
    On Fri, 16 Aug 2024 15:02:20 -0000 (UTC)
    kalevi@kolttonen.fi (Kalevi Kolttonen) gabbled:

    So it is indeed a vague question of what belongs in given
    programming languages.
    Indeed. And this gives rise to inconsistency. Why is threading now
    considered a core part of C++ but multi process isn't? Perhaps
    because Windows is hopeless at the latter in user space but it could
    just be personal preference within the C++ steering committee, who
    knows.
    Windows inter-process API are far more advanced than what UNIX ever
    had. It would be enough to mention famous file locks. These days

    But at what cost? (Hint: <CVE-2024-38063>.)

    *SKIP* [ 6 lines 1 level deep]

    --
    Torvalds' goal for Linux is very simple: World Domination
    Stallman's goal for GNU is even simpler: Freedom

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kaz Kylheku@21:1/5 to Dmitry A. Kazakov on Mon Aug 19 04:54:44 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 2024-08-18, Dmitry A. Kazakov <mailbox@dmitry-kazakov.de> wrote:
    On 2024-08-18 18:46, Kaz Kylheku wrote:

    If a mutex is actually used to protect shared data against concurrent
    access, and the owner dies while holding the mutex, the next thread
    to try to grab the mutex must be informed so it can try to recover
    the shared data into a sane state.

    There is no recovery if a protected operation crashes, because the state
    of the object is unknown.

    That is false; the object's state can be analyzed and repaired. How
    easily you can do that depends on the data structure and algorithms
    used to manipulate it. Think of recoverable file systems.

    --
    TXR Programming Language: http://nongnu.org/txr
    Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
    Mastodon: @Kazinator@mstdn.ca

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dmitry A. Kazakov@21:1/5 to Kaz Kylheku on Mon Aug 19 09:09:09 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 2024-08-19 06:54, Kaz Kylheku wrote:
    On 2024-08-18, Dmitry A. Kazakov <mailbox@dmitry-kazakov.de> wrote:
    On 2024-08-18 18:46, Kaz Kylheku wrote:

    If a mutex is actually used to protect shared data against concurrent
    access, and the owner dies while holding the mutex, the next thread
    to try to grab the mutex must be informed so it can try to recover
    the shared data into a sane state.

    There is no recovery if a protected operation crashes, because the state
    of the object is unknown.

    That is false; the object's state can be analyzed and repaired.

    The object must be designed in a special way in order to support roll
    backs etc. Such techniques exclude concurrent access, e.g. memory is
    never overwritten etc.

    --
    Regards,
    Dmitry A. Kazakov
    http://www.dmitry-kazakov.de

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Keith Thompson on Mon Aug 19 09:44:56 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 18/08/2024 21:24, Keith Thompson wrote:
    David Brown <david.brown@hesbynett.no> writes:
    [...]
    Without looking it up, what does the C standard library "fegetmode"
    function do?

    Nothing, it's specific to GNU libc.


    (This has been discussed in a follow-up in comp.lang.c, but others here
    might not see that.)

    The function is in standard C23, but not earlier C standard versions.
    C23 has not yet been adopted by ISO (it is due in a couple of months),
    so "fegetmode" is not part of current standard C. But it will be soon.

    Anyway, the point is that most C programmers can write useful C code
    without knowing about such functions. I didn't intend to pick a new C23 function as an example, just a relatively obscure C standard library
    function, and the standard version I happened to have open at the time
    was C23.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dmitry A. Kazakov@21:1/5 to Lawrence D'Oliveiro on Mon Aug 19 09:37:39 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 2024-08-19 01:14, Lawrence D'Oliveiro wrote:
    On Sun, 18 Aug 2024 10:10:09 +0200, Dmitry A. Kazakov wrote:

    On 2024-08-17 23:51, Lawrence D'Oliveiro wrote:

    On Sat, 17 Aug 2024 12:58:31 +0200, Dmitry A. Kazakov wrote:

    Windows inter-process API are far more advanced than what UNIX ever
    had. It would be enough to mention famous file locks.

    Except those file locks are more of a liability than an asset.

    Like so many things in UNIX...

    People voluntarily choose to use Unix-type OSes. There’s a reason why Unix-type OSes are the official de-facto standard in the computing world,
    not Windows.

    Both OSes contributed to the Dark Ages of computing. The reasons are not technical, because both were worst on the market. The similar process
    happened with programming languages, e.g. C and with the hardware architectures, e.g. x86. It is always a race to the bottom...

    They are what prevent you from continuing to use a Windows system while
    it is being updated, for example.

    Windows mutex gets collected when the last process using it dies. UNIX
    file lock does not.

    What happens to a file lock when there is no file for it to lock?

    Windows does not use lock files. Under Linux you must log in as the root
    and remove the stray file lock manually. It happens in UNIX
    administration all the time.

    Remember, the current Windows (aka Windows NT) was masterminded by Dave Cutler, who came from the nest of Unix-haters at DEC. He carried over many
    of the characteristics of his last major brainchild there, VMS. One of
    them is that creating multiple processes is expensive, so you try to avoid it.

    A wise decision. The look of UNIX SysV process list was a sheer horror
    to any user of RSX or VMS. No wonder UNIX was many times slower on same machines. A VMS 1Mb machine supported 4 users running an interactive IDE sessions (in LSE). UNIX users enjoyed Vi and permanent fatal crashes.
    The early filesystem rewrote the master block, so after the crash you
    could not boot anymore and have to restore the system from the tape.
    Under RSX you could turn the main disk off and on without reboot.

    The reason why Windows NT could no compete Linux on servers is
    unbearable maintenance and being fat. Linux had a monolithic kernel. I
    compiled it for each machine to include only drivers I needed. I did not install X11 stuff. The result was twice leaner than Windows NT.

    On the other hand you still cannot have decent gaming under Linux.

    Windows has a pipe object named and anonymous. No problem.

    One problem: you can’t use them with poll/select calls.

    You can. See overlapped I/O.

    P.S. It is no wonder that Windows process API are far beyond UNIX.

    Linux has clone(2). This can create regular POSIX-style processes, as well
    as regular POSIX-style threads. And quite a few things in-between.

    On the other hand, Windows NT was developed by people influenced with
    the VMS design. VMS had a very elaborated process communication API.

    And single drive letters?

    They are dozens characters long actually, if you mean the device names.

    --
    Regards,
    Dmitry A. Kazakov
    http://www.dmitry-kazakov.de

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Dmitry A. Kazakov on Mon Aug 19 08:45:26 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Mon, 19 Aug 2024 09:37:39 +0200, Dmitry A. Kazakov wrote:

    On 2024-08-19 01:14, Lawrence D'Oliveiro wrote:

    Both OSes contributed to the Dark Ages of computing. The reasons are not technical, because both were worst on the market.

    To paraphrase Winston Churchill: “Unix is the worst OS in the world ...
    apart from all the others.”

    Windows does not use lock files.

    *nix systems don’t need them either.

    The reason why Windows NT could no compete Linux on servers is
    unbearable maintenance and being fat. Linux had a monolithic kernel. I compiled it for each machine to include only drivers I needed. I did not install X11 stuff. The result was twice leaner than Windows NT.

    You don’t think the design of Windows NT contributed to that failure?

    On the other hand you still cannot have decent gaming under Linux.

    Actually, you can. Look at the Steam Deck, which runs a purpose-built GUI
    for handheld gaming. Microsoft has been talking about bringing out a
    Windows “Handheld Mode” for about two years now, but still has nothing to ship.

    On Sun, 18 Aug 2024 10:10:09 +0200, Dmitry A. Kazakov wrote:

    Windows has a pipe object named and anonymous. No problem.

    One problem: you can’t use them with poll/select calls.

    You can. See overlapped I/O.

    I said “poll/select calls”. Do you not know what those are? On Windows, they work with sockets, but not with pipes. Or even ordinary files. So
    unlike *nix systems, you have to keep in mind the different kinds of files
    you might be working with.

    And single drive letters?

    They are dozens characters long actually, if you mean the device names.

    Drive names are only single letters. You’re not talking about reserved
    file names, are you?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Muttley@dastardlyhq.com@21:1/5 to All on Mon Aug 19 08:31:29 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Sun, 18 Aug 2024 18:13:37 +0200
    "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> boringly babbled:
    On 2024-08-18 17:45, Muttley@dastardlyhq.com wrote:
    On Sun, 18 Aug 2024 12:19:10 +0200
    "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> boringly babbled:
    On 2024-08-18 10:30, Muttley@dastardlyhq.com wrote:

    The windows process API is crippled which is why threading is the main >>>> parallel processing method in Windows and has been since 3.0.

    Threading is the main method because of its performance in a tight
    coupled application. Crossing the process borders is very expensive.

    Most (all?) versions of unix use copy-on-write when forking

    You seems do not understand that spawning a process is not an issue of >interprocess communications. It is synchronization, e.g. events, mutexes >which is.

    Huh? I'm talking about the cost of spawning a CoW process vs a thread.

    Also shared memory is pretty cheap too.

    Again, you need to synchronize in order to access shared objects, not to >mention elaboration of such objects, e.g. calling constructors and >destructors. With threads there is a linker support in most languages.
    With processes you are on your own.

    No idea what you're talking about. Wtf have constructors and destructors
    got to do with forking a process? A process fork involves creating a new process table entry with a copy of all the parents memory page pointers and thats pretty much it, until the child process starts to change some page data then CoW kicks in.

    In the same library you might find portable implementation of basic >communication objects and compare Windows vs Linux vs BSD implementations:

    http://www.dmitry-kazakov.de/ada/components.htm#12

    No idea what the pages of all that crap is.

    Hmm, if you ever dealt with networking applications you should have had
    some idea...

    I've probably written more network applications than you can imagine and
    the networking functionality side - on unix - is usually pretty simple (unless you have to use OpenSSL then things can get tricky). I don't know why you would need all those pages of code just to handle sockets.

    Windows sockets are not integers ,

    Windows did many things wrong, but accessing file descriptors by numbers
    is beyond even Windows. In Windows a file is an OS object. You access it >getting an opaque handle to. Note that a handle can be marshaled from
    one process to another. Try that with process-local numbers!

    Open sockets are inherited by the child process after fork(). No marshalling nonsense required.

    they can't be multiplexed with file
    descriptors, pipes etc in a single call.

    Of course it can. Windows overlapped I/O supports sockets.

    Not last time I tried it (2019) it didn't.

    Like what? Why does the OS need to manage "objects"?

    Like a graphic context or a mutex. Things that leak if the process dies >unless the OS takes care of.

    Unix uses X11 (or wayland if you're unlucky) for graphics - even MacOS with XQuartx installed. When the process dies all its graphics contexts die with it and the OS is not involved.

    I'm not talking about now, I was talking about when NT came out. Learn to
    read.

    Honestly I do not know what you are talking about. The option to change
    the scheduling interval existed in Windows NT.

    *sigh* Never mind.

    If you want to compare Windows vs UNIX API, create a table and list
    commonly used process communication things. In the cells write the API
    call. E.g. mutex, pipe, pulse event etc.

    I have something called "a life" so no, I'm not wasting hours just to keep
    some random poster happy. I'm sure someone has already done it and it can be googled.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Dmitry A. Kazakov on Mon Aug 19 10:40:32 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 19/08/2024 09:37, Dmitry A. Kazakov wrote:
    On 2024-08-19 01:14, Lawrence D'Oliveiro wrote:
    On Sun, 18 Aug 2024 10:10:09 +0200, Dmitry A. Kazakov wrote:

    On 2024-08-17 23:51, Lawrence D'Oliveiro wrote:

    On Sat, 17 Aug 2024 12:58:31 +0200, Dmitry A. Kazakov wrote:

    Windows inter-process API are far more advanced than what UNIX ever
    had. It would be enough to mention famous file locks.

    Except those file locks are more of a liability than an asset.

    Like so many things in UNIX...

    People voluntarily choose to use Unix-type OSes. There’s a reason why
    Unix-type OSes are the official de-facto standard in the computing world,
    not Windows.

    Both OSes contributed to the Dark Ages of computing. The reasons are not technical, because both were worst on the market.

    What sort of time-frame are you thinking of here, what were the
    alternatives that you think were "better", what markets or uses are you considering, and in what way were other OS's "better" ?

    There's no doubt that non-technical issues have had a big influence on
    which OS's or types of OS have succeeded, but you seem to have something specific in mind.


    The similar process
    happened with programming languages, e.g. C and with the hardware architectures, e.g. x86. It is always a race to the bottom...


    The success of the x86 was very much a race to the bottom - it was
    picked specifically to give a cheaper system rather than the technically superior architecture (m68k) preferred by the engineers. Momentum and backwards compatibility has kept it going ever since.

    I am not as convinced with respect to C. It certainly has its flaws,
    and it certainly has been, and continues to be, used in situations where
    it is not a good choice of language. But I think much of the bad
    reputation of C is the result of poor C programmers and poor use of the language, rather than the language itself. Good programmers will write
    good code in any language, bad programmers (or badly managed
    programmers) will write bad code in any language.

    They are what prevent you from continuing to use a Windows system while >>>> it is being updated, for example.

    Windows mutex gets collected when the last process using it dies. UNIX
    file lock does not.

    What happens to a file lock when there is no file for it to lock?

    Windows does not use lock files.

    Windows has locks on files, which are a different thing. While I can understand the point of them, they can be a real inconvenience (try
    deleting a directory tree when a file from that tree is in use).

    Under Linux you must log in as the root
    and remove the stray file lock manually. It happens in UNIX
    administration all the time.

    As someone who has administrated Linux servers for decades, and used it
    as my desktop OS on many machines, I am not sure I can ever remember
    removing a stray lock file. Certainly needing to do so "all the time"
    is a very wild exaggeration. Linux, like all systems, undoubtedly has
    its flaws and weaknesses, but this is not one of them IME.


    Remember, the current Windows (aka Windows NT) was masterminded by Dave
    Cutler, who came from the nest of Unix-haters at DEC. He carried over
    many
    of the characteristics of his last major brainchild there, VMS. One of
    them is that creating multiple processes is expensive, so you try to
    avoid
    it.

    A wise decision. The look of UNIX SysV process list was a sheer horror
    to any user of RSX or VMS. No wonder UNIX was many times slower on same machines. A VMS 1Mb machine supported 4 users running an interactive IDE sessions (in LSE). UNIX users enjoyed Vi and permanent fatal crashes.
    The early filesystem rewrote the master block, so after the crash you
    could not boot anymore and have to restore the system from the tape.
    Under RSX you could turn the main disk off and on without reboot.


    Times change. Needs and uses change. Hardware changes.

    Keeping things separate and modular has advantages in scalability,
    security and stability. Keeping things monolithic has advantages in
    efficiency (speed and memory) and consistency. There is no "right" answer.

    The reason why Windows NT could no compete Linux on servers is
    unbearable maintenance and being fat. Linux had a monolithic kernel. I compiled it for each machine to include only drivers I needed. I did not install X11 stuff. The result was twice leaner than Windows NT.

    On the other hand you still cannot have decent gaming under Linux.


    I do almost all my gaming under Linux. Some games do work better under Windows, but that is primarily because most games developers target
    Windows as their main platform. It may also be because Linux systems
    are more varied.

    Windows has a pipe object named and anonymous. No problem.

    One problem: you can’t use them with poll/select calls.

    You can. See overlapped I/O.

    P.S. It is no wonder that Windows process API are far beyond UNIX.

    Linux has clone(2). This can create regular POSIX-style processes, as
    well
    as regular POSIX-style threads. And quite a few things in-between.

    On the other hand, Windows NT was developed by people influenced with
    the VMS design. VMS had a very elaborated process communication API.

    And single drive letters?

    They are dozens characters long actually, if you mean the device names.


    I thought by "drive letters", he meant "drive letters" - "c:", "d:", etc.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dmitry A. Kazakov@21:1/5 to Lawrence D'Oliveiro on Mon Aug 19 13:03:23 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 2024-08-19 10:45, Lawrence D'Oliveiro wrote:
    On Mon, 19 Aug 2024 09:37:39 +0200, Dmitry A. Kazakov wrote:

    The reason why Windows NT could no compete Linux on servers is
    unbearable maintenance and being fat. Linux had a monolithic kernel. I
    compiled it for each machine to include only drivers I needed. I did not
    install X11 stuff. The result was twice leaner than Windows NT.

    You don’t think the design of Windows NT contributed to that failure?

    No. The design of Windows HAL was great. It is rather the business model Microsoft pursued.

    On the other hand you still cannot have decent gaming under Linux.

    Actually, you can. Look at the Steam Deck, which runs a purpose-built GUI
    for handheld gaming.

    Well, handheld gaming to gaming is like masturbation to love. Sorry...

    Microsoft has been talking about bringing out a
    Windows “Handheld Mode” for about two years now, but still has nothing to ship.

    On Sun, 18 Aug 2024 10:10:09 +0200, Dmitry A. Kazakov wrote:

    Windows has a pipe object named and anonymous. No problem.

    One problem: you can’t use them with poll/select calls.

    You can. See overlapped I/O.

    I said “poll/select calls”. Do you not know what those are? On Windows, they work with sockets, but not with pipes. Or even ordinary files. So
    unlike *nix systems, you have to keep in mind the different kinds of files you might be working with.

    Again. It is called overlapped I/O. You can start multiple
    *asynchronous* I/O operations from a thread. It can be done on any sets
    of file handles. When an I/O event happens on a handle the corresponding
    event gets signaled. select() behavior is achieved by
    WaitForMultipleObjects that waits for multiple events. Then you check
    the overlapped results. If you never wait and only check the overlapped
    results that would be polling.

    And single drive letters?

    They are dozens characters long actually, if you mean the device names.

    Drive names are only single letters. You’re not talking about reserved
    file names, are you?

    No, I am talking about proper file paths under Windows. Letters is a DOS
    layer on top of it. E.g. see QueryDosDeviceW call.

    --
    Regards,
    Dmitry A. Kazakov
    http://www.dmitry-kazakov.de

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dmitry A. Kazakov@21:1/5 to David Brown on Mon Aug 19 12:39:33 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 2024-08-19 10:40, David Brown wrote:
    On 19/08/2024 09:37, Dmitry A. Kazakov wrote:

    Both OSes contributed to the Dark Ages of computing. The reasons are
    not technical, because both were worst on the market.

    What sort of time-frame are you thinking of here, what were the
    alternatives that you think were "better", what markets or uses are you considering, and in what way were other OS's "better" ?

    There's no doubt that non-technical issues have had a big influence on
    which OS's or types of OS have succeeded, but you seem to have something specific in mind.

    I think the main reason is that we do not pay the actual costs of
    software developing. OS, compiler require huge investments. Vendors
    never passed these to the end users funding developing from other
    sources. That effectively killed the market. Free software only
    aggravated the situation. In effect it is akin to the socialist
    production method which always kills quality.

    Windows has locks on files, which are a different thing.  While I can understand the point of them, they can be a real inconvenience (try
    deleting a directory tree when a file from that tree is in use).

    Oh, yes! I understand why I should not remove a locked file, but I still
    enjoy Linux's ability to remove anything an be it all damned!

    The usual case is when Windows locks some file on the Linux Samba server
    share for some mysterious reason. It is a sheer fun to log into the
    server do "rm -rf" on the file and then go back to Windows: "eat that!"

    Under Linux you must log in as the root and remove the stray file lock
    manually. It happens in UNIX administration all the time.

    As someone who has administrated Linux servers for decades, and used it
    as my desktop OS on many machines, I am not sure I can ever remember
    removing a stray lock file.  Certainly needing to do so "all the time"
    is a very wild exaggeration.  Linux, like all systems, undoubtedly has
    its flaws and weaknesses, but this is not one of them IME.

    In main case it is packet manager. I am too lazy to find how to turn off automatic update checks. So when I try to run apt or dnf I have to kill
    the lock.

    Times change.  Needs and uses change.  Hardware changes.

    Keeping things separate and modular has advantages in scalability,
    security and stability.  Keeping things monolithic has advantages in efficiency (speed and memory) and consistency.  There is no "right" answer.

    Yes. E.g. in automotive you still need the system booted right after you
    turned the key.

    Initially an ability to trim the system and sometimes to patch a driver
    was a huge advantage Linux had over Windows NT.

    On the other hand you still cannot have decent gaming under Linux.

    I do almost all my gaming under Linux.  Some games do work better under Windows, but that is primarily because most games developers target
    Windows as their main platform.  It may also be because Linux systems
    are more varied.

    "You are in an open field on the west side of a white house with a
    boarded front door." That sort of games? (:-))

    And single drive letters?

    They are dozens characters long actually, if you mean the device names.

    I thought by "drive letters", he meant "drive letters" - "c:", "d:", etc.

    The official file name of "C:" would be some messy string with lots of backslashes. C: is a "DOS name." There are API to convert DOS names into
    proper names. It is a mess. All Windows API is a mess.

    --
    Regards,
    Dmitry A. Kazakov
    http://www.dmitry-kazakov.de

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From vallor@21:1/5 to mailbox@dmitry-kazakov.de on Sun Aug 25 13:41:50 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Sun, 25 Aug 2024 12:32:10 +0200, "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in <vaf179$1rnhl$1@dont-email.me>:

    On 2024-08-25 09:50, Sebastian wrote:
    In comp.unix.programmer Dmitry A. Kazakov <mailbox@dmitry-kazakov.de>
    wrote:
    Windows did many things wrong, but accessing file descriptors by
    numbers is beyond even Windows. In Windows a file is an OS object. You
    access it getting an opaque handle to. Note that a handle can be
    marshaled from one process to another. Try that with process-local
    numbers!

    UNIX domain sockets support the passing of file descriptors between
    processes.

    File descriptor (a pointer to) is not file number.

    You cannot pass number 1 simply because 1 is already in use.

    On this Linux system, "man 7 unix", in the section
    "SCM_RIGHTS", it explains how the passing mechanism
    is handled. One paragraph reads:

    Commonly, this operation is referred to as "passing a
    file descriptor" to another process. However, more
    accurately, what is being passed is a reference to an
    open file description (see open(2)), and in the re‐
    ceiving process it is likely that a different file de‐
    scriptor number will be used. Semantically, this op‐
    eration is equivalent to duplicating (dup(2)) a file
    descriptor into the file descriptor table of another
    process.

    --
    -v

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Nuno Silva@21:1/5 to David Brown on Sun Aug 25 16:32:04 2024
    XPost: comp.unix.shell, comp.unix.programmer

    (Note: I'm not setting Followup-To since I don't know where the
    participants are reading this, but do note that I'm only subscribed to comp.unix.programmer. I will probably subscribe to .shell soon, though.)


    On 2024-08-21, David Brown wrote:

    On 21/08/2024 17:37, John Ames wrote:
    Yes, books can be wrong, and yes, community fora can have valuable
    information - but there really is no substitute for a good manual, in
    print or otherwise. StackOverflow is very useful for clearing up some
    kinds of esoteric-yet-common questions, but if you just need to double-
    check what the legal values for parameter X in function Y are, it's
    much quicker (and usually less error-prone) to turn to a reference
    guide than it is to go poking around looking for records of times in
    history where someone else might've had the same question.

    (Doubly so, now that Google is as friggin' useless as it's gotten the
    last few years.)


    I do like a good manual, whether it be a physical book or an online
    manual. So I am not objecting to reading them, learning from them, or
    using them as references.

    I'd say the online manual can be useful as a reference, at least in my experience with Linux programming. It also has some information on
    POSIX. And is local, so can be used even in the absence of a network
    connection of any sort.

    Do people feel differently about online manuals on other systems? Or are
    these usually good to be used as a reference? (Asking out of curiosity,
    as I don't have much experience yet coding on environments other than "GNU/Linux".)

    I am just objecting to the concept that reading particular books is
    somehow "required" in order to write "useful C" or "program for
    Linux". They are neither necessary nor sufficient, especially when
    picking one or two particular books.

    But once you start pointing out that there are bad books, doesn't that
    also imply that people commenting on which books they found good is
    useful, so that one can have an idea of which books to avoid or prefer,
    even if some comments end up being subjective to some extent?

    (But yes, it might well be the case that someone just can't work so well
    with a book as a medium and prefers some other approach. A lot of people
    these days are sharing youtube videos as "tutorials" and that's
    something I can't easily "consume", so I can kind of imagine what that'd
    be like. - Now if only Google had a GET parameter in the web (not video)
    search for "do not provide video results. ever."...)

    --
    Nuno Silva

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Nuno Silva on Sun Aug 25 18:41:21 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 25/08/2024 17:32, Nuno Silva wrote:
    (Note: I'm not setting Followup-To since I don't know where the
    participants are reading this, but do note that I'm only subscribed to comp.unix.programmer. I will probably subscribe to .shell soon, though.)


    On 2024-08-21, David Brown wrote:

    On 21/08/2024 17:37, John Ames wrote:
    Yes, books can be wrong, and yes, community fora can have valuable
    information - but there really is no substitute for a good manual, in
    print or otherwise. StackOverflow is very useful for clearing up some
    kinds of esoteric-yet-common questions, but if you just need to double-
    check what the legal values for parameter X in function Y are, it's
    much quicker (and usually less error-prone) to turn to a reference
    guide than it is to go poking around looking for records of times in
    history where someone else might've had the same question.

    (Doubly so, now that Google is as friggin' useless as it's gotten the
    last few years.)


    I do like a good manual, whether it be a physical book or an online
    manual. So I am not objecting to reading them, learning from them, or
    using them as references.

    I'd say the online manual can be useful as a reference, at least in my experience with Linux programming. It also has some information on
    POSIX. And is local, so can be used even in the absence of a network connection of any sort.


    Reference manuals relevant to the topic are, of course, extremely
    helpful to most people - whether they are physical manuals or online.
    But the key point is the /relevance/. My argument is not that books or
    manuals are unnecessary, merely that there are no universally required
    or essential references or topics. And you certainly don't need to read through an entire reference to have use of it.

    Do people feel differently about online manuals on other systems? Or are these usually good to be used as a reference? (Asking out of curiosity,
    as I don't have much experience yet coding on environments other than "GNU/Linux".)


    For many programming languages or major libraries or toolkits, there are "official" online references, manuals or documentation, and these can
    often be valuable sources of information. Often they are not at all
    suitable for reading through as a whole, and are no substitute for
    tutorials, courses, or other learning material.

    I am just objecting to the concept that reading particular books is
    somehow "required" in order to write "useful C" or "program for
    Linux". They are neither necessary nor sufficient, especially when
    picking one or two particular books.

    But once you start pointing out that there are bad books, doesn't that
    also imply that people commenting on which books they found good is
    useful, so that one can have an idea of which books to avoid or prefer,
    even if some comments end up being subjective to some extent?


    Sure. It's fine - and possibly helpful - for someone to say "I liked
    this book". It's even more helpful to have some details, such as "it
    was good for me because I was already an experienced programmer in
    languages X, Y and Z" or "it was good for me as a complete newbie who
    had to take things slowly". What is almost never helpful, is someone
    claiming that you /must/ read this book or that it is somehow
    objectively the "best".

    (But yes, it might well be the case that someone just can't work so well
    with a book as a medium and prefers some other approach. A lot of people these days are sharing youtube videos as "tutorials" and that's
    something I can't easily "consume", so I can kind of imagine what that'd
    be like. - Now if only Google had a GET parameter in the web (not video) search for "do not provide video results. ever."...)


    I think videos are a better medium than books for some things and some
    people, and vice versa. As I mentioned before, there are a great many different ways to learn (and to reference details later). The "best"
    choice at any given time depends on a large number of factors.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Dmitry A. Kazakov on Sun Aug 25 22:00:41 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Sun, 25 Aug 2024 12:32:10 +0200, Dmitry A. Kazakov wrote:

    On 2024-08-25 09:50, Sebastian wrote:

    In comp.unix.programmer Dmitry A. Kazakov <mailbox@dmitry-kazakov.de>
    wrote:

    Windows did many things wrong, but accessing file descriptors by
    numbers is beyond even Windows. In Windows a file is an OS object. You
    access it getting an opaque handle to. Note that a handle can be
    marshaled from one process to another. Try that with process-local
    numbers!

    UNIX domain sockets support the passing of file descriptors between
    processes.

    File descriptor (a pointer to) is not file number.

    You cannot pass number 1 simply because 1 is already in use.

    You implied above that “accessing descriptors by numbers” is somehow a bad thing, then when it is pointed out that *nix doesn’t actually work that
    way, you somehow insist that is a drawback as well.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Nuno Silva on Sun Aug 25 21:59:18 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Sun, 25 Aug 2024 16:32:04 +0100, Nuno Silva wrote:

    Do people feel differently about online manuals on other systems?

    I decided about 20 years ago that, if I were going to have printed manuals
    for all the material I have to know, I’d need a whole extra room in my
    house just to hold it all.

    Also, paper books related to computers start falling out of date from the moment they’re published, or even before.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to vallor on Sun Aug 25 22:02:56 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Sun, 25 Aug 2024 13:41:50 -0000 (UTC), vallor wrote:

    On this Linux system, "man 7 unix", in the section "SCM_RIGHTS", it
    explains how the passing mechanism is handled. One paragraph reads:

    Commonly, this operation is referred to as "passing a
    file descriptor" to another process. However, more
    accurately, what is being passed is a reference to an
    open file description (see open(2)), and in the re‐
    ceiving process it is likely that a different file de‐
    scriptor number will be used.

    Note the distinction between “file description” (the in-kernel data structure that stores the context about the open file), and “file descriptor” (the userland reference to the file description).

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Scott Lurndal@21:1/5 to Lawrence D'Oliveiro on Sun Sep 15 15:51:16 2024
    XPost: comp.unix.shell, comp.unix.programmer

    Lawrence D'Oliveiro <ldo@nz.invalid> writes:
    On Sat, 14 Sep 2024 19:10:06 GMT, Scott Lurndal wrote:

    $ man vim | grep -i binary

    -b Binary mode. A few options will be set that makes it
    possible to edit a binary or executable file.

    Wow, a special mode just to edit binary files

    So, you admit you were wrong. You again elided the con-text that showed
    you were incorrect. Dishonest of you, to be sure, yet typical of your
    posts.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kaz Kylheku@21:1/5 to Scott Lurndal on Sun Sep 15 15:54:01 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 2024-09-14, Scott Lurndal <scott@slp53.sl.home> wrote:
    LDO: >> Vim is only good for text-editing, though.


    Janis:> You have obviously no clue.

    Janis is correct, you have no clue

    $ man vim | grep -i binary

    -b Binary mode. A few options will be set that makes it possible to edit a binary or executable file.

    I use Vim for dynamically syntax-coloring code served by CGIT.

    You heard right.

    When CGIT presents code out of a repository, it calls a script
    in order to convert it to colorized HTML. That script can be customized.

    Mine uses expect to run Vim to load the file, set a few settings, and
    invoke the :TOhtml command to dump HTML.

    That is then post-proocessed to remove the inline style sheet. The web
    page it gets embedded into has its own CSS rules for the Vim-generated
    HTML tags.

    --
    TXR Programming Language: http://nongnu.org/txr
    Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
    Mastodon: @Kazinator@mstdn.ca

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Janis Papanagnou on Sun Sep 15 21:43:42 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 14/09/2024 10:16, Janis Papanagnou wrote:
    On 30.08.2024 21:20, Muttley@dastardlyhq.com wrote:
    On Fri, 30 Aug 2024 08:14:21 -0700
    John Ames <commodorejohn@gmail.com> gabbled:
    [...]
    Sure - but picking one that best suits your needs doesn't mean you
    can't critique its annoyances/flaws. This team-sports mentality is just
    weird.

    Some insecure people feel an attack on their favourite language is some kind >> of attack or slight against them personally. Its a pathetic and juvenile trait
    that unfortunately is found a lot amongst IT types.

    It's not restricted to languages or IT-stuff; you can see it with
    books or films or music or political or religious preferences...

    In IT we had as well various "wars" in the past. More considerate
    folks avoid such wars (and respect diversity of thoughts/opinions
    and preferences) by focusing on the facts alone. Other folks feel
    an urge to (unnecessarily) ignite them.


    Fair enough. I apologise for igniting Muttley.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Janis Papanagnou on Sun Sep 15 21:47:13 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 14/09/2024 09:59, Janis Papanagnou wrote:
    On 29.08.2024 21:36, David Brown wrote:
    On 29/08/2024 18:44, Janis Papanagnou wrote:
    On 29.08.2024 14:30, David Brown wrote:
    On 29/08/2024 09:28, Muttley@dastardlyhq.com wrote:
    [...]

    Then don't use vim - use an editor that suits your needs.
    [...]

    But what makes you think that his needs are not covered by Vim?

    You seem to have missed the point - sorry if I was not clear.

    He complained that he didn't want to learn complicated macros in Vim
    just to be able to indent or un-indent lines of code. The solution is
    obvious - he should use an editor other than Vim.

    This is not what I'd call a solution. I'd call it elusion; and in both
    senses - if he didn't use his editor for that space-indenting because
    he doesn't know how to do it he could look that up, but it is not any
    issue to do that, only more laborious than indenting brace structures,
    and the suggestion to switch to another tool is also elusive because
    it doesn't address the issue (he would still have to learn how to do
    it in any other tool). - But that was not the point.


    This thread died out two weeks ago, and should have been left there.


    I didn't suggest he switch to a different tool - I suggested he /didn't/
    switch to a tool that he didn't want to learn. But I do think it is
    worth learning some of the basic features of the tools you use regularly.

    That is all completely independent of what anyone likes or dislikes
    about a particular aspect of any particular language.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From D@21:1/5 to Scott Lurndal on Sun Sep 15 21:55:05 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Sun, 15 Sep 2024, Scott Lurndal wrote:

    Lawrence D'Oliveiro <ldo@nz.invalid> writes:
    On Sat, 14 Sep 2024 19:10:06 GMT, Scott Lurndal wrote:

    $ man vim | grep -i binary

    -b Binary mode. A few options will be set that makes it >>> possible to edit a binary or executable file.

    Wow, a special mode just to edit binary files

    So, you admit you were wrong. You again elided the con-text that showed
    you were incorrect. Dishonest of you, to be sure, yet typical of your
    posts.


    This is Lawrence, and that is his bread and butter. Just killfile and move
    on.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Scott Lurndal on Sun Sep 15 21:32:21 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Sun, 15 Sep 2024 15:51:16 GMT, Scott Lurndal wrote:

    You again elided the con-text that showed you were incorrect.

    You left out this:

    More on vim’s “binary” mode here <https://vi.stackexchange.com/questions/343/how-to-edit-binary-files-with- vim>:
    It just sets a bunch of options to minimize the chance of screwing up the
    file in ways you don’t want. Apart from that, it’s still editing it as a text file.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Muttley@dastardlyhq.com@21:1/5 to All on Mon Sep 16 07:27:40 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Sun, 15 Sep 2024 21:47:13 +0200
    David Brown <david.brown@hesbynett.no> boringly babbled:
    On 14/09/2024 09:59, Janis Papanagnou wrote:
    On 29.08.2024 21:36, David Brown wrote:
    On 29/08/2024 18:44, Janis Papanagnou wrote:
    On 29.08.2024 14:30, David Brown wrote:
    On 29/08/2024 09:28, Muttley@dastardlyhq.com wrote:
    [...]

    Then don't use vim - use an editor that suits your needs.
    [...]

    But what makes you think that his needs are not covered by Vim?

    You seem to have missed the point - sorry if I was not clear.

    He complained that he didn't want to learn complicated macros in Vim
    just to be able to indent or un-indent lines of code. The solution is
    obvious - he should use an editor other than Vim.

    This is not what I'd call a solution. I'd call it elusion; and in both
    senses - if he didn't use his editor for that space-indenting because
    he doesn't know how to do it he could look that up, but it is not any
    issue to do that, only more laborious than indenting brace structures,
    and the suggestion to switch to another tool is also elusive because
    it doesn't address the issue (he would still have to learn how to do
    it in any other tool). - But that was not the point.


    This thread died out two weeks ago, and should have been left there.

    To be fair it should have been left in the 1990s.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Bart@21:1/5 to David Brown on Mon Aug 19 14:47:39 2024
    On 19/08/2024 09:40, David Brown wrote:
    On 19/08/2024 09:37, Dmitry A. Kazakov wrote:

    The similar process happened with programming languages, e.g. C and
    with the hardware architectures, e.g. x86. It is always a race to the
    bottom...


    The success of the x86 was very much a race to the bottom - it was
    picked specifically to give a cheaper system rather than the technically superior architecture (m68k) preferred by the engineers.  Momentum and backwards compatibility has kept it going ever since.

    I am not as convinced with respect to C.  It certainly has its flaws,
    and it certainly has been, and continues to be, used in situations where
    it is not a good choice of language.  But I think much of the bad
    reputation of C is the result of poor C programmers and poor use of the language, rather than the language itself.

    It is the language itself. So many stupid quirks which ended up as indispensible 'features' which meant you had to keep them forever.

    Features which, granted that C is generally considered unsafe, just make
    it stupidly unsafe.

    Plus not helped by tooling which insists on allowing ancient, unsafe
    practices by default so that again, bad habits and uses of unsafe
    features are perpetuated.

    (You of course will insist that such tools must only used with an
    appropriate set of options to tune the language dialect to safer one.

    In that case, you surely wouldn't object to defaulting to a safer
    dialect and requiring an option to build legacy code.)


    Good programmers will write
    good code in any language, bad programmers (or badly managed
    programmers) will write bad code in any language.

    C makes it considerably easier. I can't reproduce this in my language
    for example:

    int F() {
    F(1,2.3,"four",F,F());
    }

    gcc 14.1.0 passes this by default.

    Or this:

    void G(int* p) {p[12345];}

    int main() {
    int i=0;
    G(&i);

    int (*A)[10];

    *(A[i]); // index then deref is valid (this one is wrong)
    (*A)[i]; // so is deref then index!

    }

    Again, gcc 14.1.0 passes it. (If pushed, it will report things like
    'statement with no effect' or missing initialisation. I can fix those,
    but the program is still likely to crash if run.)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Muttley@dastardlyhq.com@21:1/5 to All on Mon Aug 19 14:59:22 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Mon, 19 Aug 2024 12:39:33 +0200
    "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> boringly babbled:
    On 2024-08-19 10:40, David Brown wrote:
    On 19/08/2024 09:37, Dmitry A. Kazakov wrote:
    There's no doubt that non-technical issues have had a big influence on
    which OS's or types of OS have succeeded, but you seem to have something
    specific in mind.

    I think the main reason is that we do not pay the actual costs of
    software developing. OS, compiler require huge investments. Vendors
    never passed these to the end users funding developing from other
    sources. That effectively killed the market. Free software only
    aggravated the situation. In effect it is akin to the socialist
    production method which always kills quality.

    You are a comedian arn't you. Its not a good idea to criticise the quality
    of OSS when at the same time advocating for Windows, an OS thats had more security holes than the entire cheese production of switzerland.

    Initially an ability to trim the system and sometimes to patch a driver
    was a huge advantage Linux had over Windows NT.

    Linux can also load and unload drivers on the fly unlike Windows which AFAIK still requires a reboot each time.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Muttley@dastardlyhq.com@21:1/5 to All on Mon Aug 19 15:56:27 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Mon, 19 Aug 2024 17:35:46 +0200
    "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> boringly babbled:
    On 2024-08-19 16:59, Muttley@dastardlyhq.com wrote:
    On Mon, 19 Aug 2024 12:39:33 +0200

    Initially an ability to trim the system and sometimes to patch a driver
    was a huge advantage Linux had over Windows NT.

    Linux can also load and unload drivers on the fly unlike Windows which AFAIK >> still requires a reboot each time.

    I was talking about monolithic kernel Linux had in 90's. Plug and play, >kernel modules came much later with much bigger machines. I ran Linux on
    i386 25MHz 4Mb. Try it now.

    Loadable driver modules have been in linux since kernel 1.1 which was mid
    90s.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dmitry A. Kazakov@21:1/5 to Muttley@dastardlyhq.com on Mon Aug 19 17:35:46 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 2024-08-19 16:59, Muttley@dastardlyhq.com wrote:
    On Mon, 19 Aug 2024 12:39:33 +0200

    Initially an ability to trim the system and sometimes to patch a driver
    was a huge advantage Linux had over Windows NT.

    Linux can also load and unload drivers on the fly unlike Windows which AFAIK still requires a reboot each time.

    I was talking about monolithic kernel Linux had in 90's. Plug and play,
    kernel modules came much later with much bigger machines. I ran Linux on
    i386 25MHz 4Mb. Try it now.

    --
    Regards,
    Dmitry A. Kazakov
    http://www.dmitry-kazakov.de

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kaz Kylheku@21:1/5 to Dmitry A. Kazakov on Mon Aug 19 17:40:59 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 2024-08-19, Dmitry A. Kazakov <mailbox@dmitry-kazakov.de> wrote:
    On 2024-08-19 06:54, Kaz Kylheku wrote:
    On 2024-08-18, Dmitry A. Kazakov <mailbox@dmitry-kazakov.de> wrote:
    On 2024-08-18 18:46, Kaz Kylheku wrote:

    If a mutex is actually used to protect shared data against concurrent
    ^^^^^^^^^^^^^^^^^^^^^^
    access, and the owner dies while holding the mutex, the next thread
    to try to grab the mutex must be informed so it can try to recover
    the shared data into a sane state.

    There is no recovery if a protected operation crashes, because the state >>> of the object is unknown.

    That is false; the object's state can be analyzed and repaired.

    The object must be designed in a special way in order to support roll
    backs etc. Such techniques exclude concurrent access, e.g. memory is
    ^^^^^^^^^^^^^^^^^^^^^^^^^^
    never overwritten etc.

    Doh.

    --
    TXR Programming Language: http://nongnu.org/txr
    Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
    Mastodon: @Kazinator@mstdn.ca

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Dmitry A. Kazakov on Mon Aug 19 21:09:57 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 19/08/2024 12:39, Dmitry A. Kazakov wrote:
    On 2024-08-19 10:40, David Brown wrote:
    On 19/08/2024 09:37, Dmitry A. Kazakov wrote:

    Both OSes contributed to the Dark Ages of computing. The reasons are
    not technical, because both were worst on the market.

    What sort of time-frame are you thinking of here, what were the
    alternatives that you think were "better", what markets or uses are
    you considering, and in what way were other OS's "better" ?

    There's no doubt that non-technical issues have had a big influence on
    which OS's or types of OS have succeeded, but you seem to have
    something specific in mind.

    I think the main reason is that we do not pay the actual costs of
    software developing. OS, compiler require huge investments. Vendors
    never passed these to the end users funding developing from other
    sources. That effectively killed the market. Free software only
    aggravated the situation. In effect it is akin to the socialist
    production method which always kills quality.

    Experience shows that commercial software vendors rarely passed the real
    costs on to the users - they often pass vastly higher charges on to the
    user for software than it cost to develop the software. Other times,
    they might charge very little or nothing because they have other sources
    of income, such as giving away the main software and charging
    subscription fees for add-on features. There are all sorts of models -
    free and open source software provides different models. At my company,
    the software we write is closed source, but we never charge for licenses
    for it. Customers either pay for the time used in development, or they
    pay for it as part of the cost of the electronics boards we make for them.

    If you use, for example, gcc or Linux, you don't pay the costs directly.
    But you /do/ pay them indirectly. The solid majority of development
    for major free and open source projects is paid work. Intel and ARM pay developers to work on gcc - every time you buy a device with an Intel or
    ARM processor in it, you are paying a little towards gcc. Google pays
    for Linux development - every time you buy a new pair of shoes, some of
    what you pay goes to the manufacturer's advertising budget, some of
    which goes to Google, some of which goes to Linux development, so that
    Google's servers can use a steadily better quality OS to serve up those adverts.

    It all goes around - there's always money there, somewhere.

    Just like any other kind of competition, free and open source has been disruptive in many software markets where some companies were used to
    spending some money on development, then living off that software for
    years as nearly pure profit. It has forced other companies to change
    models - making their software better, or providing better support. But
    it hasn't killed the good quality, imaginative and flexible software
    companies. In the embedded development world, there are large numbers
    of compilers available at a range of prices because they offer something
    that pure gcc does not - support, certification, additional tools,
    training, libraries, specialised extra features, or whatever. Other
    companies exist by taking gcc (or clang) and adding more and charging
    for it. These markets were not /killed/ by free and open source
    compilers - they were /created/ by them.

    And customer companies - successful, well-run ones at least - are still
    quite happy to pay a lot of money for software if it does a better job
    than equivalent free software, saving them money in the end. At my
    company we have bought compilers when they were better tools for the job
    than free tools. But they have to be /better/ - not just more
    expensive, and they have to be better enough to justify the price.
    Usually, they are not.

    So no, free and open source development does not "kill quality" or "kill markets". It is often /better/ quality than commercial alternatives, at
    least in some ways, and it forces commercial alternatives to improve
    their quality and cost-effectiveness. It does not /kill/ markets - it /changes/ them. It spells the end for some suppliers, and opens up opportunities for new ones, just like progress always does.

    People who complain about how free and open source software has killed
    their businesses are like saddle-makers sitting about complaining about
    how the car killed their markets, while their competitors have switched
    from making saddles to opening car repair shops.


    Windows has locks on files, which are a different thing.  While I can
    understand the point of them, they can be a real inconvenience (try
    deleting a directory tree when a file from that tree is in use).

    Oh, yes! I understand why I should not remove a locked file, but I still enjoy Linux's ability to remove anything an be it all damned!

    The usual case is when Windows locks some file on the Linux Samba server share for some mysterious reason. It is a sheer fun to log into the
    server do "rm -rf" on the file and then go back to Windows: "eat that!"

    Under Linux you must log in as the root and remove the stray file
    lock manually. It happens in UNIX administration all the time.

    As someone who has administrated Linux servers for decades, and used
    it as my desktop OS on many machines, I am not sure I can ever
    remember removing a stray lock file.  Certainly needing to do so "all
    the time" is a very wild exaggeration.  Linux, like all systems,
    undoubtedly has its flaws and weaknesses, but this is not one of them
    IME.

    In main case it is packet manager. I am too lazy to find how to turn off automatic update checks. So when I try to run apt or dnf I have to kill
    the lock.

    Right... so your big complaint against Linux is actually due to your own laziness and weird way of updating your system. (Like many Linux users,
    I have automatic update checks enabled /and/ I use "apt" or other
    package managers when I want to - without problems with lock files.)


    Times change.  Needs and uses change.  Hardware changes.

    Keeping things separate and modular has advantages in scalability,
    security and stability.  Keeping things monolithic has advantages in
    efficiency (speed and memory) and consistency.  There is no "right"
    answer.

    Yes. E.g. in automotive you still need the system booted right after you turned the key.

    Initially an ability to trim the system and sometimes to patch a driver
    was a huge advantage Linux had over Windows NT.


    It still is, for those with such niche needs that it is worth the effort.

    On the other hand you still cannot have decent gaming under Linux.

    I do almost all my gaming under Linux.  Some games do work better
    under Windows, but that is primarily because most games developers
    target Windows as their main platform.  It may also be because Linux
    systems are more varied.

    "You are in an open field on the west side of a white house with a
    boarded front door." That sort of games? (:-))


    No, RTS, FPS, that sort of thing. I don't do a lot of fast-action
    gaming these days - my reactions are not those of a kid any more! And
    my PC is not optimised for very demanding games. But most (80%+) Steam
    games run as well on Linux as on Windows, on the same hardware. I see
    some games have trouble on Linux, and some run better (especially older
    ones that find modern Windows confusing).

    Overall, if someone wanted a pure gaming PC, I'd recommend Windows over
    Linux - but it's absolutely fine for casual gaming.

    And single drive letters?

    They are dozens characters long actually, if you mean the device names.

    I thought by "drive letters", he meant "drive letters" - "c:", "d:", etc.

    The official file name of "C:" would be some messy string with lots of backslashes. C: is a "DOS name." There are API to convert DOS names into proper names. It is a mess. All Windows API is a mess.


    The file path the user sees regularly starts with a driver letter.
    Users don't see API's.

    It is a /long/ time since I have had to deal much with Windows APIs
    directly. I remember such joys as a "CreateFile" call that you needed
    to do things like open a comms port or handles to many other types of
    devices or interfaces, but which was not useable for creating files.
    These days my Windows programming is almost all in Python - so dealing
    with the API is an SEP.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dmitry A. Kazakov@21:1/5 to Keith Thompson on Mon Aug 19 23:43:40 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 2024-08-19 22:28, Keith Thompson wrote:
    "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes:
    On 2024-08-19 10:45, Lawrence D'Oliveiro wrote:
    On Mon, 19 Aug 2024 09:37:39 +0200, Dmitry A. Kazakov wrote:
    [...]
    And single drive letters?

    They are dozens characters long actually, if you mean the device names. >>> Drive names are only single letters. You’re not talking about
    reserved
    file names, are you?

    No, I am talking about proper file paths under Windows. Letters is a
    DOS layer on top of it. E.g. see QueryDosDeviceW call.

    OK, I tried a test program that invokes QueryDosDeviceW() on L"C:".
    The result was "\Device\HarddiskVolume4". (That's not a C string
    literal. It contains two single backslash characters.)

    What can I do with that string?

    You can use it in CreateFile. In fact there are cases when you should. I remotely remember a problem determining if the file is same and opening
    it. It failed miserably on letters created by the SUBST command.

    --
    Regards,
    Dmitry A. Kazakov
    http://www.dmitry-kazakov.de

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Dmitry A. Kazakov on Mon Aug 19 23:03:46 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Mon, 19 Aug 2024 13:03:23 +0200, Dmitry A. Kazakov wrote:

    Well, handheld gaming to gaming is like masturbation to love. Sorry...

    Microsoft has been talking about bringing out a
    Windows “Handheld Mode” for about two years now, but still has nothing >> to ship.

    So what do you think Microsoft has been doing with its hands all that
    time? ;)

    On 2024-08-19 10:45, Lawrence D'Oliveiro wrote:

    On Mon, 19 Aug 2024 09:37:39 +0200, Dmitry A. Kazakov wrote:

    On 2024-08-19 01:14, Lawrence D'Oliveiro wrote:

    On Sun, 18 Aug 2024 10:10:09 +0200, Dmitry A. Kazakov wrote:

    Windows has a pipe object named and anonymous. No problem.

    One problem: you can’t use them with poll/select calls.

    You can. See overlapped I/O.

    I said “poll/select calls”. Do you not know what those are? On Windows, >> they work with sockets, but not with pipes. Or even ordinary files. So
    unlike *nix systems, you have to keep in mind the different kinds of
    files you might be working with.

    Again. It is called overlapped I/O. You can start multiple
    *asynchronous* I/O operations from a thread.

    I’m not talking about using threads. I’m talking about avoiding threads, and all their potential for difficult-to-fix race-condition-type bugs.

    I’m talking about situations where the bottleneck is the I/O, not the CPU,
    so multithreading gets you nothing.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dmitry A. Kazakov@21:1/5 to Lawrence D'Oliveiro on Tue Aug 20 08:57:07 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 2024-08-20 01:03, Lawrence D'Oliveiro wrote:
    On Mon, 19 Aug 2024 13:03:23 +0200, Dmitry A. Kazakov wrote:

    Again. It is called overlapped I/O. You can start multiple
    *asynchronous* I/O operations from a thread.

    I’m not talking about using threads. I’m talking about avoiding threads, and all their potential for difficult-to-fix race-condition-type bugs.

    I’m talking about situations where the bottleneck is the I/O, not the CPU, so multithreading gets you nothing.

    It seems you suffer some form of dyslexia. I clearly stated that all
    instances of overlapped I/O is started from the same/single/one thread.
    Better now?

    --
    Regards,
    Dmitry A. Kazakov
    http://www.dmitry-kazakov.de

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dmitry A. Kazakov@21:1/5 to David Brown on Tue Aug 20 08:52:27 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 2024-08-19 21:09, David Brown wrote:

    Experience shows that commercial software vendors rarely passed the real costs on to the users - they often pass vastly higher charges on to the
    user for software than it cost to develop the software.  Other times,
    they might charge very little or nothing because they have other sources
    of income, such as giving away the main software and charging
    subscription fees for add-on features.  There are all sorts of models -
    free and open source software provides different models.  At my company,
    the software we write is closed source, but we never charge for licenses
    for it.  Customers either pay for the time used in development, or they
    pay for it as part of the cost of the electronics boards we make for them.

    If you use, for example, gcc or Linux, you don't pay the costs directly.
     But you /do/ pay them indirectly.  The solid majority of development
    for major free and open source projects is paid work.  Intel and ARM pay developers to work on gcc - every time you buy a device with an Intel or
    ARM processor in it, you are paying a little towards gcc.  Google pays
    for Linux development - every time you buy a new pair of shoes, some of
    what you pay goes to the manufacturer's advertising budget, some of
    which goes to Google, some of which goes to Linux development, so that Google's servers can use a steadily better quality OS to serve up those adverts.

    It all goes around - there's always money there, somewhere.

    Just like any other kind of competition, free and open source has been disruptive in many software markets where some companies were used to spending some money on development, then living off that software for
    years as nearly pure profit.  It has forced other companies to change
    models - making their software better, or providing better support.  But
    it hasn't killed the good quality, imaginative and flexible software companies.  In the embedded development world, there are large numbers
    of compilers available at a range of prices because they offer something
    that pure gcc does not - support, certification, additional tools,
    training, libraries, specialised extra features, or whatever.  Other companies exist by taking gcc (or clang) and adding more and charging
    for it.  These markets were not /killed/ by free and open source
    compilers - they were /created/ by them.

    And customer companies - successful, well-run ones at least - are still
    quite happy to pay a lot of money for software if it does a better job
    than equivalent free software, saving them money in the end.  At my
    company we have bought compilers when they were better tools for the job
    than free tools.  But they have to be /better/ - not just more
    expensive, and they have to be better enough to justify the price.
    Usually, they are not.

    So no, free and open source development does not "kill quality" or "kill markets".  It is often /better/ quality than commercial alternatives, at least in some ways, and it forces commercial alternatives to improve
    their quality and cost-effectiveness.  It does not /kill/ markets - it /changes/ them.  It spells the end for some suppliers, and opens up opportunities for new ones, just like progress always does.

    People who complain about how free and open source software has killed
    their businesses are like saddle-makers sitting about complaining about
    how the car killed their markets, while their competitors have switched
    from making saddles to opening car repair shops.

    It is no complain, merely stating an elementary economic fact. If the
    price does not reflect the costs, there is no market. No market, no competition. No competition, no quality.

    One could argue that there cannot be software market at all for
    costs-intensive stuff like OS and compilers similarly to the communal infrastructure like roads etc. That might be but it is another question.

    --
    Regards,
    Dmitry A. Kazakov
    http://www.dmitry-kazakov.de

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Dmitry A. Kazakov on Tue Aug 20 07:21:38 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Tue, 20 Aug 2024 08:52:27 +0200, Dmitry A. Kazakov wrote:

    It is no complain, merely stating an elementary economic fact. If the
    price does not reflect the costs, there is no market. No market, no competition. No competition, no quality.

    Elementary economic fact: in a competitive market, the unit price of the product tends to converge towards the marginal cost of producing that
    product.

    What’s the marginal cost of producing a copy of a piece of software? Essentially, zero.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Dmitry A. Kazakov on Tue Aug 20 07:22:17 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Tue, 20 Aug 2024 08:57:07 +0200, Dmitry A. Kazakov wrote:

    On 2024-08-20 01:03, Lawrence D'Oliveiro wrote:

    On Mon, 19 Aug 2024 13:03:23 +0200, Dmitry A. Kazakov wrote:

    Again. It is called overlapped I/O. You can start multiple
    *asynchronous* I/O operations from a thread.

    I’m not talking about using threads. I’m talking about avoiding
    threads, and all their potential for difficult-to-fix race-condition
    -type bugs.

    I’m talking about situations where the bottleneck is the I/O, not the
    CPU, so multithreading gets you nothing.

    It seems you suffer some form of dyslexia. I clearly stated that all instances of overlapped I/O is started from the same/single/one thread. Better now?

    Do I need to repeat that this has nothing to do with threading?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Muttley@dastardlyhq.com@21:1/5 to All on Tue Aug 20 07:22:31 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Mon, 19 Aug 2024 13:30:05 -0700
    John Ames <commodorejohn@gmail.com> boringly babbled:
    NT has its own low-level scheme for identifying devices/representing
    file paths. If you're curious, someone at the Google compound did a
    write-up on it some years back: >https://googleprojectzero.blogspot.com/2016/02/the-definitive-guide-on-win32-to
    -nt.html

    For most practical purposes, users and user-level application software
    pretty much never see this or have to think about it - but it *is*
    there, and it does cause strange corner-case behavior sometimes. (I'm
    pretty sure the underlying reason why cmd.exe sometimes cannot access
    network shares mapped to a conventional drive letter has to do with
    this, f'rinstance.)

    To sum up, Microsoft have made a complete dogs dinner of something as simple and basic as file paths. You couldn't make it up.

    Can Windows do non-root level filesystem mounting yet? Ie unix can mount a
    new filesystem anywhere in the current filesystem hierarchy.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Dmitry A. Kazakov on Tue Aug 20 09:44:12 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 20/08/2024 08:52, Dmitry A. Kazakov wrote:
    On 2024-08-19 21:09, David Brown wrote:

    Experience shows that commercial software vendors rarely passed the
    real costs on to the users - they often pass vastly higher charges on
    to the user for software than it cost to develop the software.  Other
    times, they might charge very little or nothing because they have
    other sources of income, such as giving away the main software and
    charging subscription fees for add-on features.  There are all sorts
    of models - free and open source software provides different models.
    At my company, the software we write is closed source, but we never
    charge for licenses for it.  Customers either pay for the time used in
    development, or they pay for it as part of the cost of the electronics
    boards we make for them.

    If you use, for example, gcc or Linux, you don't pay the costs
    directly.   But you /do/ pay them indirectly.  The solid majority of
    development for major free and open source projects is paid work.
    Intel and ARM pay developers to work on gcc - every time you buy a
    device with an Intel or ARM processor in it, you are paying a little
    towards gcc.  Google pays for Linux development - every time you buy a
    new pair of shoes, some of what you pay goes to the manufacturer's
    advertising budget, some of which goes to Google, some of which goes
    to Linux development, so that Google's servers can use a steadily
    better quality OS to serve up those adverts.

    It all goes around - there's always money there, somewhere.

    Just like any other kind of competition, free and open source has been
    disruptive in many software markets where some companies were used to
    spending some money on development, then living off that software for
    years as nearly pure profit.  It has forced other companies to change
    models - making their software better, or providing better support.
    But it hasn't killed the good quality, imaginative and flexible
    software companies.  In the embedded development world, there are
    large numbers of compilers available at a range of prices because they
    offer something that pure gcc does not - support, certification,
    additional tools, training, libraries, specialised extra features, or
    whatever.  Other companies exist by taking gcc (or clang) and adding
    more and charging for it.  These markets were not /killed/ by free and
    open source compilers - they were /created/ by them.

    And customer companies - successful, well-run ones at least - are
    still quite happy to pay a lot of money for software if it does a
    better job than equivalent free software, saving them money in the
    end.  At my company we have bought compilers when they were better
    tools for the job than free tools.  But they have to be /better/ - not
    just more expensive, and they have to be better enough to justify the
    price. Usually, they are not.

    So no, free and open source development does not "kill quality" or
    "kill markets".  It is often /better/ quality than commercial
    alternatives, at least in some ways, and it forces commercial
    alternatives to improve their quality and cost-effectiveness.  It does
    not /kill/ markets - it /changes/ them.  It spells the end for some
    suppliers, and opens up opportunities for new ones, just like progress
    always does.

    People who complain about how free and open source software has killed
    their businesses are like saddle-makers sitting about complaining
    about how the car killed their markets, while their competitors have
    switched from making saddles to opening car repair shops.

    It is no complain, merely stating an elementary economic fact. If the
    price does not reflect the costs, there is no market. No market, no competition. No competition, no quality.

    That's an easy claim to make - saying something that sounds obvious and
    calling it a "fact". But that does not make it true in general.

    There are endless numbers of situations where price and cost are highly
    out of sync. And there are endless different ways in which price and
    cost can be measured for different things.

    Most "elementary economics" is based on the idea of physical production
    - to make each whotsit, a company buys in parts for a cost $A, uses
    employee time for a cost $B, and sells it for a price $C. Profit is
    then $C - ($A + $B). You make more money by reducing A or B, or
    increasing C. Production scaling is just multiplication. Competition
    comes from others making whotsits for lower prices, or with higher worth.

    Software development, licensing and sale is /totally/ different. The
    cost models are completely different. Base cost is high, but unit cost
    is near zero. Some software (like computer games) is, roughly speaking,
    make once then sell lots - for other kinds of software, it's a
    continuous process. Some is sold, some is effectively rented out. Some
    is given away free in order to sell other products (like support deals,
    or hardware). The same license can be sold in one situation for 100
    times the price of a different situation.


    One could argue that there cannot be software market at all for costs-intensive stuff like OS and compilers similarly to the communal infrastructure like roads etc. That might be but it is another question.


    That might be a slightly less bad model than the traditional cost/price
    market model, but it's not good either. Software is in a very different category from "real" things - and indeed there are many different
    categories of software with very different economic models. Any attempt
    to compare it to traditional economic market theory is doomed to be of
    little relevance.

    The success or failure of software companies or products is mostly a combination of skill, hard work, diplomacy, ruthlessness and luck - with
    luck being perhaps the biggest part.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dmitry A. Kazakov@21:1/5 to Lawrence D'Oliveiro on Tue Aug 20 10:15:53 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 2024-08-20 09:21, Lawrence D'Oliveiro wrote:
    On Tue, 20 Aug 2024 08:52:27 +0200, Dmitry A. Kazakov wrote:

    It is no complain, merely stating an elementary economic fact. If the
    price does not reflect the costs, there is no market. No market, no
    competition. No competition, no quality.

    Elementary economic fact: in a competitive market, the unit price of the product tends to converge towards the marginal cost of producing that product.

    What’s the marginal cost of producing a copy of a piece of software? Essentially, zero.

    No different from books, music records, reproductions. In these cases
    the unit is more than just a copy. This is how concepts of intellectual property get invented etc.

    Again, I do not say what is right and what is wrong. Just stating facts.

    --
    Regards,
    Dmitry A. Kazakov
    http://www.dmitry-kazakov.de

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From D@21:1/5 to Dmitry A. Kazakov on Tue Aug 20 10:25:40 2024
    XPost: comp.unix.shell, comp.unix.programmer

    This message is in MIME format. The first part should be readable text,
    while the remaining parts are likely unreadable without MIME-aware tools.

    On Tue, 20 Aug 2024, Dmitry A. Kazakov wrote:

    On 2024-08-20 01:03, Lawrence D'Oliveiro wrote:
    On Mon, 19 Aug 2024 13:03:23 +0200, Dmitry A. Kazakov wrote:

    Again. It is called overlapped I/O. You can start multiple
    *asynchronous* I/O operations from a thread.

    I’m not talking about using threads. I’m talking about avoiding threads, >> and all their potential for difficult-to-fix race-condition-type bugs.

    I’m talking about situations where the bottleneck is the I/O, not the CPU, >> so multithreading gets you nothing.

    It seems you suffer some form of dyslexia. I clearly stated that all instances of overlapped I/O is started from the same/single/one thread. Better now?


    Don't you worry Dmitry, Lawrence is a first class troll and thrives on the resistance you're giving him. My bet is, he'll just continues with his
    tricks. Don't let him drive you crazy. =)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dmitry A. Kazakov@21:1/5 to David Brown on Tue Aug 20 10:27:01 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 2024-08-20 09:44, David Brown wrote:

    That's an easy claim to make - saying something that sounds obvious and calling it a "fact".  But that does not make it true in general.

    But sometimes it does.

    There are endless numbers of situations where price and cost are highly
    out of sync.  And there are endless different ways in which price and
    cost can be measured for different things.

    Yes

    Software development, licensing and sale is /totally/ different.  The
    cost models are completely different.  Base cost is high, but unit cost
    is near zero.

    Yes, and that is the problem. Not really a unique problem, e.g. books,
    music records etc.

    One could argue that there cannot be software market at all for
    costs-intensive stuff like OS and compilers similarly to the communal
    infrastructure like roads etc. That might be but it is another question.

    That might be a slightly less bad model than the traditional cost/price market model, but it's not good either.

    ... counting the potholes ...

    Software is in a very different
    category from "real" things - and indeed there are many different
    categories of software with very different economic models.  Any attempt
    to compare it to traditional economic market theory is doomed to be of
    little relevance.

    Maybe, but then we have what we have.

    The success or failure of software companies or products is mostly a combination of skill, hard work, diplomacy, ruthlessness and luck - with
    luck being perhaps the biggest part.

    The question is sustainability in long term.

    --
    Regards,
    Dmitry A. Kazakov
    http://www.dmitry-kazakov.de

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Muttley@dastardlyhq.com@21:1/5 to John Ames on Mon Aug 26 17:59:25 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Mon, 26 Aug 2024 08:33:30 -0700
    John Ames <commodorejohn@gmail.com> wrote:
    On Thu, 22 Aug 2024 08:21:29 -0000 (UTC)
    Muttley@dastardlyhq.com wrote:
    Yes, this is a royal PITA. I use tabs as in vim I can instantly
    change the indentation using "set ts=". With spaces its fixed short
    of dicking about with macros.

    All of this. Are there some safeguards in place for the most egregious
    cases? Yes - but literal whitespace is still a horrendous misfeature, >something the world at large has known for so long that it was already
    an established joke by the time Ed Post was cracking wise about JCL in >freakin' _Datamation._

    Python is far from the worst language out there - in fact, it's quite
    usable for a wide variety of applications, in spite of that - but the
    simple fact that Guido & co. made a boneheaded choice like that is the
    reason I'll never be able to *respect* it, even when I do find myself
    using it. There should - plain and simple - *never* be a time where you
    can end up with unexpected semantic behavior because of settings in
    your editor-of-choice.

    Literal whitespace also has a knock on effect that I'm guessing Guido didn't consider. It prevents python being used in command line shell pipes for anything useful unlike perl and awk.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to John Ames on Mon Aug 26 21:35:25 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Mon, 26 Aug 2024 08:33:30 -0700, John Ames wrote:

    ... the simple fact that Guido & co. made a boneheaded choice like that
    is the reason I'll never be able to *respect* it, even when I do find
    myself using it.

    I restore the redundancy by using “#end” comments. E.g. a seriously nontrivial case:

    def def_struct_class(name, ctname, extra = None) :
    # defines a class with attributes that are a straightforward mapping
    # of a ctypes struct. Optionally includes extra members from extra
    # if specified.

    ctstruct = getattr(CAIRO, ctname)

    class result_class :

    __slots__ = tuple(field[0] for field in ctstruct._fields_) # to forestall typos

    def to_cairo(self) :
    "returns a Cairo representation of the structure."
    result = ctstruct()
    for name, cttype in ctstruct._fields_ :
    setattr(result, name, getattr(self, name))
    #end for
    return \
    result
    #end to_cairo

    @classmethod
    def from_cairo(celf, r) :
    "decodes the Cairo representation of the structure."
    result = celf()
    for name, cttype in ctstruct._fields_ :
    setattr(result, name, getattr(r, name))
    #end for
    return \
    result
    #end from_cairo

    def __getitem__(self, i) :
    "allows the object to be coerced to a tuple."
    return \
    getattr(self, ctstruct._fields_[i][0])
    #end __getitem__

    def __repr__(self) :
    return \
    (
    "%s(%s)"
    %
    (
    name,
    ", ".join
    (
    "%s = %s" % (field[0], getattr(self, field[0]))
    for field in ctstruct._fields_
    ),
    )
    )
    #end __repr__

    #end result_class

    #begin def_struct_class
    result_class.__name__ = name
    result_class.__doc__ = \
    (
    "representation of a Cairo %s structure. Fields are %s."
    "\nCreate by decoding the Cairo form with the from_cairo method;"
    " convert an instance to Cairo form with the to_cairo method."
    %
    (
    ctname,
    ", ".join(f[0] for f in ctstruct._fields_),
    )
    )
    if extra != None :
    for attr in dir(extra) :
    if not attr.startswith("__") :
    setattr(result_class, attr, getattr(extra, attr))
    #end if
    #end for
    #end if
    return \
    result_class
    #end def_struct_class

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Bart@21:1/5 to Lawrence D'Oliveiro on Mon Aug 26 23:51:40 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 26/08/2024 22:35, Lawrence D'Oliveiro wrote:
    On Mon, 26 Aug 2024 08:33:30 -0700, John Ames wrote:

    ... the simple fact that Guido & co. made a boneheaded choice like that
    is the reason I'll never be able to *respect* it, even when I do find
    myself using it.

    I restore the redundancy by using “#end” comments. E.g. a seriously nontrivial case:

    This might the human reader but the redundancy really needs to be
    supported by the language.

    Here, that s2 line has been knocked out of place; the indent is missing.
    But the language can't detect it, even with #end; it makes s2 unconditional:

    if c:
    s1
    s2
    #end

    With language support:

    if c:
    s1
    s2
    end

    Here the redundancy means the compiler knows both s1 and s2 are in the
    same conditional block, and it can choose to report an indentation inconsistency.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kaz Kylheku@21:1/5 to Lawrence D'Oliveiro on Mon Aug 26 23:32:56 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 2024-08-26, Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
    I restore the redundancy by ...

    just standing here?

    --
    TXR Programming Language: http://nongnu.org/txr
    Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
    Mastodon: @Kazinator@mstdn.ca

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Bart on Tue Aug 27 02:49:19 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Mon, 26 Aug 2024 23:51:40 +0100, Bart wrote:

    This might [...] the human reader but the redundancy really needs to be supported by the language.

    Consider what I mean by “redundancy”: it means the structure of the code
    is expressed two different ways.

    In a conventional language with statement bracketing symbols, the compiler ignores the indentation, but you use that to delineate the same structure
    as defined by the actual language symbols, thereby providing redundancy to
    the human reader.

    In Python, the compiler goes by the indentation, so I add standins for statement bracketing symbols in the form of “#end” comments: these are ignored by the compiler, but I use that as an alternative, redundant way
    of delineating the same program structure to the human reader.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to John Ames on Tue Aug 27 02:50:41 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Mon, 26 Aug 2024 15:51:13 -0700, John Ames wrote:

    if condition:
    foo()

    bar()

    baz()

    if one needs to re-arrange the order of operations, for reasons, and one
    is incautious about selecting and shuffling lines in one's editor, such
    that one ends up with this:

    if condition:
    bar()

    foo()

    baz()

    Try:

    if condition:
    foo()
    bar()
    #end if
    baz()

    versus

    if condition:
    bar()
    foo()
    #end if
    baz()

    Does that make things clearer?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Sebastian@21:1/5 to John Ames on Tue Aug 27 03:21:28 2024
    XPost: comp.unix.shell, comp.unix.programmer

    In comp.unix.programmer John Ames <commodorejohn@gmail.com> wrote:
    On Mon, 26 Aug 2024 21:35:25 -0000 (UTC)
    Lawrence D'Oliveiro <ldo@nz.invalid> wrote:

    I restore the redundancy by using ?#end? comments. E.g. a seriously
    nontrivial case:

    But even if that helps you organizationally, it doesn't resolve issues
    of the interpreter potentially mis-parsing things due to mismatches in tab/space factor between $EDITOR and the Python RTE, which is a truly ridiculous thing to have to be concerned about.

    (Thing I'm curious about, but don't have a test environment to hand -
    does a blank line with a different indent level, in between lines of
    the same level, break out of the block? E.g., given the following:

    if condition:
    foo()

    bar()

    baz()

    The answer is that it doesn't matter if the blank line between foo() and
    bar() contains four spaces. bar() will always be treated as being part
    of the if statement's body.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Richard Kettlewell@21:1/5 to John Ames on Tue Aug 27 09:39:29 2024
    XPost: comp.unix.shell, comp.unix.programmer

    John Ames <commodorejohn@gmail.com> writes:
    But even if that helps you organizationally, it doesn't resolve issues
    of the interpreter potentially mis-parsing things due to mismatches in tab/space factor between $EDITOR and the Python RTE, which is a truly ridiculous thing to have to be concerned about.

    In many years of using Python routinely and extensively I’ve simply
    never found the whitespace issues that people are worrying about here to
    be a problem in practice. Some of this may be a matter of experience but
    if so, it’s a form of experience that must have built up very quickly.

    As an aesthetic objection, of course, there’s no accounting for
    taste. But it doesn’t seem to be a practical problem in reality.

    (In contrast C’s rules have occasionally been a practical problem, contributing to at least one high-profile software vulnerability and
    attracting compiler warnings to mitigate the risks.)

    --
    https://www.greenend.org.uk/rjk/

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Bart@21:1/5 to Richard Kettlewell on Tue Aug 27 11:26:18 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 27/08/2024 09:39, Richard Kettlewell wrote:
    John Ames <commodorejohn@gmail.com> writes:
    But even if that helps you organizationally, it doesn't resolve issues
    of the interpreter potentially mis-parsing things due to mismatches in
    tab/space factor between $EDITOR and the Python RTE, which is a truly
    ridiculous thing to have to be concerned about.

    In many years of using Python routinely and extensively I’ve simply
    never found the whitespace issues that people are worrying about here to
    be a problem in practice. Some of this may be a matter of experience but
    if so, it’s a form of experience that must have built up very quickly.

    As an aesthetic objection, of course, there’s no accounting for
    taste. But it doesn’t seem to be a practical problem in reality.

    (In contrast C’s rules have occasionally been a practical problem, contributing to at least one high-profile software vulnerability and attracting compiler warnings to mitigate the risks.)

    These are the problems I've seen. I haven't used the language
    extensively, but I've used it enough.

    (1) An tab at the start of a line gets accidentally indented or
    unindented. If you weren't paying close attention, it may not be clear
    that that has happened, if this line was either the last line of an
    indented block, or the line following

    (2) You want to temporarily comment out an 'if' line so that the
    following block is unconditional. You can't do that with also
    unindenting the block. And, also the block then merges with the
    following one as it's at the same level, so when you want to change it
    back...

    (3) Similarly, you want to temportarily wrap an 'if' statement, for
    example, around a block of code. But you can't do it witout indenting
    that block.

    (4) Sometimes you want to add temporary debug code as part of a block.
    Usually I write such lines in all-caps and without indentation to make
    them stand out clear. With Python, I can't use all-caps and I have to
    use exactly the same indent as the rest of the block. So the lines
    merge. Then when I need to remove the code, it's not clearly delimited.

    (5) Sometimes you want to temporarily comment out the contents of a
    block. But Python doesn't allow an empty block; now you have to use
    'pass'. And then get rid of if later.

    (6) You want to add extra statements to the end of a block, but where IS
    the end? You have to INFER the ending by looking for a line with a
    smaller indent. But suppose you're at the bottom of a window; is that
    bottom line the last in the block, or is there another one at the same
    indent just out of sight? You have to tentatively keep peeking ahead!

    (6a) And maybe there's big comment blocking in the middle of block;
    comments don't need nesting! If there are lots of comments and few
    statements, finding the end of the block (ie. the last statement of this
    block) can become quite an exercise.

    (7) You take some Python code you've seen online (eg. in a usenet post)
    and paste into your editor. Maybe you want to merge it with your own code.

    But its tabbing is all spaces; yours is all tabs. Plus invariably, the
    whole thing has extra indentation (eg. the leftmost statement is already indented). Or you want to copy code from within a block to a different
    indent level.

    The whole thing gets very messy and error prone. You need special editor commands to deal with the mess.

    Indented, non-delimited code and data is fine for machine-generated and
    machine processed code. But it's a disaster for code that has to be human-generated and human-maintained. It's just too fragile.

    The fact that people have to resort to adding #end lines, which only
    partly deals with one or two of those problems, suggest that something
    is badly wrong.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to David Brown on Tue Sep 3 00:09:17 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Sat, 31 Aug 2024 17:06:05 +0200, David Brown wrote:

    On 31/08/2024 01:49, Lawrence D'Oliveiro wrote:

    Interesting. Now you are trying to claim that, because you don’t
    understand what the code does, that makes it somehow “meaningless”?

    I covered that in an earlier post.

    Maybe in your mind you thought you did. Nowhere in your comments on this
    code did you say so, that I can find.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Lawrence D'Oliveiro on Tue Sep 3 10:46:55 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 03/09/2024 02:09, Lawrence D'Oliveiro wrote:
    On Sat, 31 Aug 2024 17:06:05 +0200, David Brown wrote:

    On 31/08/2024 01:49, Lawrence D'Oliveiro wrote:

    Interesting. Now you are trying to claim that, because you don’t
    understand what the code does, that makes it somehow “meaningless”?

    I covered that in an earlier post.

    Maybe in your mind you thought you did. Nowhere in your comments on this
    code did you say so, that I can find.

    To be accurate, the code in question was not actually /meaningless/ - it
    was merely pointlessly complex, inefficient and unclear.

    You wrote:

    def register_additional_standard(self, **kwargs) :
    for key in kwargs :
    if kwargs[key] :
    if key == "managed_objects" :
    # ....
    else :
    raise TypeError("unrecognized argument keyword
    “%s”" % key)


    I changed it in a re-write to:

    def register_additional_standard(self, managed_objects) :
    if managed_objects :
    # ....


    That change, I think, was lost in the discussions about bizarre
    formatting practices.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Janis Papanagnou@21:1/5 to Muttley@dastardlyhq.com on Mon Sep 16 17:28:07 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 15.09.2024 11:06, Muttley@dastardlyhq.com wrote:
    On Sat, 14 Sep 2024 22:25:53 -0000 (UTC)
    Lawrence D'Oliveiro <ldo@nz.invalid> boringly babbled:
    [...]

    Any sane person uses a dedicated hex editor to edit binary files, not vim
    or emacs.

    I suppose you may be right. (Or maybe not?)

    Frankly, I rarely edited binary files [with any editor]; for me
    that's at best a corner case, and at worst a wrong approach (in
    some cases I've seen).

    But, to be honest, in the few cases where I did binary editings
    I was glad that I could just use the editor I'm used to. And in
    such cases I resorted to :!xxd ... sort of data handling from
    within the editor I use (Vi/Vim).

    Janis

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Janis Papanagnou@21:1/5 to Lawrence D'Oliveiro on Mon Sep 16 17:30:12 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 14.09.2024 11:34, Lawrence D'Oliveiro wrote:
    On Sat, 14 Sep 2024 10:06:12 +0200, Janis Papanagnou wrote:

    On 30.08.2024 04:53, Lawrence D'Oliveiro wrote:

    Emacs makes no such assumption, and can also edit non-text files.

    You have obviously no clue.

    I have actually used it for that. That’s my “clue” to you.

    Yes, I've also edited binary files with Vim. - That's no news.
    So what's the "clue"?

    Janis

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Bozo User@21:1/5 to Dmitry A. Kazakov on Mon Sep 30 20:04:53 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 2024-08-19, Dmitry A. Kazakov <mailbox@dmitry-kazakov.de> wrote:
    On 2024-08-19 16:59, Muttley@dastardlyhq.com wrote:
    On Mon, 19 Aug 2024 12:39:33 +0200

    Initially an ability to trim the system and sometimes to patch a driver
    was a huge advantage Linux had over Windows NT.

    Linux can also load and unload drivers on the fly unlike Windows which AFAIK >> still requires a reboot each time.

    I was talking about monolithic kernel Linux had in 90's. Plug and play, kernel modules came much later with much bigger machines. I ran Linux on
    i386 25MHz 4Mb. Try it now.


    You could load and unload drivers since slackware 4 and before,
    even under a 386.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Bozo User@21:1/5 to Muttley@dastardlyhq.com on Mon Sep 30 20:04:52 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 2024-09-15, Muttley@dastardlyhq.com <Muttley@dastardlyhq.com> wrote:
    On Sat, 14 Sep 2024 22:25:53 -0000 (UTC)
    Lawrence D'Oliveiro <ldo@nz.invalid> boringly babbled:
    On Sat, 14 Sep 2024 19:10:06 GMT, Scott Lurndal wrote:

    $ man vim | grep -i binary

    -b Binary mode. A few options will be set that makes it >>> possible to edit a binary or executable file.

    Wow, a special mode just to edit binary files, when Emacs can do it in
    its regular mode.

    The 1980s phoned, they want their editor wars back.

    It just sets a bunch of options to minimize the chance of screwing up
    the file in ways you don’t want. Apart from that, it’s still editing
    it as a text file.

    Any sane person uses a dedicated hex editor to edit binary files, not vim
    or emacs.


    Emacs has the hexl-mode. Emacs isn't just an editor, it's an Elisp platform.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Bozo User@21:1/5 to Lawrence D'Oliveiro on Mon Sep 30 20:04:54 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 2024-08-21, Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
    On Wed, 21 Aug 2024 09:26:41 +0200, David Brown wrote:

    And you don't need to know anything about Linux, UNIX or POSIX to
    program in C.

    I think the point has been made on comp.lang.c more than once, that C
    without POSIX can be a very dull language indeed ...

    The C Programming Language 2nd. Ed is not about POSIX, and you can do
    a lot with C99. Albeit I prefer Elisp and Common Lisp.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Bozo User on Mon Sep 30 22:08:00 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Mon, 30 Sep 2024 20:04:52 -0000 (UTC), Bozo User wrote:

    Any sane person uses a dedicated hex editor to edit binary files, not
    vim or emacs.

    Emacs has the hexl-mode. Emacs isn't just an editor, it's an Elisp
    platform.

    Hex mode is an option. It’s not required. It so happens the kind of
    editing I was doing worked best the way I did it.

    Emacs offers you the choice, alternative editors don’t.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Bozo User on Mon Sep 30 22:10:22 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Mon, 30 Sep 2024 20:04:54 -0000 (UTC), Bozo User wrote:

    On 2024-08-21, Lawrence D'Oliveiro <ldo@nz.invalid> wrote:

    On Wed, 21 Aug 2024 09:26:41 +0200, David Brown wrote:

    And you don't need to know anything about Linux, UNIX or POSIX to
    program in C.

    I think the point has been made on comp.lang.c more than once, that C
    without POSIX can be a very dull language indeed ...

    ... you can do a lot with C99.

    Up to a point. This is the thing: every once in a while, a discussion
    about some supposed C feature will founder on the discovery that it is
    actually a POSIX feature, not available with standard C on non-POSIX
    platforms.

    Hang around comp.lang.c for a month or so, and you’ll see what I mean.

    Albeit I prefer Elisp and Common Lisp.

    I use lots of languages, including C and JavaScript. I use Elisp to
    customize Emacs, and Python for lots of other things. I have even dabbled
    with Smalltalk.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Dmitry A. Kazakov on Tue Aug 20 15:09:10 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 20/08/2024 10:27, Dmitry A. Kazakov wrote:
    On 2024-08-20 09:44, David Brown wrote:

    That's an easy claim to make - saying something that sounds obvious
    and calling it a "fact".  But that does not make it true in general.

    But sometimes it does.

    You are snipping a bit too much context - as it stands, it looks like
    some things are true simply because they are easy to say, which is of
    course nonsense.

    I think your line of reasoning was too simplistic to be realistic. It
    is simply not the case that you have to have price reflecting cost to
    make a market, or that you have to have a market to have competition, or
    that you have to have competition to have quality. None of these is
    true in general (even taking into account that the term "market" could
    be defined in many ways). Each of them is true in some cases, but even
    that does not mean they follow as logical consequences.


    There are endless numbers of situations where price and cost are
    highly out of sync.  And there are endless different ways in which
    price and cost can be measured for different things.

    Yes

    Software development, licensing and sale is /totally/ different.  The
    cost models are completely different.  Base cost is high, but unit
    cost is near zero.

    Yes, and that is the problem. Not really a unique problem, e.g. books,
    music records etc.


    Those are different situations again, but certainly closer than the
    production of "wotsits". Traditionally, books and records have relevant
    unit costs as well as base "development" costs, and then much of their
    later income comes from sources invisible to end users (like film rights
    or royalties).

    I don't think any of this is a "problem", it is simply that you can't
    wildly mix simplified (or invented) "economic facts" in totally
    different situations.

    One could argue that there cannot be software market at all for
    costs-intensive stuff like OS and compilers similarly to the communal
    infrastructure like roads etc. That might be but it is another question.

    That might be a slightly less bad model than the traditional
    cost/price market model, but it's not good either.

    ... counting the potholes ...

    Software is in a very different category from "real" things - and
    indeed there are many different categories of software with very
    different economic models.  Any attempt to compare it to traditional
    economic market theory is doomed to be of little relevance.

    Maybe, but then we have what we have.

    It often surprises me that economic theories give any usable results at
    all. Most are based on total gibberish with no relation to real life,
    such as linear towns, totally rational customers, and such
    simplifications that they are close to meaningless. They basically work
    by the central limit theorem - with enough variables, results are fairly
    near an average for much of the time.


    The success or failure of software companies or products is mostly a
    combination of skill, hard work, diplomacy, ruthlessness and luck -
    with luck being perhaps the biggest part.

    The question is sustainability in long term.


    Then luck is even more the biggest part. Predictions are hard,
    especially about the future.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Muttley@dastardlyhq.com@21:1/5 to All on Tue Aug 20 14:35:33 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Tue, 20 Aug 2024 14:21:38 -0000 (UTC)
    kalevi@kolttonen.fi (Kalevi Kolttonen) boringly babbled:
    To know Linux, you need Michal Kerrisk's book the Linux Programming >Interface. I have this book, but admittedly you are kind of right:
    It is large and I do not know every single part of it, but I have
    studied it a lot and I am familiar with the most important features.

    Luckily not much has changed in core unix systems programming over the decades (seems they got it mostly right first time) so Advanced Programming in the
    Unix Enviroment by W. Richard Stevens is still a very relevant book to anyone who wants to develop on unix.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kalevi Kolttonen@21:1/5 to David Brown on Tue Aug 20 14:21:38 2024
    XPost: comp.unix.shell, comp.unix.programmer

    In comp.unix.programmer David Brown <david.brown@hesbynett.no> wrote:
    On 16/08/2024 17:02, Kalevi Kolttonen wrote:
    In comp.unix.programmer Kaz Kylheku <643-408-1753@kylheku.com> wrote:
    On 2024-08-15, Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
    On Thu, 15 Aug 2024 19:48:36 -0000 (UTC), Kalevi Kolttonen wrote:

    The last I checked, the O'Reilly Python book is just absolutely
    *MASSIVE*. The language has a huge number of features now ...

    No, it hasn’t. The core language reference spec is only a small fraction >>>> of, say, the Java language spec.

    It’s just that you can do so many things with Python. And that is down to
    the huge variety of off-the-shelf addon libraries that build on that core >>>> language spec. It has to be a strong, very solidly founded core in order >>>> to be such a versatile basis for these addons, and it is.

    That's idiotic; you're saying that the standard library packages of
    Python are not part of Python, and do not contribute to its size.

    You seem to have a point. The core of C language is also small. I
    guess they even said in the original K & R book that C is a small
    language best described by a small book.

    But in order to do anything with C, you need to know the standard
    libraries. They have grown bigger and bigger during all these
    years. One could also well argue that to program on UNIX, you also
    need to know all the POSIX libraries.


    Absolute nonsense.

    In order to use a programming language for a given task, you need to
    know the basics of the language and libraries appropriate for the task.
    You most certainly do not need to know all about the language, or all
    about all the libraries provided as standard for the language or the
    host OS.

    I would not label it as "absolute nonsense". In order to program on UNIX,
    you need to be familiar with the facilities that are available. I
    know of a very smart man who ended up as a professor of physics who
    programmed on Amiga back in the 1980s. Even though his PhD thesis
    was something like 100-150 pages of strange-looking formulas, he said
    he had problems with C on the Amiga. For some reason, he was unable
    to remember what functions where provided as standard libraries, so
    he always ended up writing his own functions instead of using libraries.

    To know Linux, you need Michal Kerrisk's book the Linux Programming
    Interface. I have this book, but admittedly you are kind of right:
    It is large and I do not know every single part of it, but I have
    studied it a lot and I am familiar with the most important features.

    br,
    KK

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lew Pitcher@21:1/5 to Muttley on Tue Aug 20 14:45:50 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Tue, 20 Aug 2024 14:35:33 +0000, Muttley wrote:

    On Tue, 20 Aug 2024 14:21:38 -0000 (UTC)
    kalevi@kolttonen.fi (Kalevi Kolttonen) boringly babbled:
    To know Linux, you need Michal Kerrisk's book the Linux Programming >>Interface. I have this book, but admittedly you are kind of right:
    It is large and I do not know every single part of it, but I have
    studied it a lot and I am familiar with the most important features.

    Luckily not much has changed in core unix systems programming over the decades
    (seems they got it mostly right first time) so Advanced Programming in the Unix Enviroment by W. Richard Stevens is still a very relevant book to anyone who wants to develop on unix.

    Agreed. APUE is one of my go-to books.

    Note that Addison-Wesley released a new edition of APUE a decade or so ago co-authored by WRS and Stephen Rago. That edition covered SUS version 4, and (among others) Linux (up to kernel 3.2).


    --
    Lew Pitcher
    "In Skills We Trust"

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dmitry A. Kazakov@21:1/5 to David Brown on Tue Aug 20 17:20:03 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 2024-08-20 15:09, David Brown wrote:
    On 20/08/2024 10:27, Dmitry A. Kazakov wrote:
    On 2024-08-20 09:44, David Brown wrote:

    I think your line of reasoning was too simplistic to be realistic.  It
    is simply not the case that you have to have price reflecting cost to
    make a market, or that you have to have a market to have competition, or
    that you have to have competition to have quality.  None of these is
    true in general (even taking into account that the term "market" could
    be defined in many ways).  Each of them is true in some cases, but even
    that does not mean they follow as logical consequences.

    There are plenty historic examples illustrating the point.

    Yes, and that is the problem. Not really a unique problem, e.g. books,
    music records etc.

    Those are different situations again, but certainly closer than the production of "wotsits".  Traditionally, books and records have relevant unit costs as well as base "development" costs, and then much of their
    later income comes from sources invisible to end users (like film rights
    or royalties).

    I don't think any of this is a "problem", it is simply that you can't
    wildly mix simplified (or invented) "economic facts" in totally
    different situations.

    It is a problem of rewarding the authors.

    There is a whole spectrum of economic systems which redistribute costs
    this or that way. Beginning with slavery. Free market is the best so far.

    It often surprises me that economic theories give any usable results at
    all.

    Economy is not a science, it need not to produce any results. But it can explain things. I think that lack of market force explains the state of software developing quite well. But of course there could other
    explanations.

    --
    Regards,
    Dmitry A. Kazakov
    http://www.dmitry-kazakov.de

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kalevi Kolttonen@21:1/5 to Muttley@dastardlyhq.com on Tue Aug 20 16:10:04 2024
    XPost: comp.unix.shell, comp.unix.programmer

    In comp.unix.programmer Muttley@dastardlyhq.com wrote:
    On Tue, 20 Aug 2024 14:21:38 -0000 (UTC)
    kalevi@kolttonen.fi (Kalevi Kolttonen) boringly babbled:
    To know Linux, you need Michal Kerrisk's book the Linux Programming >>Interface. I have this book, but admittedly you are kind of right:
    It is large and I do not know every single part of it, but I have
    studied it a lot and I am familiar with the most important features.

    Luckily not much has changed in core unix systems programming over the decades
    (seems they got it mostly right first time) so Advanced Programming in the Unix Enviroment by W. Richard Stevens is still a very relevant book to anyone who wants to develop on unix.

    That is pretty much true, yes.

    br,
    KK

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Stefan Ram@21:1/5 to John Ames on Tue Aug 20 15:23:39 2024
    XPost: comp.unix.shell, comp.unix.programmer

    John Ames <commodorejohn@gmail.com> wrote or quoted:
    NT has its own low-level scheme for identifying devices/representing
    file paths.

    We need to break down a few terms when we're chatting about Windows:

    - the physical hard disk,

    - volumes: partitions of that physical disk, and

    - drive letters: labels slapped on a volume (not on a hard disk!).

    (You can totally have volumes without a drive letter.)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Kalevi Kolttonen on Tue Aug 20 21:45:13 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 20/08/2024 16:21, Kalevi Kolttonen wrote:
    In comp.unix.programmer David Brown <david.brown@hesbynett.no> wrote:
    On 16/08/2024 17:02, Kalevi Kolttonen wrote:
    In comp.unix.programmer Kaz Kylheku <643-408-1753@kylheku.com> wrote:
    On 2024-08-15, Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
    On Thu, 15 Aug 2024 19:48:36 -0000 (UTC), Kalevi Kolttonen wrote:

    The last I checked, the O'Reilly Python book is just absolutely
    *MASSIVE*. The language has a huge number of features now ...

    No, it hasn’t. The core language reference spec is only a small fraction
    of, say, the Java language spec.

    It’s just that you can do so many things with Python. And that is down to
    the huge variety of off-the-shelf addon libraries that build on that core >>>>> language spec. It has to be a strong, very solidly founded core in order >>>>> to be such a versatile basis for these addons, and it is.

    That's idiotic; you're saying that the standard library packages of
    Python are not part of Python, and do not contribute to its size.

    You seem to have a point. The core of C language is also small. I
    guess they even said in the original K & R book that C is a small
    language best described by a small book.

    But in order to do anything with C, you need to know the standard
    libraries. They have grown bigger and bigger during all these
    years. One could also well argue that to program on UNIX, you also
    need to know all the POSIX libraries.


    Absolute nonsense.

    In order to use a programming language for a given task, you need to
    know the basics of the language and libraries appropriate for the task.
    You most certainly do not need to know all about the language, or all
    about all the libraries provided as standard for the language or the
    host OS.

    I would not label it as "absolute nonsense".

    OK, let's say "pretty much nonsense" instead.

    In order to program on UNIX,
    you need to be familiar with the facilities that are available. I
    know of a very smart man who ended up as a professor of physics who programmed on Amiga back in the 1980s. Even though his PhD thesis
    was something like 100-150 pages of strange-looking formulas, he said
    he had problems with C on the Amiga. For some reason, he was unable
    to remember what functions where provided as standard libraries, so
    he always ended up writing his own functions instead of using libraries.

    To know Linux, you need Michal Kerrisk's book the Linux Programming Interface. I have this book, but admittedly you are kind of right:
    It is large and I do not know every single part of it, but I have
    studied it a lot and I am familiar with the most important features.


    You need to know what you need to know in order to handle the task in hand.

    If you are writing a program to convert json files to xml files, you
    need to know enough about the interface to open, read and write files,
    and to manipulate strings and other data structures in the language of
    your choice. If that is C, for example, you need to know about 5% of
    the standard library, at most. You need to know a /tiny/ fraction of
    POSIX. The same goes for any other language you choose to use, and any
    other program you choose to write.

    Unless you are working with huge pieces of software with connections to
    large parts of the system - say, a Windowing system - you don't need to
    know about more than a very small part of the OS interfaces. Unless you
    are writing a compiler, standard library, or other big development tool,
    you rarely need to know more than the basics of a programming language
    along with parts specific to your tasks.

    And for most modern software written to run on general-purpose OS's,
    people use languages where you haven't a hope in hell of understanding
    the entire language and its standard libraries, never mind the common frameworks and libraries that are often used. You have /zero/ chance of knowing all of the system APIs and common library interfaces of your OS
    - there are not nearly enough hours in the day for that. But you don't
    need any of that - you learn and use the language features and libraries
    that are appropriate for getting the job done. (And often that is all cross-platform - little or no POSIX-specific stuff in sight, even if you
    only run your code on Linux.)

    No, you do not need your particular favourite out of the thousand and
    one Linux programming books in order to program for Linux. You do not
    need /any/ book in order to write useful and successful code for Linux.
    Of course you need /some/ reference - and in the days before the
    internet was so easily available and so full of information, I went
    through a lot of programming books. Some were good, some less so, and
    some have become famous. But none of them were /necessary/ in any way.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kalevi Kolttonen@21:1/5 to David Brown on Tue Aug 20 20:56:00 2024
    XPost: comp.unix.shell, comp.unix.programmer

    In comp.unix.programmer David Brown <david.brown@hesbynett.no> wrote:
    No, you do not need your particular favourite out of the thousand and
    one Linux programming books in order to program for Linux. You do not
    need /any/ book in order to write useful and successful code for Linux.
    Of course you need /some/ reference - and in the days before the
    internet was so easily available and so full of information, I went
    through a lot of programming books. Some were good, some less so, and
    some have become famous. But none of them were /necessary/ in any way.

    Well, I am a quite bad programmer but I am interested enough in the
    Linux/UNIX workings so that reading the newest APUE and The Linux
    Programming Interface did not feel painful or unnecessary at all. On
    the contrary, it was a great pleasure to examine what kind of
    programming facilities my favourite OS offers.

    Having these two books, or just one of them, is a great way to educate
    oneself about Linux/UNIX. I see that The Linux Programming Interface
    is available online as a free PDF, but I am not sure whether it is
    a pirated version.

    There is no better way to learn Linux/UNIX workings than these two
    books. Period.

    br,
    KK

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Dmitry A. Kazakov on Wed Aug 21 00:59:38 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Tue, 20 Aug 2024 10:27:01 +0200, Dmitry A. Kazakov wrote:

    The question is sustainability in long term.

    In the long term, proprietary software is in retreat, while Free software
    is on the rise. So it’s quite clear which one is more “sustainable”.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Kalevi Kolttonen on Wed Aug 21 01:05:17 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Tue, 20 Aug 2024 14:21:38 -0000 (UTC), Kalevi Kolttonen wrote:

    Even though his PhD thesis was
    something like 100-150 pages of strange-looking formulas, he said he had problems with C on the Amiga. For some reason, he was unable to remember
    what functions where provided as standard libraries, so he always ended
    up writing his own functions instead of using libraries.

    Was he not able to keep some reference docs handy? For example, I rarely
    get very far in working on Python code without having this page <https://docs.python.org/3/library/> open in a browser.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Dmitry A. Kazakov on Wed Aug 21 01:00:55 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Tue, 20 Aug 2024 10:15:53 +0200, Dmitry A. Kazakov wrote:

    On 2024-08-20 09:21, Lawrence D'Oliveiro wrote:

    On Tue, 20 Aug 2024 08:52:27 +0200, Dmitry A. Kazakov wrote:

    It is no complain, merely stating an elementary economic fact. If the
    price does not reflect the costs, there is no market. No market, no
    competition. No competition, no quality.

    Elementary economic fact: in a competitive market, the unit price of
    the product tends to converge towards the marginal cost of producing
    that product.

    What’s the marginal cost of producing a copy of a piece of software?
    Essentially, zero.

    Again, I do not say what is right and what is wrong.

    Neither do I. The fact is, Free software is on the rise, and proprietary software is fighting a rearguard action against it.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From vallor@21:1/5 to mailbox@dmitry-kazakov.de on Wed Aug 21 06:10:03 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Mon, 19 Aug 2024 09:37:39 +0200, "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in <v9uso3$2pdrg$2@dont-email.me>:

    On the other hand you still cannot have decent gaming under Linux.

    Modern proton has changed all that.

    (That's why you have lovely devices like the SteamDeck on the market.)

    This system runs Elite Dangerous Odyssey, Starfield, Borderlands 3,
    and Tiny Tina's Wonderland using SteamPlay with proton.

    --
    -v System76 Thelio Mega v1.1 x86_64 NVIDIA RTX 3090 Ti
    OS: Linux 6.11.0-rc4 Release: Mint 21.3 Mem: 258G
    "Oxymoron: Televised Hearings."

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to vallor on Wed Aug 21 06:45:39 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 21 Aug 2024 06:10:03 GMT, vallor wrote:

    On Mon, 19 Aug 2024 09:37:39 +0200, "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in <v9uso3$2pdrg$2@dont-email.me>:

    On the other hand you still cannot have decent gaming under Linux.

    Modern proton has changed all that.

    (That's why you have lovely devices like the SteamDeck on the market.)

    The Steam Deck is turning PC gaming upside down. Even Microsoft is
    struggling to compete.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Muttley@dastardlyhq.com@21:1/5 to All on Wed Aug 21 07:27:57 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Tue, 20 Aug 2024 20:56:00 -0000 (UTC)
    kalevi@kolttonen.fi (Kalevi Kolttonen) boringly babbled:
    In comp.unix.programmer David Brown <david.brown@hesbynett.no> wrote:
    No, you do not need your particular favourite out of the thousand and
    one Linux programming books in order to program for Linux. You do not
    need /any/ book in order to write useful and successful code for Linux.
    Of course you need /some/ reference - and in the days before the
    internet was so easily available and so full of information, I went
    through a lot of programming books. Some were good, some less so, and
    some have become famous. But none of them were /necessary/ in any way.

    Well, I am a quite bad programmer but I am interested enough in the >Linux/UNIX workings so that reading the newest APUE and The Linux
    Programming Interface did not feel painful or unnecessary at all. On
    the contrary, it was a great pleasure to examine what kind of
    programming facilities my favourite OS offers.

    Having these two books, or just one of them, is a great way to educate >oneself about Linux/UNIX. I see that The Linux Programming Interface
    is available online as a free PDF, but I am not sure whether it is
    a pirated version.

    There is no better way to learn Linux/UNIX workings than these two
    books. Period.

    The advantage of books written by professionals is that the code and explanations are usually much clearer and of better equality than the quickly knocked up might-work-might-not crap you often find on stack overflow and similar sites. Thats not to say good example code isn't out there but wading through the rubbish can be a tedious business and IME its often quicker just
    to reach for APUE or similar.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Muttley@dastardlyhq.com@21:1/5 to All on Wed Aug 21 07:36:58 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Wed, 21 Aug 2024 09:26:41 +0200
    David Brown <david.brown@hesbynett.no> boringly babbled:
    So I don't question that it is interesting, informative, or a pleasure
    to read. I question that it is /necessary/. You simply cannot argue
    that people who want to program for Linux /must/ read that book. There
    is no justification for that claim. There is no justification for
    claiming that people wanting to program for Linux need to read any books
    on the topic at all, nor for claims that people need to "know POSIX" to
    be able to write code for Linux and/or in C.

    Only knowing core C will severely limit what you can do on any OS. If
    you're happy just coding up file processors or some self contained
    mathematical algo and simply writing to stdout or a file then fine, but to do anything more sophisticated you'll need to know the OS API whether its posix
    + X on *nix or Win32 on Windows.

    There are a thousand and one ways to learn about the workings of Linux -
    and that's counting "reading books" as one way, regardless of /which/

    Linear learning is usually better than snippets from google. If you want
    to learn a shakespear play you read the book, you don't google little bits
    of it at a time.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Kalevi Kolttonen on Wed Aug 21 09:26:41 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 20/08/2024 22:56, Kalevi Kolttonen wrote:
    In comp.unix.programmer David Brown <david.brown@hesbynett.no> wrote:
    No, you do not need your particular favourite out of the thousand and
    one Linux programming books in order to program for Linux. You do not
    need /any/ book in order to write useful and successful code for Linux.
    Of course you need /some/ reference - and in the days before the
    internet was so easily available and so full of information, I went
    through a lot of programming books. Some were good, some less so, and
    some have become famous. But none of them were /necessary/ in any way.

    Well, I am a quite bad programmer but I am interested enough in the Linux/UNIX workings so that reading the newest APUE and The Linux
    Programming Interface did not feel painful or unnecessary at all. On
    the contrary, it was a great pleasure to examine what kind of
    programming facilities my favourite OS offers.

    I have no doubt that this could be interesting to read about, and the
    book could be very well written (I don't know the book myself, so I'll
    take your word for it). At least half the computing and programming
    books I have read covered things that I have no use for personally, and
    don't expect to use.

    So I don't question that it is interesting, informative, or a pleasure
    to read. I question that it is /necessary/. You simply cannot argue
    that people who want to program for Linux /must/ read that book. There
    is no justification for that claim. There is no justification for
    claiming that people wanting to program for Linux need to read any books
    on the topic at all, nor for claims that people need to "know POSIX" to
    be able to write code for Linux and/or in C.


    Having these two books, or just one of them, is a great way to educate oneself about Linux/UNIX. I see that The Linux Programming Interface
    is available online as a free PDF, but I am not sure whether it is
    a pirated version.

    There is no better way to learn Linux/UNIX workings than these two
    books. Period.


    That claim is not /wrong/ - it falls into the category of "not even wrong".

    There are a thousand and one ways to learn about the workings of Linux -
    and that's counting "reading books" as one way, regardless of /which/
    books. You have personally tried one way - from that, you cannot
    possibly conclude that it is the "best" way. All you can say is that
    you liked those books, and found them informative and pleasant to read,
    you learned a lot from them, and you can recommend them to others.
    That's great. Leave it there, and stop making completely absurd,
    exaggerated and unjustified claims beyond that.

    And you don't need to know about the workings of Linux to program for Linux.

    And you don't need to know anything about Linux, UNIX or POSIX to
    program in C. I've programmed C for some 35 years, and almost none of
    it has been for Linux or other *nix. I've used only a small fraction of
    the standard library. Even the few programs I have written that run on
    Linux had no POSIX-specific code. What you need to know about for any programming task is the stuff appropriate for the task at hand - /not/ comprehensive knowledge of APIs and interfaces that you will never use,
    and certainly not some ancient random book recommended by someone off
    the internet.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to David Brown on Wed Aug 21 07:38:07 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Wed, 21 Aug 2024 09:26:41 +0200, David Brown wrote:

    And you don't need to know anything about Linux, UNIX or POSIX to
    program in C.

    I think the point has been made on comp.lang.c more than once, that C
    without POSIX can be a very dull language indeed ...

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dmitry A. Kazakov@21:1/5 to Lawrence D'Oliveiro on Wed Aug 21 10:07:47 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 2024-08-21 02:59, Lawrence D'Oliveiro wrote:
    On Tue, 20 Aug 2024 10:27:01 +0200, Dmitry A. Kazakov wrote:

    The question is sustainability in long term.

    In the long term, proprietary software is in retreat, while Free software
    is on the rise. So it’s quite clear which one is more “sustainable”.

    I mean economic sustainability. Normally you cannot sustain a whole
    branch of economy keeping it black.

    --
    Regards,
    Dmitry A. Kazakov
    http://www.dmitry-kazakov.de

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Muttley@dastardlyhq.com on Wed Aug 21 11:10:53 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 21/08/2024 09:36, Muttley@dastardlyhq.com wrote:
    On Wed, 21 Aug 2024 09:26:41 +0200
    David Brown <david.brown@hesbynett.no> boringly babbled:
    So I don't question that it is interesting, informative, or a pleasure
    to read. I question that it is /necessary/. You simply cannot argue
    that people who want to program for Linux /must/ read that book. There
    is no justification for that claim. There is no justification for
    claiming that people wanting to program for Linux need to read any books
    on the topic at all, nor for claims that people need to "know POSIX" to
    be able to write code for Linux and/or in C.

    Only knowing core C will severely limit what you can do on any OS. If
    you're happy just coding up file processors or some self contained mathematical algo and simply writing to stdout or a file then fine, but to do anything more sophisticated you'll need to know the OS API whether its posix + X on *nix or Win32 on Windows.

    No, you do not.

    Why is this so difficult for some people to understand? You need to
    know about the parts relevant to the things you are doing. Modern OS's
    are /huge/. It is meaningless to talk about "knowing the OS API",
    because before you have learned 10% of it, major new versions will be
    available and at least part of your knowledge may be outdated. By the
    time you have learned /all/ of it, several versions have passed and
    you've been fired from your job for pissing around for years learning
    things that have no relevance to your task, and you've probably
    forgotten at least half of it. And then you can start learning the
    third-party libraries and APIs that are not part of the OS but useful
    for the task.

    If you are writing network software for Linux, how is it relevant to
    learn about the sound API, or the more advanced filesystem API's ? If
    you are writing a gui program with QT, why should you be interested in X
    APIs or POSIX threading and file handling - you'll be using the QT
    libraries and APIs for graphics, threading and file handling.

    I have not suggested, or even hinted, that all you need is "core C" -
    what you need is the knowledge that is relevant to the task at hand,
    regardless of the OS, language, or whatever.


    There are a thousand and one ways to learn about the workings of Linux -
    and that's counting "reading books" as one way, regardless of /which/

    Linear learning is usually better than snippets from google. If you want
    to learn a shakespear play you read the book, you don't google little bits
    of it at a time.


    When did I suggest that snippets from google was "the" way to learn?

    I'd agree that reading a book or two is likely to be better than reading nothing but "snippets from google". You now have another 999 strawmen
    to go through.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kalevi Kolttonen@21:1/5 to Lawrence D'Oliveiro on Wed Aug 21 08:45:41 2024
    XPost: comp.unix.shell, comp.unix.programmer

    In comp.unix.programmer Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
    On Tue, 20 Aug 2024 14:21:38 -0000 (UTC), Kalevi Kolttonen wrote:

    Even though his PhD thesis was
    something like 100-150 pages of strange-looking formulas, he said he had
    problems with C on the Amiga. For some reason, he was unable to remember
    what functions where provided as standard libraries, so he always ended
    up writing his own functions instead of using libraries.

    Was he not able to keep some reference docs handy? For example, I rarely
    get very far in working on Python code without having this page <https://docs.python.org/3/library/> open in a browser.

    Sorry, I don't know. I only know that he told me he was
    unable to remember what the standard libraries on Amiga
    offered. So he did much unnecessary duplication of code
    writing the functions himself.

    I have never owned Commodore Amiga and I have no
    knowledge about its C compilers or the related
    documentation.

    br,
    KK

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Lawrence D'Oliveiro on Wed Aug 21 11:11:46 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 21/08/2024 09:38, Lawrence D'Oliveiro wrote:
    On Wed, 21 Aug 2024 09:26:41 +0200, David Brown wrote:

    And you don't need to know anything about Linux, UNIX or POSIX to
    program in C.

    I think the point has been made on comp.lang.c more than once, that C
    without POSIX can be a very dull language indeed ...

    It was wrong on comp.lang.c, and it is wrong here. Proof by repeated
    assertion is not valid.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Muttley@dastardlyhq.com on Wed Aug 21 11:15:51 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 21/08/2024 09:27, Muttley@dastardlyhq.com wrote:
    On Tue, 20 Aug 2024 20:56:00 -0000 (UTC)
    kalevi@kolttonen.fi (Kalevi Kolttonen) boringly babbled:
    In comp.unix.programmer David Brown <david.brown@hesbynett.no> wrote:
    No, you do not need your particular favourite out of the thousand and
    one Linux programming books in order to program for Linux. You do not
    need /any/ book in order to write useful and successful code for Linux.
    Of course you need /some/ reference - and in the days before the
    internet was so easily available and so full of information, I went
    through a lot of programming books. Some were good, some less so, and
    some have become famous. But none of them were /necessary/ in any way.

    Well, I am a quite bad programmer but I am interested enough in the
    Linux/UNIX workings so that reading the newest APUE and The Linux
    Programming Interface did not feel painful or unnecessary at all. On
    the contrary, it was a great pleasure to examine what kind of
    programming facilities my favourite OS offers.

    Having these two books, or just one of them, is a great way to educate
    oneself about Linux/UNIX. I see that The Linux Programming Interface
    is available online as a free PDF, but I am not sure whether it is
    a pirated version.

    There is no better way to learn Linux/UNIX workings than these two
    books. Period.

    The advantage of books written by professionals is that the code and explanations are usually much clearer and of better equality than the quickly knocked up might-work-might-not crap you often find on stack overflow and similar sites. Thats not to say good example code isn't out there but wading through the rubbish can be a tedious business and IME its often quicker just to reach for APUE or similar.


    "Usually" suggests you have statistics to back that up.

    The reality is that there are endless numbers of crap books with poor explanations, buggy examples, and outdated information - as well as
    their being books that are high quality, accurate, and keep enough
    generality to be relevant for many years. Equally, there are lots of
    posts on stack overflow and other such sites with top-quality code just
    as there are posts with complete nonsense, or (worse) subtly wrong code
    and answers.

    The medium, or the price of getting the information, is at most only in
    vague correlation with the quality of the information.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Muttley@dastardlyhq.com@21:1/5 to All on Wed Aug 21 10:26:03 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Wed, 21 Aug 2024 11:10:53 +0200
    David Brown <david.brown@hesbynett.no> boringly babbled:
    If you are writing network software for Linux, how is it relevant to
    learn about the sound API, or the more advanced filesystem API's ? If

    You don't, but the subsystems don't exist in isolation, there's a lot of overlap. Eg network sockets use a lot of the same API functions as files
    (eg: read, write, fcntl, ioctl) so understanding may well help to understand the other.

    you are writing a gui program with QT, why should you be interested in X
    APIs or POSIX threading and file handling - you'll be using the QT
    libraries and APIs for graphics, threading and file handling.

    Not necessarily.

    I have not suggested, or even hinted, that all you need is "core C" -
    what you need is the knowledge that is relevant to the task at hand, >regardless of the OS, language, or whatever.

    Its certainly the impression you gave.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Bart on Tue Aug 27 15:10:08 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 27/08/2024 12:26, Bart wrote:
    On 27/08/2024 09:39, Richard Kettlewell wrote:
    John Ames <commodorejohn@gmail.com> writes:
    But even if that helps you organizationally, it doesn't resolve issues
    of the interpreter potentially mis-parsing things due to mismatches in
    tab/space factor between $EDITOR and the Python RTE, which is a truly
    ridiculous thing to have to be concerned about.

    In many years of using Python routinely and extensively I’ve simply
    never found the whitespace issues that people are worrying about here to
    be a problem in practice. Some of this may be a matter of experience but
    if so, it’s a form of experience that must have built up very quickly.


    I have occasionally, but only occasionally, seen problems with white
    space. And those would normally be caught by Python 3.

    As an aesthetic objection, of course, there’s no accounting for
    taste. But it doesn’t seem to be a practical problem in reality.

    (In contrast C’s rules have occasionally been a practical problem,
    contributing to at least one high-profile software vulnerability and
    attracting compiler warnings to mitigate the risks.)

    These are the problems I've seen. I haven't used the language
    extensively, but I've used it enough.

    Your problems below are all valid, but not insurmountable. I too would
    rather have explicit block delimiters, but it's not actually hard to
    work with Python as it is.


    (1) An tab at the start of a line gets accidentally indented or
    unindented. If you weren't paying close attention, it may not be clear
    that that has happened, if this line was either the last line of an
    indented block, or the line following


    That /can/ happen. It is a good idea to avoid mixing tabs and spaces in
    the same file. Most editors can be configured one way or the other, but
    if you use different editors under different circumstances (as I do),
    mistakes are possible. They are usually quickly identified and quickly handled.

    (2) You want to temporarily comment out an 'if' line so that the
    following block is unconditional. You can't do that with also
    unindenting the block. And, also  the block then merges with the
    following one as it's at the same level, so when you want to change it back...

    Replace your

    if cond :

    with

    if 1 :

    or

    if True :



    (3) Similarly, you want to temportarily wrap an 'if' statement, for
    example, around a block of code. But you can't do it witout indenting
    that block.


    True. But any editor will let you select the lines and indent them.

    (4) Sometimes you want to add temporary debug code as part of a block. Usually I write such lines in all-caps and without indentation to make
    them stand out clear. With Python, I can't use all-caps and I have to
    use exactly the same indent as the rest of the block. So the lines
    merge. Then when I need to remove the code, it's not clearly delimited.

    Comments are an extremely easy way to make the code stand out.


    (5) Sometimes you want to temporarily comment out the contents of a
    block. But Python doesn't allow an empty block; now you have to use
    'pass'. And then get rid of if later.

    You can leave the "pass" in, if you don't want to get ride of it later.
    I sometimes find "pass" to be helpful as an alternative to leaving a
    hanging indented block.


    (6) You want to add extra statements to the end of a block, but where IS
    the end? You have to INFER the ending by looking for a line with a
    smaller indent. But suppose you're at the bottom of a window; is that
    bottom line the last in the block, or is there another one at the same
    indent just out of sight? You have to tentatively keep peeking ahead!

    Keep your blocks small and neat.


    (6a) And maybe there's big comment blocking in the middle of block;
    comments don't need nesting! If there are lots of comments and few statements, finding the end of the block (ie. the last statement of this block) can become quite an exercise.

    That applies to every programming language (unless you know of one that
    doesn't support comments).


    (7) You take some Python code you've seen online (eg. in a usenet post)
    and paste into your editor. Maybe you want to merge it with your own code.

    But its tabbing is all spaces; yours is all tabs. Plus invariably, the
    whole thing has extra indentation (eg. the leftmost statement is already indented). Or you want to copy code from within a block to a different
    indent level.

    Any sane editor will give you tools to fix that - automatic indentation, tab-to-space and space-to-tab conversion, manual indent or outdent block
    tools, etc.


    The whole thing gets very messy and error prone. You need special editor commands to deal with the mess.

    No, you don't. (Unless you think "special" means "anything but Windows Notepad" .)


    Indented, non-delimited code and data is fine for machine-generated and machine processed code. But it's a disaster for code that has to be human-generated and human-maintained. It's just too fragile.


    In real-life Python coding, it works fine. I prefer explicit block
    delimiters, but I cannot say Python's white-space blocking has been a significant source of trouble or inconvenience for me. Perhaps that's
    because I have always been used to careful and consistent formatting. I
    don't write C code (or any other code) with inconsistent spacing, mixes
    of tabs and spaces, or unexpected indentations. So for me, the spacing
    and tabbing of Python code would be identical if it had braces or other begin-end markers.

    The fact that people have to resort to adding #end lines, which only
    partly deals with one or two of those problems, suggest that something
    is badly wrong.


    No one has to do that. It's a Lawrence peculiarity, and his coding
    style (in Python or C, and probably anything else) would be rejected by
    anyone with a coding standard. I agree that it suggests that something
    is badly wrong, but it is not with the language!

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Richard Kettlewell@21:1/5 to Bart on Tue Aug 27 13:46:36 2024
    XPost: comp.unix.shell, comp.unix.programmer

    Bart <bc@freeuk.com> writes:
    On 27/08/2024 09:39, Richard Kettlewell wrote:
    John Ames <commodorejohn@gmail.com> writes:
    But even if that helps you organizationally, it doesn't resolve issues
    of the interpreter potentially mis-parsing things due to mismatches in
    tab/space factor between $EDITOR and the Python RTE, which is a truly
    ridiculous thing to have to be concerned about.
    In many years of using Python routinely and extensively I’ve simply
    never found the whitespace issues that people are worrying about here to
    be a problem in practice. Some of this may be a matter of experience but
    if so, it’s a form of experience that must have built up very quickly.
    As an aesthetic objection, of course, there’s no accounting for
    taste. But it doesn’t seem to be a practical problem in reality.
    (In contrast C’s rules have occasionally been a practical problem,
    contributing to at least one high-profile software vulnerability and
    attracting compiler warnings to mitigate the risks.)

    These are the problems I've seen. I haven't used the language
    extensively, but I've used it enough.

    All I can say is that for the most part these issues just don’t arise
    for me. Some are plainly aesthetic; I already addressed that. Others
    sounds like issues with your tooling - changing the indentation of a
    range of lines is easy in most editors, for example.

    The cases that actually seem familiar:

    (2) You want to temporarily comment out an 'if' line so that the
    following block is unconditional. You can't do that with also
    unindenting the block. And, also the block then merges with the
    following one as it's at the same level, so when you want to change it back...

    You can put ‘or True’ at the end of the condition.

    (5) Sometimes you want to temporarily comment out the contents of a
    block. But Python doesn't allow an empty block; now you have to use
    'pass'. And then get rid of if later.

    You can put an ‘if False’ at the top.

    The fact that people have to resort to adding #end lines, which only
    partly deals with one or two of those problems, suggest that something
    is badly wrong.

    I’ve never encountered anyone else doing that in Python. It suggests
    more than the individual doing that just doesn’t like the language, in
    which case I’d just suggest that person doesn’t use it.

    --
    https://www.greenend.org.uk/rjk/

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Bart@21:1/5 to David Brown on Tue Aug 27 15:18:47 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 27/08/2024 14:10, David Brown wrote:
    On 27/08/2024 12:26, Bart wrote:
    On 27/08/2024 09:39, Richard Kettlewell wrote:
    John Ames <commodorejohn@gmail.com> writes:
    But even if that helps you organizationally, it doesn't resolve issues >>>> of the interpreter potentially mis-parsing things due to mismatches in >>>> tab/space factor between $EDITOR and the Python RTE, which is a truly
    ridiculous thing to have to be concerned about.

    In many years of using Python routinely and extensively I’ve simply
    never found the whitespace issues that people are worrying about here to >>> be a problem in practice. Some of this may be a matter of experience but >>> if so, it’s a form of experience that must have built up very quickly. >>>

    I have occasionally, but only occasionally, seen problems with white
    space.  And those would normally be caught by Python 3.

    As an aesthetic objection, of course, there’s no accounting for
    taste. But it doesn’t seem to be a practical problem in reality.

    (In contrast C’s rules have occasionally been a practical problem,
    contributing to at least one high-profile software vulnerability and
    attracting compiler warnings to mitigate the risks.)

    These are the problems I've seen. I haven't used the language
    extensively, but I've used it enough.

    Your problems below are all valid, but not insurmountable.  I too would rather have explicit block delimiters, but it's not actually hard to
    work with Python as it is.


    (1) An tab at the start of a line gets accidentally indented or
    unindented. If you weren't paying close attention, it may not be clear
    that that has happened, if this line was either the last line of an
    indented block, or the line following


    That /can/ happen.  It is a good idea to avoid mixing tabs and spaces in
    the same file.  Most editors can be configured one way or the other, but
    if you use different editors under different circumstances (as I do), mistakes are possible.  They are usually quickly identified and quickly handled.

    (2) You want to temporarily comment out an 'if' line so that the
    following block is unconditional. You can't do that with also
    unindenting the block. And, also  the block then merges with the
    following one as it's at the same level, so when you want to change it
    back...

    Replace your

        if cond :

    with

        if 1 :

    or

        if True :



    (3) Similarly, you want to temportarily wrap an 'if' statement, for
    example, around a block of code. But you can't do it witout indenting
    that block.


    True.  But any editor will let you select the lines and indent them.

    (4) Sometimes you want to add temporary debug code as part of a block.
    Usually I write such lines in all-caps and without indentation to make
    them stand out clear. With Python, I can't use all-caps and I have to
    use exactly the same indent as the rest of the block. So the lines
    merge. Then when I need to remove the code, it's not clearly delimited.

    Comments are an extremely easy way to make the code stand out.


    (5) Sometimes you want to temporarily comment out the contents of a
    block. But Python doesn't allow an empty block; now you have to use
    'pass'. And then get rid of if later.

    You can leave the "pass" in, if you don't want to get ride of it later.
    I sometimes find "pass" to be helpful as an alternative to leaving a
    hanging indented block.


    (6) You want to add extra statements to the end of a block, but where
    IS the end? You have to INFER the ending by looking for a line with a
    smaller indent. But suppose you're at the bottom of a window; is that
    bottom line the last in the block, or is there another one at the same
    indent just out of sight? You have to tentatively keep peeking ahead!

    Keep your blocks small and neat.


    (6a) And maybe there's big comment blocking in the middle of block;
    comments don't need nesting! If there are lots of comments and few
    statements, finding the end of the block (ie. the last statement of
    this block) can become quite an exercise.

    That applies to every programming language (unless you know of one that doesn't support comments).


    (7) You take some Python code you've seen online (eg. in a usenet
    post) and paste into your editor. Maybe you want to merge it with your
    own code.

    But its tabbing is all spaces; yours is all tabs. Plus invariably, the
    whole thing has extra indentation (eg. the leftmost statement is
    already indented). Or you want to copy code from within a block to a
    different indent level.

    Any sane editor will give you tools to fix that - automatic indentation, tab-to-space and space-to-tab conversion, manual indent or outdent block tools, etc.


    The whole thing gets very messy and error prone. You need special
    editor commands to deal with the mess.

    No, you don't.  (Unless you think "special" means "anything but Windows Notepad" .)


    Indented, non-delimited code and data is fine for machine-generated
    and machine processed code. But it's a disaster for code that has to
    be human-generated and human-maintained. It's just too fragile.


    In real-life Python coding, it works fine.  I prefer explicit block delimiters, but I cannot say Python's white-space blocking has been a significant source of trouble or inconvenience for me.  Perhaps that's because I have always been used to careful and consistent formatting.  I don't write C code (or any other code) with inconsistent spacing, mixes
    of tabs and spaces, or unexpected indentations.  So for me, the spacing
    and tabbing of Python code would be identical if it had braces or other begin-end markers.

    The fact that people have to resort to adding #end lines, which only
    partly deals with one or two of those problems, suggest that something
    is badly wrong.


    No one has to do that.  It's a Lawrence peculiarity, and his coding
    style (in Python or C, and probably anything else) would be rejected by anyone with a coding standard.  I agree that it suggests that something
    is badly wrong, but it is not with the language!

    It's not just him. Below is some Nim code, which uses indentation like
    Python. (It's from inside other statements which accounts for the
    overall indents.)

    Suppose I want to add code to follow that top-level 'if' statement;
    where would it go? Since it's not clear from my extract whether that's
    the entire content of my if statement.

    And at what indent level, since I'm some way off from that if? It's easy
    to get it wrong.

    if q1!=1:
    for i in countup(2,n):
    q[i]=p[i]
    flips=1
    while true:
    qq=q[q1]
    if qq==1:
    sum+=sign*flips
    if flips>maxflips:
    maxflips=flips
    break
    q[q1]=q1
    if q1>=4:
    i=2
    j=q1-1
    while true:
    t=q[i]
    q[i]=q[j]
    q[j]=t
    i+=1
    j-=1
    if i>=j:
    break
    q1=qq
    flips+=1

    This was an attempt to port an benchmark into Nim; I'd spent the best
    part of an hour trying to get it right, but it kept going wrong. In the
    end I resorted to artificial block terminators.

    The final code looked like that below. Now it is much, much easier to
    see what goes where, and what belongs to what. I can more confidently
    write that extra statement following the opening 'if'.

    With these changes, the porting went much more smooothly.

    if q1!=1:
    for i in countup(2,n):
    q[i]=p[i]
    # end
    flips=1
    while true:
    qq=q[q1]
    if qq==1:
    sum+=sign*flips
    if flips>maxflips:
    maxflips=flips
    # end
    break
    # end
    q[q1]=q1
    if q1>=4:
    i=2
    j=q1-1
    while true:
    t=q[i]
    q[i]=q[j]
    q[j]=t
    i+=1
    j-=1
    if i>=j:
    break
    # end
    # end
    # end
    q1=qq
    flips+=1
    # end
    # end


    Sure, people CAN program in such languages, but it is harder work and
    more error prone.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Muttley@dastardlyhq.com@21:1/5 to John Ames on Tue Aug 27 18:08:22 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Tue, 27 Aug 2024 08:03:20 -0700
    John Ames <commodorejohn@gmail.com> wrote:
    It applies very much moreso to languages where comments *must* follow
    the indentation level of the surrounding code, so that the deeper you
    go, the more lines you have to split comments across.

    Unless you're one of those developers for whom breaking up lines is a foreign concept and you just continue on a single line until you're done no matter
    how long it is.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to John Ames on Tue Aug 27 20:46:27 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 27/08/2024 17:03, John Ames wrote:
    On Tue, 27 Aug 2024 15:10:08 +0200
    David Brown <david.brown@hesbynett.no> wrote:

    (6) You want to add extra statements to the end of a block, but
    where IS the end? You have to INFER the ending by looking for a
    line with a smaller indent. But suppose you're at the bottom of a
    window; is that bottom line the last in the block, or is there
    another one at the same indent just out of sight? You have to
    tentatively keep peeking ahead!

    Keep your blocks small and neat.

    That's very much one for the "good advice that is not always feasible
    in the Real World" file. Every project has its own natural balance of
    "large things that can be easily re-factored into sets of small things"
    (i.e. things you can function-ize) vs. "large things that cannot."


    Sure. But if you keep such advice at hand, then it is often easier to
    make it feasible. Occasionally code is best formatted with a big
    function or two, but most of the time it is possible and preferable to
    have relatively small function.

    (6a) And maybe there's big comment blocking in the middle of block;
    comments don't need nesting! If there are lots of comments and few
    statements, finding the end of the block (ie. the last statement of
    this block) can become quite an exercise.

    That applies to every programming language (unless you know of one
    that doesn't support comments).

    It applies very much moreso to languages where comments *must* follow
    the indentation level of the surrounding code, so that the deeper you
    go, the more lines you have to split comments across.


    It is not common to have to have indent comment lines (certainly in
    Python it is not necessary). And if you find yourself writing large
    comments in the middle of a block in the middle of a function, it is
    probably time to consider re-organising the code and/or the comments and documentation. (Again, there can be exceptions to this general rule.)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to David Brown on Tue Aug 27 21:40:19 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Tue, 27 Aug 2024 20:46:27 +0200, David Brown wrote:

    It is not common to have to have indent comment lines (certainly in
    Python it is not necessary). And if you find yourself writing large
    comments in the middle of a block in the middle of a function, it is
    probably time to consider re-organising the code and/or the comments and documentation. (Again, there can be exceptions to this general rule.)

    Counterexample: <https://www.cairographics.org/cookbook/freetypepython/>
    (Yes, that’s one of mine). Note the explanation of the user-data dance,
    for backward compatibility with older FreeType. Where else would you put
    the comments, if not next to the code they’re explaining?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Bart on Tue Aug 27 21:34:54 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Tue, 27 Aug 2024 11:26:18 +0100, Bart wrote:

    (2) You want to temporarily comment out an 'if' line so that the
    following block is unconditional. You can't do that with also
    unindenting the block.

    In Emacs, I have commands defined to adjust the indentation of the
    selected region. Surely any other decent editor would offer the same.

    And, also the block then merges with the
    following one as it's at the same level, so when you want to change it back...

    This is where my “#end” comments come in.

    (6a) And maybe there's big comment blocking in the middle of block;
    comments don't need nesting! If there are lots of comments and few statements, finding the end of the block (ie. the last statement of this block) can become quite an exercise.

    Again, “#end” comments help with this.

    (7) You take some Python code you've seen online (eg. in a usenet post)
    and paste into your editor. Maybe you want to merge it with your own
    code.

    But its tabbing is all spaces; yours is all tabs. Plus invariably, the
    whole thing has extra indentation (eg. the leftmost statement is already indented). Or you want to copy code from within a block to a different
    indent level.

    Like I said, Emacs makes this easy. Also a quick application of “untabify” will turn all tabs in the selected region to spaces, to match with the
    rest of my code.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Keith Thompson on Tue Aug 27 23:28:18 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Tue, 27 Aug 2024 14:49:19 -0700, Keith Thompson wrote:

    I've done some Python programming, and it wouldn't occur to me to add
    "#end" comments. If I saw them in a code review I'd probably recommend deleting them.

    Give them a try. They simplify a lot of situations. I already posted a reasonably complex example in this thread. Go have a look at it, and see
    what happens when you delete those comments.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Sebastian@21:1/5 to Richard Kettlewell on Wed Aug 28 02:48:59 2024
    XPost: comp.unix.shell, comp.unix.programmer

    In comp.unix.programmer Richard Kettlewell <invalid@invalid.invalid> wrote:
    John Ames <commodorejohn@gmail.com> writes:
    But even if that helps you organizationally, it doesn't resolve issues
    of the interpreter potentially mis-parsing things due to mismatches in
    tab/space factor between $EDITOR and the Python RTE, which is a truly
    ridiculous thing to have to be concerned about.

    In many years of using Python routinely and extensively I?ve simply
    never found the whitespace issues that people are worrying about here to
    be a problem in practice. Some of this may be a matter of experience but
    if so, it?s a form of experience that must have built up very quickly.

    I've seen bugs in production that are due to Python's indentation rules. Consider this class:

    class Foo:
    def method1(self):
    call1()
    call2()
    call3()

    def method2(self):
    call4()
    if some_condition:
    with some_object() as o:
    call5()
    # hundreds of other lines of code
    call6()

    At my company, somebody tried to delete a method like method2() above,
    but forgot the last few lines (represented by call6()). This does
    not introduce a SyntaxError. Instead, call6() is now part of method1()
    because it's at the same level of indentation. In most programming
    languages, the beginning of method2() would be preceded by some delimiter marking the end of method1(), which would prevent an accidental merger
    of this type.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Sebastian@21:1/5 to Richard Kettlewell on Wed Aug 28 02:53:41 2024
    XPost: comp.unix.shell, comp.unix.programmer

    In comp.unix.programmer Richard Kettlewell <invalid@invalid.invalid> wrote:
    Bart <bc@freeuk.com> writes:
    On 27/08/2024 09:39, Richard Kettlewell wrote:

    The fact that people have to resort to adding #end lines, which only
    partly deals with one or two of those problems, suggest that something
    is badly wrong.

    I?ve never encountered anyone else doing that in Python. It suggests
    more than the individual doing that just doesn?t like the language, in
    which case I?d just suggest that person doesn?t use it.

    I think it's a great idea. I'm considering asking my team to start adding
    #end comments to our codebase.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Sebastian@21:1/5 to David Brown on Wed Aug 28 03:19:07 2024
    XPost: comp.unix.shell, comp.unix.programmer

    In comp.unix.programmer David Brown <david.brown@hesbynett.no> wrote:

    It is not common to have to have indent comment lines (certainly in
    Python it is not necessary). And if you find yourself writing large
    comments in the middle of a block in the middle of a function, it is
    probably time to consider re-organising the code and/or the comments and documentation. (Again, there can be exceptions to this general rule.)


    It may not be "common" (ie, not a lot of languages have this requirement),
    but if it's your job to maintain a project written in such a language,
    then you'll have to deal with that problem every single day.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Keith Thompson on Wed Aug 28 05:30:31 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Tue, 27 Aug 2024 19:10:57 -0700, Keith Thompson wrote:

    Lawrence D'Oliveiro <ldo@nz.invalid> writes:

    On Tue, 27 Aug 2024 14:49:19 -0700, Keith Thompson wrote:

    I've done some Python programming, and it wouldn't occur to me to add
    "#end" comments. If I saw them in a code review I'd probably
    recommend deleting them.

    Give them a try. They simplify a lot of situations. I already posted a
    reasonably complex example in this thread. Go have a look at it, and
    see what happens when you delete those comments.

    No, I won't be doing that.

    I wonder why? You expressed an opinion about them, yet when I try to find
    out more about why you feel that way, you run away.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Sebastian on Wed Aug 28 12:45:40 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 28/08/2024 05:19, Sebastian wrote:
    In comp.unix.programmer David Brown <david.brown@hesbynett.no> wrote:

    It is not common to have to have indent comment lines (certainly in
    Python it is not necessary). And if you find yourself writing large
    comments in the middle of a block in the middle of a function, it is
    probably time to consider re-organising the code and/or the comments and
    documentation. (Again, there can be exceptions to this general rule.)


    It may not be "common" (ie, not a lot of languages have this requirement), but if it's your job to maintain a project written in such a language,
    then you'll have to deal with that problem every single day.

    If you have some code that needs a lot of documentation (and some does),
    then put the comments in a place that does not interfere with reading
    and understanding the code. Comments that make code harder to read are counter-productive.

    Where these comments end up - elsewhere in the function, outside the
    function, at the head of the file, in a separate file, in completely
    separate documentation - depends on the situation.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to David Brown on Tue Sep 3 21:56:36 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Tue, 3 Sep 2024 10:46:55 +0200, David Brown wrote:

    I changed it in a re-write to:

    def register_additional_standard(self, managed_objects) :
    if managed_objects :
    # ....

    My original was meant with future extensibility in mind. That was made
    clear in the docstring. You *did* read the docstring, didn’t you?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Lawrence D'Oliveiro on Wed Sep 4 09:30:39 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 03/09/2024 23:56, Lawrence D'Oliveiro wrote:
    On Tue, 3 Sep 2024 10:46:55 +0200, David Brown wrote:

    I changed it in a re-write to:

    def register_additional_standard(self, managed_objects) :
    if managed_objects :
    # ....

    My original was meant with future extensibility in mind. That was made
    clear in the docstring. You *did* read the docstring, didn’t you?

    Even if it was intended to be extendable, it would still be a /very/
    silly way to write the code.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Muttley@dastardlyhq.com on Wed Aug 21 17:27:04 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 21/08/2024 12:26, Muttley@dastardlyhq.com wrote:
    On Wed, 21 Aug 2024 11:10:53 +0200
    David Brown <david.brown@hesbynett.no> boringly babbled:
    If you are writing network software for Linux, how is it relevant to
    learn about the sound API, or the more advanced filesystem API's ? If

    You don't, but the subsystems don't exist in isolation, there's a lot of overlap. Eg network sockets use a lot of the same API functions as files
    (eg: read, write, fcntl, ioctl) so understanding may well help to understand the other.

    Sure.

    Of course understanding /some/ of this is essential for a lot of tasks.
    And understanding a bit more can be /useful/. My argument is against
    this idea that you need to learn it all.

    Let's take an example. In my line of work, I use UARTs a lot - I've
    probably used UART's on 20-30 different microcontroller families, as
    well as external UART chips, bit-banging in software, with polling, DMA, interrupts, RTOS abstractions, SDK routines. I've used them a /lot/.

    Trying to understand the Linux documentation for UARTs is a nightmare.
    They are horrendous - the APIs, structs, flag sets, etc., are a vast
    jumble of crap for handling terminals that haven't been seen outside a
    museum for 50 years, long before Linux was conceived. Trying to get the
    right selection of API calls, struct setups, etc., simple raw UART
    access to send and receive characters can take many days of studying documentation of questionable standard, trial and error, and guesswork.
    A good "Programming Linux" book /might/ help - but it might be out of
    date. Snippets from googling, however, /does/ get the job done - you
    can find examples, try them out and see what works, and in a few hours I
    had everything running.

    Even better, of course, is to ditch C and use Python - "pyserial" does
    it all, simply and cleanly. (And the same code works on Windows, if
    that happens to be useful - though Windows picks pseudo-random names for
    serial ports and has nothing like udev rules.) But for this particular customer, it had to be in C (well, C++, but that's a minor detail).

    Would that task have been easier if I'd studied the details of fcntl,
    ioctl, and other calls that were needed for the task? No, not at all.
    Would "knowing POSIX" have helped? Would reading some old book on Linux programming have helped? No. (I /have/ read books on Linux programming.)

    But a rough idea of some of the concepts of Linux development was
    useful. Knowing /something/ about the OS is helpful.



    you are writing a gui program with QT, why should you be interested in X
    APIs or POSIX threading and file handling - you'll be using the QT
    libraries and APIs for graphics, threading and file handling.

    Not necessarily.

    I have not suggested, or even hinted, that all you need is "core C" -
    what you need is the knowledge that is relevant to the task at hand,
    regardless of the OS, language, or whatever.

    Its certainly the impression you gave.


    I can't imagine how you got that from my posts.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Muttley@dastardlyhq.com@21:1/5 to All on Wed Aug 21 15:40:05 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Wed, 21 Aug 2024 17:27:04 +0200
    David Brown <david.brown@hesbynett.no> boringly babbled:
    On 21/08/2024 12:26, Muttley@dastardlyhq.com wrote:
    Trying to understand the Linux documentation for UARTs is a nightmare.
    They are horrendous - the APIs, structs, flag sets, etc., are a vast
    jumble of crap for handling terminals that haven't been seen outside a
    museum for 50 years, long before Linux was conceived. Trying to get the

    Unfortunately terminals are complex beasts with many permutations though
    all that should be a higher level that what you were doing with a UART.

    Even better, of course, is to ditch C and use Python - "pyserial" does
    it all, simply and cleanly. (And the same code works on Windows, if

    The problem with pyserial is you have to use Python. Horrible language
    though like BASIC, useful for teaching kids to code.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Muttley@dastardlyhq.com on Wed Aug 21 21:15:14 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 21/08/2024 17:40, Muttley@dastardlyhq.com wrote:
    On Wed, 21 Aug 2024 17:27:04 +0200
    David Brown <david.brown@hesbynett.no> boringly babbled:
    On 21/08/2024 12:26, Muttley@dastardlyhq.com wrote:
    Trying to understand the Linux documentation for UARTs is a nightmare.
    They are horrendous - the APIs, structs, flag sets, etc., are a vast
    jumble of crap for handling terminals that haven't been seen outside a
    museum for 50 years, long before Linux was conceived. Trying to get the

    Unfortunately terminals are complex beasts with many permutations though
    all that should be a higher level that what you were doing with a UART.


    Agreed. It is bad design to mix terminal handling with UART handling.

    Even better, of course, is to ditch C and use Python - "pyserial" does
    it all, simply and cleanly. (And the same code works on Windows, if

    The problem with pyserial is you have to use Python. Horrible language
    though like BASIC, useful for teaching kids to code.


    Let's just say, opinions differ. Python /can/ be used for beginner
    programmers - but it is also an excellent language for many real tasks.
    Of course it has its weaknesses and disadvantages as well as its
    strengths, and aspects that will appeal to some programmers and not others.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to John Ames on Wed Aug 21 21:18:38 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 21/08/2024 17:37, John Ames wrote:
    Yes, books can be wrong, and yes, community fora can have valuable information - but there really is no substitute for a good manual, in
    print or otherwise. StackOverflow is very useful for clearing up some
    kinds of esoteric-yet-common questions, but if you just need to double-
    check what the legal values for parameter X in function Y are, it's
    much quicker (and usually less error-prone) to turn to a reference
    guide than it is to go poking around looking for records of times in
    history where someone else might've had the same question.

    (Doubly so, now that Google is as friggin' useless as it's gotten the
    last few years.)


    I do like a good manual, whether it be a physical book or an online
    manual. So I am not objecting to reading them, learning from them, or
    using them as references.

    I am just objecting to the concept that reading particular books is
    somehow "required" in order to write "useful C" or "program for Linux".
    They are neither necessary nor sufficient, especially when picking one
    or two particular books.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to David Brown on Wed Aug 21 23:43:22 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Wed, 21 Aug 2024 11:11:46 +0200, David Brown wrote:

    On 21/08/2024 09:38, Lawrence D'Oliveiro wrote:

    On Wed, 21 Aug 2024 09:26:41 +0200, David Brown wrote:

    And you don't need to know anything about Linux, UNIX or POSIX to
    program in C.

    I think the point has been made on comp.lang.c more than once, that C
    without POSIX can be a very dull language indeed ...

    It was wrong on comp.lang.c, and it is wrong here. Proof by repeated assertion is not valid.

    It came up repeatedly because of repeated examples where it was true.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Dmitry A. Kazakov on Wed Aug 21 23:42:02 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Wed, 21 Aug 2024 10:07:47 +0200, Dmitry A. Kazakov wrote:

    On 2024-08-21 02:59, Lawrence D'Oliveiro wrote:

    On Tue, 20 Aug 2024 10:27:01 +0200, Dmitry A. Kazakov wrote:

    The question is sustainability in long term.

    In the long term, proprietary software is in retreat, while Free
    software is on the rise. So it’s quite clear which one is more
    “sustainable”.

    I mean economic sustainability.

    So did I.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Kalevi Kolttonen on Wed Aug 21 23:42:54 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Wed, 21 Aug 2024 08:45:41 -0000 (UTC), Kalevi Kolttonen wrote:

    I have never owned Commodore Amiga and I have no knowledge about its C compilers or the related documentation.

    The programming documentation was always readily available, as I recall. Commodore’s number-one priority was to get developers to develop apps for their platform.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From D@21:1/5 to Muttley@dastardlyhq.com on Thu Aug 22 09:52:24 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Thu, 22 Aug 2024, Muttley@dastardlyhq.com wrote:

    On Wed, 21 Aug 2024 21:15:14 +0200
    David Brown <david.brown@hesbynett.no> boringly babbled:
    On 21/08/2024 17:40, Muttley@dastardlyhq.com wrote:
    The problem with pyserial is you have to use Python. Horrible language
    though like BASIC, useful for teaching kids to code.


    Let's just say, opinions differ. Python /can/ be used for beginner

    Yes, its ultimately subjective. The reasons I don't like it are that I can't stand dynamic typing in supposed "proper" languages and the syntatically meaningful whitespace nonsense they took from Occam really grinds my gears. In my current job I'm forced to use it but I'd never do it out of choice.

    programmers - but it is also an excellent language for many real tasks.
    Of course it has its weaknesses and disadvantages as well as its
    strengths, and aspects that will appeal to some programmers and not others.

    IMO its fine for small scripts up to maybe a few hundred lines. Beyond that no.


    I liked python in the beginning, but I find that over the years, it has
    become worse. My biggest complaint is dependency management and that you
    have to download so many things in order to get a modern project to work.

    On the other hand, I'm not a programmer, so I'm probably doing it wrong or
    not accordin to best practices by not using containers for all my python
    stuff.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Muttley@dastardlyhq.com@21:1/5 to All on Thu Aug 22 07:42:08 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Wed, 21 Aug 2024 21:15:14 +0200
    David Brown <david.brown@hesbynett.no> boringly babbled:
    On 21/08/2024 17:40, Muttley@dastardlyhq.com wrote:
    The problem with pyserial is you have to use Python. Horrible language
    though like BASIC, useful for teaching kids to code.


    Let's just say, opinions differ. Python /can/ be used for beginner

    Yes, its ultimately subjective. The reasons I don't like it are that I can't stand dynamic typing in supposed "proper" languages and the syntatically meaningful whitespace nonsense they took from Occam really grinds my gears.
    In my current job I'm forced to use it but I'd never do it out of choice.

    programmers - but it is also an excellent language for many real tasks.
    Of course it has its weaknesses and disadvantages as well as its
    strengths, and aspects that will appeal to some programmers and not others.

    IMO its fine for small scripts up to maybe a few hundred lines. Beyond that
    no.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Muttley@dastardlyhq.com on Thu Aug 22 10:10:18 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 22/08/2024 09:42, Muttley@dastardlyhq.com wrote:
    On Wed, 21 Aug 2024 21:15:14 +0200
    David Brown <david.brown@hesbynett.no> boringly babbled:
    On 21/08/2024 17:40, Muttley@dastardlyhq.com wrote:
    The problem with pyserial is you have to use Python. Horrible language
    though like BASIC, useful for teaching kids to code.


    Let's just say, opinions differ. Python /can/ be used for beginner

    Yes, its ultimately subjective. The reasons I don't like it are that I can't stand dynamic typing in supposed "proper" languages and the syntatically meaningful whitespace nonsense they took from Occam really grinds my gears. In my current job I'm forced to use it but I'd never do it out of choice.


    Dynamic typing has its advantages and disadvantages. You do lose a lot
    of human checking and static checking when you have dynamic typing, but
    you gain flexibility. Have you tried using type annotations in Python?
    For some code it can give a reasonable compromise, letting you have at
    least some control of types while also being flexible where you want.

    I am a big fan of clear and consistent layout and indentation, which is
    forced on you by Python (and Occam), but I too prefer explicit blocking.
    It's harder to get things wrong with explicit blocking, and you are
    never faced with space vs. tab conflicts causing semantic changes to the
    code.

    programmers - but it is also an excellent language for many real tasks.
    Of course it has its weaknesses and disadvantages as well as its
    strengths, and aspects that will appeal to some programmers and not others.

    IMO its fine for small scripts up to maybe a few hundred lines. Beyond that no.


    Oh, it's fine for /far/ bigger programs than that. But it is excellent
    for small scripts and utilities.

    Like any language, you need discipline and to work in a way that suits
    the language. If you approach Python coding as though it were C, or
    vice versa, you'll make a mess.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Muttley@dastardlyhq.com@21:1/5 to All on Thu Aug 22 08:21:29 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Thu, 22 Aug 2024 10:10:18 +0200
    David Brown <david.brown@hesbynett.no> boringly babbled:
    On 22/08/2024 09:42, Muttley@dastardlyhq.com wrote:
    Yes, its ultimately subjective. The reasons I don't like it are that I can't >> stand dynamic typing in supposed "proper" languages and the syntatically
    meaningful whitespace nonsense they took from Occam really grinds my gears. >> In my current job I'm forced to use it but I'd never do it out of choice.


    Dynamic typing has its advantages and disadvantages. You do lose a lot
    of human checking and static checking when you have dynamic typing, but
    you gain flexibility. Have you tried using type annotations in Python?

    No, i'll look into it, thanks.

    I am a big fan of clear and consistent layout and indentation, which is >forced on you by Python (and Occam), but I too prefer explicit blocking.
    It's harder to get things wrong with explicit blocking, and you are

    Indeed. You delete a bracket by mistake and it won't compile, end of. In
    Python you can delete a spaces/tabs by mistake and if its at the end of the block the thing could still run.

    never faced with space vs. tab conflicts causing semantic changes to the >code.

    Yes, this is a royal PITA. I use tabs as in vim I can instantly change the indentation using "set ts=". With spaces its fixed short of dicking about
    with macros.

    IMO its fine for small scripts up to maybe a few hundred lines. Beyond that >> no.


    Oh, it's fine for /far/ bigger programs than that. But it is excellent

    As you said, opinions may differ.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Muttley@dastardlyhq.com@21:1/5 to All on Thu Aug 22 08:18:20 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Thu, 22 Aug 2024 09:52:24 +0200
    D <nospam@example.net> boringly babbled:
    On Thu, 22 Aug 2024, Muttley@dastardlyhq.com wrote:
    programmers - but it is also an excellent language for many real tasks.
    Of course it has its weaknesses and disadvantages as well as its
    strengths, and aspects that will appeal to some programmers and not others. >>
    IMO its fine for small scripts up to maybe a few hundred lines. Beyond that >> no.


    I liked python in the beginning, but I find that over the years, it has >become worse. My biggest complaint is dependency management and that you
    have to download so many things in order to get a modern project to work.

    Yes, that appears to be a big issue these days. On a project I was working
    on recently the version of Pandas (stupid name but thats python libs) had
    some minor bug and to update Pandas we had to update just about everything
    else as well.

    On the other hand, I'm not a programmer, so I'm probably doing it wrong or >not accordin to best practices by not using containers for all my python >stuff.

    For a properly designed language a container shouldn't be required. Using
    a container to prevent library hell is like seeing a mess on your floor but instead of clearing the mess you sweep it into seperate piles depending on
    the type of rubbish. With C/C++ you can set LD_LIBRARY_PATH to use particular shared object files but doing something similar with Python AFAIK is a hell of a task.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to David Brown on Thu Aug 22 09:02:08 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Thu, 22 Aug 2024 10:10:18 +0200, David Brown wrote:

    I am a big fan of clear and consistent layout and indentation, which is forced on you by Python (and Occam), but I too prefer explicit blocking.
    It's harder to get things wrong with explicit blocking, and you are
    never faced with space vs. tab conflicts causing semantic changes to the code.

    Python prohibits those space/tab inconsistencies.

    Nevertheless, I don’t like the loss of redundancy in the way code
    structure is expressed, which is why I like to put in “#end” comments.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to All on Thu Aug 22 11:09:39 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 22/08/2024 09:52, D wrote:

    I liked python in the beginning, but I find that over the years, it has become worse. My biggest complaint is dependency management and that you
    have to download so many things in order to get a modern project to work.


    I agree that can be a poor point.

    Dependency management for languages is a complex beast. It can often
    make it easy to get hold of libraries, or update versions - but it can
    be very hard to keep consistency and get old versions. Most dependency management is strongly based on the idea that you have the latest
    version of the language, and want the latest version of the libraries,
    and that is not always true. This can be a real pain for long-running projects.

    This is not a Python-specific issue, IME. I think it applies to many or
    most languages and systems with dependency and library management tools.
    I certainly see it all the time for C and C++ using microcontroller manufacturers' SDK's and libraries.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Lawrence D'Oliveiro on Thu Aug 22 12:47:16 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 22/08/2024 11:02, Lawrence D'Oliveiro wrote:
    On Thu, 22 Aug 2024 10:10:18 +0200, David Brown wrote:

    I am a big fan of clear and consistent layout and indentation, which is
    forced on you by Python (and Occam), but I too prefer explicit blocking.
    It's harder to get things wrong with explicit blocking, and you are
    never faced with space vs. tab conflicts causing semantic changes to the
    code.

    Python prohibits those space/tab inconsistencies.


    No, it does not. Python treats tabs (at the start of lines, which is
    the only relevant point here) as 8 spaces by default. You can change
    that with command-line flags if you want. But it is quite happy with
    mixtures of tabs and spaces as long as the result after tab-to-space
    conversion is consistent with Python syntax.

    So if you have an editor set to 8-space tabs, you can mix spaces and
    tabs freely, and Python will treat your code exactly as it appears. If,
    as many people do, you have an editor with 4-space tabs then mixing tabs
    and spaces will risk strange effects. In some cases, Python can see it
    as inconsistent indentation. In other cases, you might get indentation
    that is valid Python syntax but not what the programmer saw in the editor:

    if cond :
    doThis() # 8 spaces
    doThat() # One tab

    An editor that sees the tab as 4 spaces will show a very different
    picture from Python that treats it as 8 spaces.

    Nevertheless, I don’t like the loss of redundancy in the way code
    structure is expressed, which is why I like to put in “#end” comments.

    I would not recommend that. But I think it makes sense to add a
    "return" at the end of functions if they otherwise end in indentations,
    to give a clear ending to the function definition. That is vastly
    better than an "# end" comment because it is checked for Python syntax
    and correct (or at least plausible) indentation. If you need an end
    marker for other blocks, "pass" is your friend - again it is better than
    a comment.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Lawrence D'Oliveiro on Thu Aug 22 13:00:27 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 22/08/2024 01:43, Lawrence D'Oliveiro wrote:
    On Wed, 21 Aug 2024 11:11:46 +0200, David Brown wrote:

    On 21/08/2024 09:38, Lawrence D'Oliveiro wrote:

    On Wed, 21 Aug 2024 09:26:41 +0200, David Brown wrote:

    And you don't need to know anything about Linux, UNIX or POSIX to
    program in C.

    I think the point has been made on comp.lang.c more than once, that C
    without POSIX can be a very dull language indeed ...

    It was wrong on comp.lang.c, and it is wrong here. Proof by repeated
    assertion is not valid.

    It came up repeatedly because of repeated examples where it was true.

    It takes but one single counter-example to invalidate general claims
    like this. And for almost the entire branch of small-systems embedded programming, code is mostly written in C, POSIX is utterly irrelevant,
    and the work is not dull.

    Then there are those that - wisely or unwisely - program in C for
    Windows, without POSIX.

    Then there are those that program in C and use libraries, abstractions
    or other layers between their own code and the underlying POSIX systems.

    Then there are those that write portable C code that does not depend on
    any OS at all.

    I have no statistics, but I'd imagine that it's actually only a small
    fraction of C programmers that have direct regular contact with POSIX in
    most of their regular work. C coding is not usually about how you
    access a file, or how you start a thread - it's about what you do with
    the file contents and the code that runs in the thread.

    So - you are still wrong, even if others have said the same thing as you
    did.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Scott Lurndal@21:1/5 to Sebastian on Wed Aug 28 13:57:11 2024
    XPost: comp.unix.shell, comp.unix.programmer

    Sebastian <sebastian@here.com.invalid> writes:
    In comp.unix.programmer Richard Kettlewell <invalid@invalid.invalid> wrote:
    Bart <bc@freeuk.com> writes:
    On 27/08/2024 09:39, Richard Kettlewell wrote:

    The fact that people have to resort to adding #end lines, which only
    partly deals with one or two of those problems, suggest that something
    is badly wrong.

    I?ve never encountered anyone else doing that in Python. It suggests
    more than the individual doing that just doesn?t like the language, in
    which case I?d just suggest that person doesn?t use it.

    I think it's a great idea. I'm considering asking my team to start adding >#end comments to our codebase.

    I think you're a L'D'O sockpuppet.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Bart@21:1/5 to John Ames on Wed Aug 28 16:41:07 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 28/08/2024 16:25, John Ames wrote:
    On Wed, 28 Aug 2024 02:48:59 -0000 (UTC)
    Sebastian <sebastian@here.com.invalid> wrote:

    At my company, somebody tried to delete a method like method2() above,
    but forgot the last few lines (represented by call6()). This does
    not introduce a SyntaxError. Instead, call6() is now part of method1()
    because it's at the same level of indentation. In most programming
    languages, the beginning of method2() would be preceded by some
    delimiter marking the end of method1(), which would prevent an
    accidental merger of this type.

    (Waiting for the Python advocates to fire back with "well, don't do
    that, then!" and completely miss the point that it's exactly the topic
    of contention here that Python's scope-by-layout approach that makes it
    easy to do that...)


    Or they will say that whoever deleted method2 could also have deleted
    that 'end' line if one was used. Whilst also forgetting to delete
    method2's own 'end' line.

    Or maybe they deleted method2 plus both the preceding and succeeding
    lines so that method1 merges into method3.

    Generally, they might point all the ways that such oversights and all
    kinds of other typos can result in still-valid code in any language. But fragile syntax like Python's just makes it so easier to do that.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Richard Kettlewell@21:1/5 to John Ames on Wed Aug 28 16:41:36 2024
    XPost: comp.unix.shell, comp.unix.programmer

    John Ames <commodorejohn@gmail.com> writes:
    Sebastian <sebastian@here.com.invalid> wrote:

    At my company, somebody tried to delete a method like method2()
    above, but forgot the last few lines (represented by call6()). This
    does not introduce a SyntaxError. Instead, call6() is now part of
    method1() because it's at the same level of indentation. In most
    programming languages, the beginning of method2() would be preceded
    by some delimiter marking the end of method1(), which would prevent
    an accidental merger of this type.

    (Waiting for the Python advocates to fire back with "well, don't do
    that, then!" and completely miss the point that it's exactly the topic
    of contention here that Python's scope-by-layout approach that makes it
    easy to do that...)

    Earlier I wrote:

    | (In contrast C’s rules have occasionally been a practical problem,
    | contributing to at least one high-profile software vulnerability and
    | attracting compiler warnings to mitigate the risks.)

    The situation seems pretty similar. In any language if you delete the
    wrong thing then you probably won’t like the outcome. In both cases if
    it’s not quickly detected by unit tests or some other automation then
    it’s probably time to review your approach to quality.

    --
    https://www.greenend.org.uk/rjk/

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Bart on Wed Aug 28 18:23:31 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 28/08/2024 17:41, Bart wrote:
    On 28/08/2024 16:25, John Ames wrote:
    On Wed, 28 Aug 2024 02:48:59 -0000 (UTC)
    Sebastian <sebastian@here.com.invalid> wrote:

    At my company, somebody tried to delete a method like method2() above,
    but forgot the last few lines (represented by call6()). This does
    not introduce a SyntaxError. Instead, call6() is now part of method1()
    because it's at the same level of indentation. In most programming
    languages, the beginning of method2() would be preceded by some
    delimiter marking the end of method1(), which would prevent an
    accidental merger of this type.

    (Waiting for the Python advocates to fire back with "well, don't do
    that, then!" and completely miss the point that it's exactly the topic
    of contention here that Python's scope-by-layout approach that makes it
    easy to do that...)


    Or they will say that whoever deleted method2 could also have deleted
    that 'end' line if one was used. Whilst also forgetting to delete
    method2's own 'end' line.

    Or maybe they deleted method2 plus both the preceding and succeeding
    lines so that method1 merges into method3.

    Generally, they might point all the ways that such oversights and all
    kinds of other typos can result in still-valid code in any language. But fragile syntax like Python's just makes it so easier to do that.


    Having overly-large functions in any language is a risky way to code.
    Deleting large chunks of a function is risky in any language. Failing
    to have check in place (like automated tests) that catch the error
    fairly quickly is also risky in any language.

    But it is fair to say, I think, that Python's space-sensitive syntax
    combined with limited static checking (even with tools like pylint) mean
    you are more likely to be able to make a mistake that is not spotted
    until later in testing, compared to languages with explicit block
    delimiters.

    And it is made worse by Python common practice of defining all methods
    of a class inline in the class, leading to long stretches of code that
    is all indented at least one tabstop. It is possible to add methods to
    a class later on - optionally after giving a placeholder, but it is not
    common practice (as far as I have seen) :

    class A :
    def __init__(self) :
    self.x = 10
    def foo(self) :
    "Increment x"
    self.x = self.x + 1
    return self.x
    def foobar(self) :
    "Complicated action"
    raise NotImplementedError

    def A_foobar(self) :
    self.x = self.x * 10
    return self.x

    A.foobar = A_foobar


    (I'm sure a decorator could be used to make this slightly neater.)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Muttley@dastardlyhq.com@21:1/5 to Keith Thompson on Wed Aug 28 17:48:57 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Tue, 27 Aug 2024 14:49:19 -0700
    Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:
    I do the same in Python. The difference is that in Python the
    indentation is the single source of truth about program structure,

    Sadly.

    while in other languages it's a matter of convention.

    https://en.wikipedia.org/wiki/Single_source_of_truth

    That reads like the sort of pseudo philosphical gasbagging beloved of a
    certain type of ivory tower university lecturer who would probably last 2 days in a commercial IT enviroment.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Muttley@dastardlyhq.com@21:1/5 to Lawrence D'Oliveiro on Wed Aug 28 17:43:44 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Tue, 27 Aug 2024 21:34:54 -0000 (UTC)
    Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
    On Tue, 27 Aug 2024 11:26:18 +0100, Bart wrote:

    (2) You want to temporarily comment out an 'if' line so that the
    following block is unconditional. You can't do that with also
    unindenting the block.

    In Emacs, I have commands defined to adjust the indentation of the
    selected region. Surely any other decent editor would offer the same.

    Writing editor editor macros in order to work around fundamentally bad
    language design is not something a programmer should have to waste time on.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Muttley@dastardlyhq.com on Wed Aug 28 20:48:08 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 28/08/2024 19:43, Muttley@dastardlyhq.com wrote:
    On Tue, 27 Aug 2024 21:34:54 -0000 (UTC)
    Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
    On Tue, 27 Aug 2024 11:26:18 +0100, Bart wrote:

    (2) You want to temporarily comment out an 'if' line so that the
    following block is unconditional. You can't do that with also
    unindenting the block.

    In Emacs, I have commands defined to adjust the indentation of the
    selected region. Surely any other decent editor would offer the same.

    Writing editor editor macros in order to work around fundamentally bad language design is not something a programmer should have to waste time on.



    I don't know about Emacs, but in most editors the way you indent a block
    of code is to select the lines, then press "Tab". Unindenting is
    "shift-Tab". Changing tabs to spaces or spaces to tabs is done by
    selecting "Tabs to spaces" from the Edit menu, or something equally
    simple and obvious. Many editor can be set to convert tabs to spaces
    (or vice versa) when saving files, perhaps specific to the file type (so
    you don't muck up your makefiles).

    It takes a special kind of genius to be able to program, and yet still
    have trouble with this kind of thing.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Bart@21:1/5 to David Brown on Wed Aug 28 20:27:53 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 28/08/2024 19:48, David Brown wrote:
    On 28/08/2024 19:43, Muttley@dastardlyhq.com wrote:
    On Tue, 27 Aug 2024 21:34:54 -0000 (UTC)
    Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
    On Tue, 27 Aug 2024 11:26:18 +0100, Bart wrote:

    (2) You want to temporarily comment out an 'if' line so that the
    following block is unconditional. You can't do that with also
    unindenting the block.

    In Emacs, I have commands defined to adjust the indentation of the
    selected region. Surely any other decent editor would offer the same.

    Writing editor editor macros in order to work around fundamentally bad
    language design is not something a programmer should have to waste
    time on.



    I don't know about Emacs, but in most editors the way you indent a block
    of code is to select the lines, then press "Tab".  Unindenting is "shift-Tab".  Changing tabs to spaces or spaces to tabs is done by
    selecting "Tabs to spaces" from the Edit menu, or something equally
    simple and obvious.  Many editor can be set to convert tabs to spaces
    (or vice versa) when saving files, perhaps specific to the file type (so
    you don't muck up your makefiles).

    It takes a special kind of genius to be able to program, and yet still
    have trouble with this kind of thing.

    The main problem isn't in changing the indentation of a block of code;
    it is in HAVING to do so because of poor language design. A lesser one
    is having to rely on whatever varied features that 100s of different
    editors may have to do so.

    And yet another, of more significance, if that after you've indented a
    block, it may now merge into an adjacent block that was already at that
    new indent. If you later need to revert that first block back to it's
    original position, you'd better make sure you mark that boundary.

    It is a language design issue pure and simple. Don't try and pin it on
    the users and make out it's due to lack of expertise with their editors.
    Of course we can all indent blocks; it's just an unnecessary palaver.

    Clearly your point of view is as a language /user/ where languages and
    their characteristics are an invariant that you can't do anything about,
    can't change, and need to work around.

    But some of us devise (and, importanly, implement) languages of our own
    and can be more vocal about misfeatures in others.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Bart@21:1/5 to Keith Thompson on Wed Aug 28 21:44:56 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 28/08/2024 21:37, Keith Thompson wrote:
    Bart <bc@freeuk.com> writes:
    On 28/08/2024 19:48, David Brown wrote:
    On 28/08/2024 19:43, Muttley@dastardlyhq.com wrote:
    On Tue, 27 Aug 2024 21:34:54 -0000 (UTC)
    Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
    On Tue, 27 Aug 2024 11:26:18 +0100, Bart wrote:

    (2) You want to temporarily comment out an 'if' line so that the
    following block is unconditional. You can't do that with also
    unindenting the block.

    In Emacs, I have commands defined to adjust the indentation of the
    selected region. Surely any other decent editor would offer the same. >>>>
    Writing editor editor macros in order to work around fundamentally bad >>>> language design is not something a programmer should have to waste
    time on.


    I don't know about Emacs, but in most editors the way you indent a
    block of code is to select the lines, then press "Tab".  Unindenting
    is "shift-Tab".  Changing tabs to spaces or spaces to tabs is done
    by selecting "Tabs to spaces" from the Edit menu, or something
    equally simple and obvious.  Many editor can be set to convert tabs
    to spaces (or vice versa) when saving files, perhaps specific to the
    file type (so you don't muck up your makefiles).
    It takes a special kind of genius to be able to program, and yet
    still have trouble with this kind of thing.

    The main problem isn't in changing the indentation of a block of code;
    it is in HAVING to do so because of poor language design. A lesser one
    is having to rely on whatever varied features that 100s of different
    editors may have to do so.

    And yet another, of more significance, if that after you've indented a
    block, it may now merge into an adjacent block that was already at
    that new indent. If you later need to revert that first block back to
    it's original position, you'd better make sure you mark that boundary.

    It is a language design issue pure and simple. Don't try and pin it on
    the users and make out it's due to lack of expertise with their
    editors. Of course we can all indent blocks; it's just an unnecessary
    palaver.

    Clearly your point of view is as a language /user/ where languages and
    their characteristics are an invariant that you can't do anything
    about, can't change, and need to work around.

    But some of us devise (and, importanly, implement) languages of our
    own and can be more vocal about misfeatures in others.

    If I'm moving chunks of code around in a C or C++ program, from one
    scope to another, I can get away with leaving the indentation as it is, because all the compiler cares about is where the braces are. But I
    *always* adjust the indentation to fit the code's new context.

    Python's use of indentation to indicate scoping just means that I have
    to do what I would have done anyway.

    If you glance at the top you will see that my original example involved /temparily/ commenting out the 'if' part of a conditional block. Another example was in temporarily /adding/ an 'if' around a block. And yet
    another (you might want to see my original longer post) was in adding in temporary code but deliberately not using the right indent to make it
    more visible.

    You don't want to waste time getting the layout exactly right and then
    also risk that block disappearing into neighbouring code because
    everything is now at the same indent level.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Andy Walker@21:1/5 to Bart on Wed Aug 28 23:07:11 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 27/08/2024 15:18, Bart wrote:
    [Previous discussion and code snipped -- ANW]
    This was an attempt to port an benchmark into Nim; I'd spent the
    best part of an hour trying to get it right, but it kept going
    wrong. In the end I resorted to artificial block terminators.
    The final code looked like that below. Now it is much, much easier
    to see what goes where, and what belongs to what. I can more
    confidently write that extra statement following the opening 'if'.
    With these changes, the porting went much more smooothly.
            if q1!=1:
                for i in countup(2,n):
                    q[i]=p[i]
    #           end
                flips=1
                while true:
                    qq=q[q1]
                    if qq==1:
                        sum+=sign*flips
                        if flips>maxflips:
                            maxflips=flips #                   end
                        break
    #               end
                    q[q1]=q1
                    if q1>=4:
                        i=2
                        j=q1-1
                        while true:
                            t=q[i]
                            q[i]=q[j]
                            q[j]=t
                            i+=1
                            j-=1
                            if i>=j:
                                break #                       end #                   end
    #               end
                    q1=qq
                    flips+=1
    #           end
    #       end
    Sure, people CAN program in such languages, but it is harder work> and more error prone.

    ISTM that the difficulty in reading and writing code like that
    stems not from the indentation, but
    from a
    long narrow
    corridor
    of program
    which is
    difficult to
    read
    and write
    no matter how
    it is indented.
    Variable indentation
    merely
    makes the long
    column wriggly.
    It reminds me of the early autocodes, before the days of block structure.
    I don't know Nim [and only a little of Python], so I can't apportion the difficulty of understanding the code between the language and the chosen programming style. But I can't resist adding a few comments:

    (a) Bart takes 14 lines [from "if q1>=4" to the corresponding "# end"]
    to express the notion [E&OE]

    for i from 2 to q1%2
    swap (q[i], q[q1 - i + 1])

    Small wonder that he found the code hard to get right!

    (b) There are two occurrences of "while true" and two of "break" in the
    code which would not be necessary or appropriate in C or Algol [amongst others]. Again, IMO these contribute to the obscurity of the code.

    (c) I recognise that code as coming from a version of the "Fannkuch" benchmark, so I already have it in C and in Algol 68G. Bart's Nim code
    is substantially longer [around twice the length of the A68G]. Brevity
    is not everything, but if you are forever scrolling from one window to
    the next while your friend gets it all into one window [without losing
    clarity of expression], then guess who is going to find it easier to
    read, write and understand the code.

    (d) Further, if the code is harder to understand, it has more need of explanatory comments, which in turn make the code longer, so harder to
    navigate around.

    --
    Andy Walker, Nottingham.
    Andy's music pages: www.cuboid.me.uk/andy/Music
    Composer of the day: www.cuboid.me.uk/andy/Music/Composers/Hertel

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Keith Thompson on Wed Aug 28 23:02:45 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Wed, 28 Aug 2024 13:29:18 -0700, Keith Thompson wrote:

    But ok, I found your post and removed all the #end comments. I found it
    just as readable without them as with them.

    You know what? You are right. That example was just too
    well-structured.

    Here’s a more dangerous one:

    def register_additional_standard(self, **kwargs) :
    "registers additional standard interfaces that are not automatically" \
    " installed at Connection creation time. Currently the only one is" \
    " the object-manager interface, registered with\n" \
    "\n" \
    " «conn».register_additional_standard(managed_objects = True)\n"
    for key in kwargs :
    if kwargs[key] :
    if key == "managed_objects" :
    if self._managed_objects != None :
    raise asyncio.InvalidStateError \
    (
    "object manager interface already registered"
    )
    #end if
    self.register \
    (
    path = "/",
    interface = ManagedObjectsHandler(),
    fallback = True
    )
    self._managed_objects = {}
    else :
    raise TypeError("unrecognized argument keyword “%s”" % key)
    #end if
    #end if
    #end for
    return \
    self
    #end register_additional_standard

    versus

    def register_additional_standard(self, **kwargs) :
    "registers additional standard interfaces that are not automatically" \
    " installed at Connection creation time. Currently the only one is" \
    " the object-manager interface, registered with\n" \
    "\n" \
    " «conn».register_additional_standard(managed_objects = True)\n"
    for key in kwargs :
    if kwargs[key] :
    if key == "managed_objects" :
    if self._managed_objects != None :
    raise asyncio.InvalidStateError \
    (
    "object manager interface already registered"
    )
    self.register \
    (
    path = "/",
    interface = ManagedObjectsHandler(),
    fallback = True
    )
    self._managed_objects = {}
    else :
    raise TypeError("unrecognized argument keyword “%s”" % key)
    return self

    I was looking for quite a tricky example I remember seeing on the
    ArjanCodes channel on YouTube, but I can’t find it.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to David Brown on Wed Aug 28 22:49:55 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Wed, 28 Aug 2024 12:45:40 +0200, David Brown wrote:

    If you have some code that needs a lot of documentation (and some does),
    then put the comments in a place that does not interfere with reading
    and understanding the code.

    Put them next to the code they’re helping you read and understand.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Bart on Wed Aug 28 22:49:04 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Wed, 28 Aug 2024 20:27:53 +0100, Bart wrote:

    The main problem isn't in changing the indentation of a block of code;
    it is in HAVING to do so because of poor language design.

    If you think the need for refactoring is something that can be solved by “language design”, I’d like to hear how.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Bart@21:1/5 to Andy Walker on Thu Aug 29 00:15:39 2024
    On 28/08/2024 23:07, Andy Walker wrote:
    On 27/08/2024 15:18, Bart wrote:
    [Previous discussion and code snipped -- ANW]
    This was an attempt to port an benchmark into Nim; I'd spent the
    best part of an hour trying to get it right, but it kept going
    wrong. In the end I resorted to artificial block terminators.
    The final code looked like that below. Now it is much, much easier
    to see what goes where, and what belongs to what. I can more
    confidently write that extra statement following the opening 'if'.
    With these changes, the porting went much more smooothly.
             if q1!=1:
                 for i in countup(2,n):
                     q[i]=p[i]
    #           end
                 flips=1
                 while true:
                     qq=q[q1]
                     if qq==1:
                         sum+=sign*flips
                         if flips>maxflips:
                             maxflips=flips
    #                   end
                         break
    #               end
                     q[q1]=q1
                     if q1>=4:
                         i=2
                         j=q1-1
                         while true:
                             t=q[i]
                             q[i]=q[j]
                             q[j]=t
                             i+=1
                             j-=1
                             if i>=j:
                                 break
    #                       end
    #                   end
    #               end
                     q1=qq
                     flips+=1
    #           end
    #       end
    Sure, people CAN program in such languages, but it is harder work> and
    more error prone.

        ISTM that the difficulty in reading and writing code like that
    stems not from the indentation, but
            from a
              long narrow
                corridor
                of program
              which is
                difficult to
                read
                and write
                no matter how
                  it is indented.
            Variable indentation
              merely
              makes the long
              column wriggly.
    It reminds me of the early autocodes, before the days of block structure.
    I don't know Nim [and only a little of Python], so I can't apportion the difficulty of understanding the code between the language and the chosen programming style.  But I can't resist adding a few comments:

      (a) Bart takes 14 lines [from "if q1>=4" to the corresponding "# end"]
    to express the notion [E&OE]

        for i from 2 to q1%2
           swap (q[i], q[q1 - i + 1])

    Small wonder that he found the code hard to get right!

      (b) There are two occurrences of "while true" and two of "break" in the code which would not be necessary or appropriate in C or Algol [amongst others].  Again, IMO these contribute to the obscurity of the code.

      (c) I recognise that code as coming from a version of the "Fannkuch" benchmark, so I already have it in C and in Algol 68G.  Bart's Nim code
    is substantially longer [around twice the length of the A68G].  Brevity
    is not everything, but if you are forever scrolling from one window to
    the next while your friend gets it all into one window [without losing clarity of expression], then guess who is going to find it easier to
    read, write and understand the code.

    This is the only example of my own where #end was used. Doubtless there
    will be real-life code in existence having 7 lines in a block (the body
    of that loop) is justified.


      (d) Further, if the code is harder to understand, it has more need of explanatory comments, which in turn make the code longer, so harder to navigate around.

    The style is one statement per line, especially in Nim and Python where multiple statements per line looks unnatural.

    I have a dozen versions in different languages, most of them derived
    from a version in Lua. There, the loop you mentioned appears like this:

    local i, j = 2, q1 - 1
    repeat q[i], q[j] = q[j], q[i]; i = i + 1; j = j - 1; until i >= j

    Only two lines, so no cause for complaint there! The version in my
    language looks like this:

    i:=2; j:=q1-1
    repeat
    swap(q[i++], q[j--])
    until i>=j

    Since one intent was to compare runtime across languages, I tried to
    keep the algorithm identical.

    This is the Algol68 (A68G) equivalent:

    i:=2; j:=q1-1;
    WHILE
    t:=q[i]; q[i]:=q[j]; q[j]:=t;
    i+:=1;
    j-:=1;
    i<j
    DO SKIP OD

    Here, the bugbear was getting the semicolons right. And letter case.

    (See https://github.com/sal55/langs/blob/master/fannkuch.txt.)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Bart@21:1/5 to Lawrence D'Oliveiro on Thu Aug 29 00:21:43 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 28/08/2024 23:49, Lawrence D'Oliveiro wrote:
    On Wed, 28 Aug 2024 20:27:53 +0100, Bart wrote:

    The main problem isn't in changing the indentation of a block of code;
    it is in HAVING to do so because of poor language design.

    If you think the need for refactoring is something that can be solved by “language design”, I’d like to hear how.

    The aim is to not NEED refactoring when you are playing around with
    different, short-term bits of code.

    Requiring letter-case that is exactly right plus indentation that is
    exactly right, plus requiring you to choose between spaces and tabs
    (plus requiring endless 'imports' to added for standard language
    features), is just a nuisance.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kaz Kylheku@21:1/5 to Keith Thompson on Wed Aug 28 23:44:28 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 2024-08-28, Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:
    Bart <bc@freeuk.com> writes:
    On 28/08/2024 19:48, David Brown wrote:
    But some of us devise (and, importanly, implement) languages of our
    own and can be more vocal about misfeatures in others.

    If I'm moving chunks of code around in a C or C++ program, from one
    scope to another, I can get away with leaving the indentation as it is, because all the compiler cares about is where the braces are. But I
    *always* adjust the indentation to fit the code's new context.

    Python's use of indentation to indicate scoping just means that I have
    to do what I would have done anyway.

    In a language with brackets or braces, the indentation can adjust itself
    for you.

    The proof of concept for this is the "parinfer" algorithm, for Lisp
    languages. Someone came up with this a bunch of years ago and now
    it's fairly widely implemented.

    Parinfer creates a real-time link between indentation and parentheses.

    It can be configured to infer one from the other: you can manually
    control indentation and have parentheses magically appear and disappear
    as needed, or you can control parentheses and have the code indent
    itself.

    Likely, a much more complicated version of the algorithm could work
    for "C likes" and others. Maybe someone has done it by now? No idea.

    There are some animated demos on the original home page, and maybe
    elsewhere:

    https://shaunlebron.github.io/parinfer/

    I use a somewhat poor but usable Vim implementation of this.

    --
    TXR Programming Language: http://nongnu.org/txr
    Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
    Mastodon: @Kazinator@mstdn.ca

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Bart on Thu Aug 29 01:16:24 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Thu, 29 Aug 2024 00:21:43 +0100, Bart wrote:

    On 28/08/2024 23:49, Lawrence D'Oliveiro wrote:

    On Wed, 28 Aug 2024 20:27:53 +0100, Bart wrote:

    The main problem isn't in changing the indentation of a block of code;
    it is in HAVING to do so because of poor language design.

    If you think the need for refactoring is something that can be solved
    by “language design”, I’d like to hear how.

    The aim is to not NEED refactoring when you are playing around with different, short-term bits of code.

    “Playing around” is exactly one of those situations where you will need to do all kinds of things to the code, including refactoring.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Keith Thompson on Thu Aug 29 01:19:45 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Wed, 28 Aug 2024 17:23:25 -0700, Keith Thompson wrote:

    That's not the conventional way to format a docstring. If you're using backslashes to splice lines in Python, it's likely you're doing
    something wrong.

    What exactly is wrong?

    I think "is not None" is more idiomatic.

    When I want an equality comparison, I use “==”, not “is”.

    You don't need the \ if you put the ( on the same line.

    But I do otherwise.

    You leave a space between "else" and ":". It's not wrong, but it's not something I've ever seen.

    People who look at my code tend to get triggered by the little things;
    maybe it’s a way to avoid thinking about the big things?

    In any language, if a block of code is so deeply indented that it's confusing, you should consider refactoring it. (Though that's not
    always the answer.)

    The point being, the same kind of code in a language with explicit
    statement brackets would reach the point of confusion later, rather than sooner.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Muttley@dastardlyhq.com@21:1/5 to David Brown on Thu Aug 29 07:28:58 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Wed, 28 Aug 2024 20:48:08 +0200
    David Brown <david.brown@hesbynett.no> wrote:
    On 28/08/2024 19:43, Muttley@dastardlyhq.com wrote:
    Writing editor editor macros in order to work around fundamentally bad
    language design is not something a programmer should have to waste time on. >>


    I don't know about Emacs, but in most editors the way you indent a block
    of code is to select the lines, then press "Tab". Unindenting is >"shift-Tab". Changing tabs to spaces or spaces to tabs is done by
    selecting "Tabs to spaces" from the Edit menu, or something equally
    simple and obvious. Many editor can be set to convert tabs to spaces
    (or vice versa) when saving files, perhaps specific to the file type (so
    you don't muck up your makefiles).

    It takes a special kind of genius to be able to program, and yet still
    have trouble with this kind of thing.

    Don't be a patronising prick, it doesn't help your argument. Personally I
    have better things to do that figure out some obscure functionality of vim
    to achieve something I shouldn't have to do in the first place if the
    language was designed properly. Thankfully I don't have to use Python much.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Bart@21:1/5 to Lawrence D'Oliveiro on Thu Aug 29 11:49:35 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 29/08/2024 02:16, Lawrence D'Oliveiro wrote:
    On Thu, 29 Aug 2024 00:21:43 +0100, Bart wrote:

    On 28/08/2024 23:49, Lawrence D'Oliveiro wrote:

    On Wed, 28 Aug 2024 20:27:53 +0100, Bart wrote:

    The main problem isn't in changing the indentation of a block of code; >>>> it is in HAVING to do so because of poor language design.

    If you think the need for refactoring is something that can be solved
    by “language design”, I’d like to hear how.

    The aim is to not NEED refactoring when you are playing around with
    different, short-term bits of code.

    “Playing around” is exactly one of those situations where you will need to
    do all kinds of things to the code, including refactoring.


    Here:

    if a == b:
    s1
    return
    s2
    s3

    that return statement is added temporarily for some reason that is not
    relevant to the discussion.

    Real life code would have much busier statements, and the whole thing
    would in the middle of lots of other stuff that can include actual
    return statements.

    The problem is that that line doesn't stand out, when later you have to
    find it to remove it or comment it. It blends into the surrounding code.

    Without the constraints imposed by the language, I could just write it as:

    if a == b:
    s1
    RETURN
    s2
    s3

    NOW it stands out! Of course, I could just do:

    if a == b:
    s1
    return # TEMPORARY RETURN
    s2
    s3

    But this is extra effort that shouldn't be necessary, like adding #end comments. I might for example move that line to a different part of the function, but it might use a different indent level.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Kalevi Kolttonen on Thu Aug 15 23:54:53 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Thu, 15 Aug 2024 19:48:36 -0000 (UTC), Kalevi Kolttonen wrote:

    The last I checked, the O'Reilly Python book is just absolutely
    *MASSIVE*. The language has a huge number of features now ...

    No, it hasn’t. The core language reference spec is only a small fraction
    of, say, the Java language spec.

    It’s just that you can do so many things with Python. And that is down to
    the huge variety of off-the-shelf addon libraries that build on that core language spec. It has to be a strong, very solidly founded core in order
    to be such a versatile basis for these addons, and it is.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kaz Kylheku@21:1/5 to Lawrence D'Oliveiro on Fri Aug 16 01:30:36 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 2024-08-15, Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
    On Thu, 15 Aug 2024 19:48:36 -0000 (UTC), Kalevi Kolttonen wrote:

    The last I checked, the O'Reilly Python book is just absolutely
    *MASSIVE*. The language has a huge number of features now ...

    No, it hasn’t. The core language reference spec is only a small fraction of, say, the Java language spec.

    It’s just that you can do so many things with Python. And that is down to the huge variety of off-the-shelf addon libraries that build on that core language spec. It has to be a strong, very solidly founded core in order
    to be such a versatile basis for these addons, and it is.

    That's idiotic; you're saying that the standard library packages of
    Python are not part of Python, and do not contribute to its size.

    --
    TXR Programming Language: http://nongnu.org/txr
    Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
    Mastodon: @Kazinator@mstdn.ca

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dmitry A. Kazakov@21:1/5 to David Brown on Thu Aug 22 13:30:19 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 2024-08-22 13:00, David Brown wrote:

    Then there are those that - wisely or unwisely - program in C for
    Windows, without POSIX.

    Yes, that is true. There is no reason to use POSIX under Windows,
    whatsoever.

    --
    Regards,
    Dmitry A. Kazakov
    http://www.dmitry-kazakov.de

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From D@21:1/5 to Muttley@dastardlyhq.com on Thu Aug 22 15:11:33 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Thu, 22 Aug 2024, Muttley@dastardlyhq.com wrote:

    On Thu, 22 Aug 2024 09:52:24 +0200
    D <nospam@example.net> boringly babbled:
    On Thu, 22 Aug 2024, Muttley@dastardlyhq.com wrote:
    programmers - but it is also an excellent language for many real tasks. >>>> Of course it has its weaknesses and disadvantages as well as its
    strengths, and aspects that will appeal to some programmers and not others.

    IMO its fine for small scripts up to maybe a few hundred lines. Beyond that >>> no.


    I liked python in the beginning, but I find that over the years, it has
    become worse. My biggest complaint is dependency management and that you
    have to download so many things in order to get a modern project to work.

    Yes, that appears to be a big issue these days. On a project I was working
    on recently the version of Pandas (stupid name but thats python libs) had some minor bug and to update Pandas we had to update just about everything else as well.

    On the other hand, I'm not a programmer, so I'm probably doing it wrong or >> not accordin to best practices by not using containers for all my python
    stuff.

    For a properly designed language a container shouldn't be required. Using
    a container to prevent library hell is like seeing a mess on your floor but instead of clearing the mess you sweep it into seperate piles depending on the type of rubbish. With C/C++ you can set LD_LIBRARY_PATH to use particular shared object files but doing something similar with Python AFAIK is a hell of
    a task.


    Thank you! You make me feel less of an outsider and old timer! ;)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lew Pitcher@21:1/5 to All on Thu Aug 22 13:58:54 2024
    XPost: comp.unix.shell, comp.unix.programmer

    Please forgive my interruption, but something in Muttley's comment needs
    some clarification....

    On Thu, 22 Aug 2024 15:11:33 +0200, D wrote:

    On Thu, 22 Aug 2024, Muttley@dastardlyhq.com wrote:
    [snip]
    For a properly designed language a container shouldn't be required. Using
    a container to prevent library hell is like seeing a mess on your floor but >> instead of clearing the mess you sweep it into seperate piles depending on >> the type of rubbish. With C/C++ you can set LD_LIBRARY_PATH

    1) The ability to alter the loader's library search path isn't a C/C++ feature,
    but, instead, is a feature of the loader, and is applicable to /any/ binary
    that uses "shared objects" ("DLL"s to those who came from a Windows environment).

    2) LD_LIBRARY_PATH is not "the" Unix environment variable that alters the loader's
    library search path. Rather, it is /one flavour/ of such an environment variable.
    Depending on the Unix system, the environment variable can be called:
    LD_LIBRARY_PATH, or
    LIBPATH, or
    SHLIB_PATH, and
    there may be other names that I don't know of.

    to use particular shared object files
    but doing something similar with Python AFAIK is a hell of
    a task.


    Thank you! You make me feel less of an outsider and old timer! ;)




    --
    Lew Pitcher
    "In Skills We Trust"

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Muttley@dastardlyhq.com@21:1/5 to All on Thu Aug 22 14:17:11 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Thu, 22 Aug 2024 13:58:54 -0000 (UTC)
    Lew Pitcher <lew.pitcher@digitalfreehold.ca> boringly babbled:
    Please forgive my interruption, but something in Muttley's comment needs
    some clarification....
    For a properly designed language a container shouldn't be required. Using >>> a container to prevent library hell is like seeing a mess on your floor but >>> instead of clearing the mess you sweep it into seperate piles depending on >>> the type of rubbish. With C/C++ you can set LD_LIBRARY_PATH

    1) The ability to alter the loader's library search path isn't a C/C++ feature,

    but, instead, is a feature of the loader, and is applicable to /any/ binary
    that uses "shared objects" ("DLL"s to those who came from a Windows
    environment).

    Sure, but the vast majority of *nix binaries will have been written in C or C++.

    Depending on the Unix system, the environment variable can be called:
    LD_LIBRARY_PATH, or

    Works on Linux, BSD and Solaris so cover most bases.

    LIBPATH, or
    SHLIB_PATH, and
    there may be other names that I don't know of.

    Point is the path to load dynamic libraries from can be switched very
    easily and requires no changes to the system (other than installing the alternate libs in the first place).

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kaz Kylheku@21:1/5 to Dmitry A. Kazakov on Thu Aug 22 15:28:31 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 2024-08-22, Dmitry A. Kazakov <mailbox@dmitry-kazakov.de> wrote:
    On 2024-08-22 13:00, David Brown wrote:

    Then there are those that - wisely or unwisely - program in C for
    Windows, without POSIX.

    Yes, that is true. There is no reason to use POSIX under Windows,
    whatsoever.

    David also wrote this, in the same comment:

    It takes but one single counter-example to invalidate general claims
    like this.

    It applies to your reply as well.

    There are excellent, excellent reasons to use POSIX under Windows.

    Such as, oh, having an entire POSIX appliation ported to Windows
    almost without lifting a finger.

    For the TXR project I use a POSIX layer called Cygnal (see signature
    below). It gives a decent Windows port which preserves most of the functionality. All the POSIX stuff in the TXR Lisp standard library just
    works. The interactive listener ("REPL") with history and editing just
    works, right in your cmd.exe console.

    --
    TXR Programming Language: http://nongnu.org/txr
    Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
    Mastodon: @Kazinator@mstdn.ca

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Bart@21:1/5 to Kaz Kylheku on Thu Aug 22 16:56:55 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 22/08/2024 16:28, Kaz Kylheku wrote:
    On 2024-08-22, Dmitry A. Kazakov <mailbox@dmitry-kazakov.de> wrote:
    On 2024-08-22 13:00, David Brown wrote:

    Then there are those that - wisely or unwisely - program in C for
    Windows, without POSIX.

    Yes, that is true. There is no reason to use POSIX under Windows,
    whatsoever.

    David also wrote this, in the same comment:

    It takes but one single counter-example to invalidate general claims
    like this.

    It applies to your reply as well.

    There are excellent, excellent reasons to use POSIX under Windows.

    Such as, oh, having an entire POSIX appliation ported to Windows
    almost without lifting a finger.

    For the TXR project I use a POSIX layer called Cygnal (see signature
    below). It gives a decent Windows port which preserves most of the functionality. All the POSIX stuff in the TXR Lisp standard library just works. The interactive listener ("REPL") with history and editing just
    works, right in your cmd.exe console.


    You can use the same argument to justify using X11 under Windows.

    (It's also not clear how well your product manages to use POSIX under
    pure Windows, or whether you have to drag this other thing called 'CygWin'.

    Can you write a normal Windows app and just call into a DLL called
    posix.dll or is there an extra layer or two involved?)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Bart@21:1/5 to Scott Lurndal on Thu Aug 22 17:55:45 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 22/08/2024 17:31, Scott Lurndal wrote:
    Bart <bc@freeuk.com> writes:
    On 22/08/2024 16:28, Kaz Kylheku wrote:


    For the TXR project I use a POSIX layer called Cygnal (see signature
    below). It gives a decent Windows port which preserves most of the
    functionality. All the POSIX stuff in the TXR Lisp standard library just >>> works. The interactive listener ("REPL") with history and editing just
    works, right in your cmd.exe console.



    (It's also not clear how well your product manages to use POSIX under
    pure Windows, or whether you have to drag this other thing called 'CygWin'.

    He specified in the paragraph to which you responded the posix
    interposer he used.


    So this is only indirectly using POSIX under Windows.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Scott Lurndal@21:1/5 to Bart on Thu Aug 22 16:31:16 2024
    XPost: comp.unix.shell, comp.unix.programmer

    Bart <bc@freeuk.com> writes:
    On 22/08/2024 16:28, Kaz Kylheku wrote:


    For the TXR project I use a POSIX layer called Cygnal (see signature
    below). It gives a decent Windows port which preserves most of the
    functionality. All the POSIX stuff in the TXR Lisp standard library just
    works. The interactive listener ("REPL") with history and editing just
    works, right in your cmd.exe console.



    (It's also not clear how well your product manages to use POSIX under
    pure Windows, or whether you have to drag this other thing called 'CygWin'.

    He specified in the paragraph to which you responded the posix
    interposer he used.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Scott Lurndal@21:1/5 to Kaz Kylheku on Thu Aug 22 17:47:57 2024
    XPost: comp.unix.shell, comp.unix.programmer

    Kaz Kylheku <643-408-1753@kylheku.com> writes:
    On 2024-08-22, Bart <bc@freeuk.com> wrote:
    On 22/08/2024 16:28, Kaz Kylheku wrote:
    On 2024-08-22, Dmitry A. Kazakov <mailbox@dmitry-kazakov.de> wrote:
    On 2024-08-22 13:00, David Brown wrote:

    Then there are those that - wisely or unwisely - program in C for
    Windows, without POSIX.

    Yes, that is true. There is no reason to use POSIX under Windows,
    whatsoever.

    David also wrote this, in the same comment:

    It takes but one single counter-example to invalidate general claims >>>>> like this.

    It applies to your reply as well.

    There are excellent, excellent reasons to use POSIX under Windows.

    Such as, oh, having an entire POSIX appliation ported to Windows
    almost without lifting a finger.

    For the TXR project I use a POSIX layer called Cygnal (see signature
    below). It gives a decent Windows port which preserves most of the
    functionality. All the POSIX stuff in the TXR Lisp standard library just >>> works. The interactive listener ("REPL") with history and editing just
    works, right in your cmd.exe console.


    You can use the same argument to justify using X11 under Windows.

    I could use a similar argument, but it would lack nuance.

    Using X11 under Windows requires a server component, which is
    somewhat clunky for a stand-alone application to carry.

    To be fair, the server component can be anywhere on the
    local area network - windows-based x11 clients may attach to
    a remote DISPLAY (perhaps a linux box, for example).

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kaz Kylheku@21:1/5 to Bart on Thu Aug 22 17:38:45 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 2024-08-22, Bart <bc@freeuk.com> wrote:
    On 22/08/2024 17:31, Scott Lurndal wrote:
    Bart <bc@freeuk.com> writes:
    On 22/08/2024 16:28, Kaz Kylheku wrote:


    For the TXR project I use a POSIX layer called Cygnal (see signature
    below). It gives a decent Windows port which preserves most of the
    functionality. All the POSIX stuff in the TXR Lisp standard library just >>>> works. The interactive listener ("REPL") with history and editing just >>>> works, right in your cmd.exe console.



    (It's also not clear how well your product manages to use POSIX under
    pure Windows, or whether you have to drag this other thing called 'CygWin'. >>
    He specified in the paragraph to which you responded the posix
    interposer he used.

    So this is only indirectly using POSIX under Windows.

    That is correct; the Microsoft POSIX subsystem isn't used, if that's
    what you mean by "direct".

    It's not designed to be usable, as far as I know.

    POSIX is an interface specification which can be implemented on top
    of Win32 calls. If you have that, then many POSIX programs work without modification or without a lot of modification.

    --
    TXR Programming Language: http://nongnu.org/txr
    Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
    Mastodon: @Kazinator@mstdn.ca

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kaz Kylheku@21:1/5 to Bart on Thu Aug 22 17:36:04 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 2024-08-22, Bart <bc@freeuk.com> wrote:
    On 22/08/2024 16:28, Kaz Kylheku wrote:
    On 2024-08-22, Dmitry A. Kazakov <mailbox@dmitry-kazakov.de> wrote:
    On 2024-08-22 13:00, David Brown wrote:

    Then there are those that - wisely or unwisely - program in C for
    Windows, without POSIX.

    Yes, that is true. There is no reason to use POSIX under Windows,
    whatsoever.

    David also wrote this, in the same comment:

    It takes but one single counter-example to invalidate general claims
    like this.

    It applies to your reply as well.

    There are excellent, excellent reasons to use POSIX under Windows.

    Such as, oh, having an entire POSIX appliation ported to Windows
    almost without lifting a finger.

    For the TXR project I use a POSIX layer called Cygnal (see signature
    below). It gives a decent Windows port which preserves most of the
    functionality. All the POSIX stuff in the TXR Lisp standard library just
    works. The interactive listener ("REPL") with history and editing just
    works, right in your cmd.exe console.


    You can use the same argument to justify using X11 under Windows.

    I could use a similar argument, but it would lack nuance.

    Using X11 under Windows requires a server component, which is
    somewhat clunky for a stand-alone application to carry.

    X11 windows will not integrate nicely into the Windows desktop as
    native windows with native widgets and behaviors.

    Most POSIX stuff does translate nicely to the Windows environment, largely because Windows was aped after Unix.

    (It's also not clear how well your product manages to use POSIX under
    pure Windows, or whether you have to drag this other thing called 'CygWin'.

    It relies on a DLL, which is a modified/forked version of the Cygwin
    DLL, named cygwin1.dll. This just sits in the same directory as the main executable.

    If you wrote a program with Microsoft Visual C, and dynamically linked
    it to its run-time, you'd have the same thing: your executable and a redistributable run-time.

    The cygwin1.dll provides C stuff: malloc, printf, sin, cos, ...
    Plus POSIX stuff: glob, ftw, fork, dup2, stat, tcgetattr, ...

    Can you write a normal Windows app and just call into a DLL called
    posix.dll or is there an extra layer or two involved?)

    You can use Win32 calls (into kernel32.dll, user32.dll, ...) along side
    all that stuff from cygwin1.dll, just like you can use Win32 calls in a
    program linked to MSVC redistributable run-time.

    Here is an example TXR Lisp program that I use for turning a laptop
    monitor off. It's saved as "monitor-off.tl", where the .tl suffix
    has the correct association that I can launch it by double clicking on
    it.

    The (usleep ...) call is implemented using POSIX functions.

    (typedef HWND (cptr HWND))
    (typedef UINT uint)
    (typedef LPARAM long)
    (typedef WPARAM ulong)

    (defsymacro SC_MONITORPOWER #xF170)

    (defsymacro WM_SYSCOMMAND #x0112)

    (defsymacro MONITOR_OFF 2)

    (defvarl HWND_BROADCAST (cptr-int -1 'HWND))

    (with-dyn-lib "user32.dll"
    (deffi PostMessage "PostMessageW"
    int (HWND UINT WPARAM LPARAM)))

    (usleep 2000000)

    (PostMessage HWND_BROADCAST WM_SYSCOMMAND SC_MONITORPOWER MONITOR_OFF)

    --
    TXR Programming Language: http://nongnu.org/txr
    Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
    Mastodon: @Kazinator@mstdn.ca

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kaz Kylheku@21:1/5 to Kaz Kylheku on Thu Aug 22 17:48:03 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 2024-08-22, Kaz Kylheku <643-408-1753@kylheku.com> wrote:
    On 2024-08-22, Bart <bc@freeuk.com> wrote:
    So this is only indirectly using POSIX under Windows.

    That is correct; the Microsoft POSIX subsystem isn't used, if that's
    what you mean by "direct".

    It's not designed to be usable, as far as I know.

    The Wikipedia has info about this:

    https://en.wikipedia.org/wiki/Microsoft_POSIX_subsystem

    Over the years, Microsoft shipped different "POSIX-on-Windows"
    solutions, making them a moving target.

    You cannot rely on any of these, not only because of the moving
    target nature, but because of various drawbacks.

    None of them are useful when what you want either of these:

    - port a POSIX program such that it's a native Windows application,
    not requiring any special environment or subsystem.

    - develop a native Windows application which uses POSIX interfaces to
    interact with the host system as much as possible.

    --
    TXR Programming Language: http://nongnu.org/txr
    Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
    Mastodon: @Kazinator@mstdn.ca

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dmitry A. Kazakov@21:1/5 to Kaz Kylheku on Thu Aug 22 20:28:30 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 2024-08-22 17:28, Kaz Kylheku wrote:

    Such as, oh, having an entire POSIX appliation ported to Windows
    almost without lifting a finger.

    It presumes that your application is already limited to POSIX.

    In the scenario of designing a portable application there are more comprehensive choices, e.g. glib (and other parts of GTK).

    --
    Regards,
    Dmitry A. Kazakov
    http://www.dmitry-kazakov.de

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kaz Kylheku@21:1/5 to Dmitry A. Kazakov on Thu Aug 22 18:54:39 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 2024-08-22, Dmitry A. Kazakov <mailbox@dmitry-kazakov.de> wrote:
    On 2024-08-22 17:28, Kaz Kylheku wrote:

    Such as, oh, having an entire POSIX appliation ported to Windows
    almost without lifting a finger.

    It presumes that your application is already limited to POSIX.

    In the scenario of designing a portable application there are more comprehensive choices, e.g. glib (and other parts of GTK).

    Glib is something you might use in conjunction with POSIX.
    It does not have API/feature parity with POSIX.

    If you have a POSIX + Glib application, chances are good you can easily
    port it to Windows using Cygnal. You can ship it standalone by bundling
    it with the cygwin1.dll from Cygnal, and the glib library from Cygwin.

    --
    TXR Programming Language: http://nongnu.org/txr
    Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
    Mastodon: @Kazinator@mstdn.ca

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Dmitry A. Kazakov on Fri Aug 23 00:15:13 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Thu, 22 Aug 2024 13:30:19 +0200, Dmitry A. Kazakov wrote:

    On 2024-08-22 13:00, David Brown wrote:

    Then there are those that - wisely or unwisely - program in C for
    Windows, without POSIX.

    Yes, that is true. There is no reason to use POSIX under Windows,
    whatsoever.

    That’s strange. Didn’t Microsoft tout the POSIX compatibility of Windows
    to its US Government customers?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to David Brown on Fri Aug 23 00:19:34 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Thu, 22 Aug 2024 12:47:16 +0200, David Brown wrote:

    On 22/08/2024 11:02, Lawrence D'Oliveiro wrote:

    Python prohibits those space/tab inconsistencies.

    No, it does not. Python treats tabs (at the start of lines, which is
    the only relevant point here) as 8 spaces by default. You can change
    that with command-line flags if you want. But it is quite happy with mixtures of tabs and spaces as long as the result after tab-to-space conversion is consistent with Python syntax.

    src = \
    """
    def fun() :
    \t\tprint("line 1")
    \t\x20\x20\x20\x20\x20\x20\x20\x20print("line 2")

    fun()
    """

    exec(src)

    Output:

    TabError: inconsistent use of tabs and spaces in indentation

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Lawrence D'Oliveiro on Fri Aug 23 09:19:06 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 23/08/2024 02:19, Lawrence D'Oliveiro wrote:
    On Thu, 22 Aug 2024 12:47:16 +0200, David Brown wrote:

    On 22/08/2024 11:02, Lawrence D'Oliveiro wrote:

    Python prohibits those space/tab inconsistencies.

    No, it does not. Python treats tabs (at the start of lines, which is
    the only relevant point here) as 8 spaces by default. You can change
    that with command-line flags if you want. But it is quite happy with
    mixtures of tabs and spaces as long as the result after tab-to-space
    conversion is consistent with Python syntax.

    src = \
    """
    def fun() :
    \t\tprint("line 1")
    \t\x20\x20\x20\x20\x20\x20\x20\x20print("line 2")

    fun()
    """

    exec(src)

    Output:

    TabError: inconsistent use of tabs and spaces in indentation

    src = \
    """
    def fun() :
    \t\x20\x20\x20\x20\x20\x20\x20\x20print("line 1")
    \t\x20\x20\x20\x20\x20\x20\x20\x20print("line 2")

    fun()
    """


    Mixtures of tabs and spaces are accepted without complaint.

    But you are right that some of the worst or most dangerous cases are
    rejected by Python. Python 3 is stricter here than Python 2 was, and
    much of my long-term code is Python 2.

    (The incompatibilities between Python 2 and Python 3 are another pain in Python. Equally, however, it avoids the pain seen in C and C++ where
    backwards compatibility can limit new features and force poor features
    to remain valid.)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Lawrence D'Oliveiro on Fri Aug 23 09:33:08 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 23/08/2024 02:15, Lawrence D'Oliveiro wrote:
    On Thu, 22 Aug 2024 13:30:19 +0200, Dmitry A. Kazakov wrote:

    On 2024-08-22 13:00, David Brown wrote:

    Then there are those that - wisely or unwisely - program in C for
    Windows, without POSIX.

    Yes, that is true. There is no reason to use POSIX under Windows,
    whatsoever.

    That’s strange. Didn’t Microsoft tout the POSIX compatibility of Windows to its US Government customers?

    Yes - that's /exactly/ why Windows NT was designed with a POSIX subsystem.

    The original plan (I remember a fine magazine article about it in the
    mid nineties) was that you'd have the NT kernel and GUI (copied from
    Windows 3 at the time) and multiple "personalities" or interfaces,
    including POSIX, Win32, Win32s, Win16, and OS/2. Other operating
    systems would have similar possibilities - OS/2 certainly had OS/2,
    Win16 and Win32s. That way customers could choose there OS and their
    apps independently, there would be no vendor lock-in, and the US
    Government could buy Windows.

    Prototypes were made, big contracts were signed, NT was granted the
    required US Government certifications (even security certifications - as
    long as the floppy drive was removed, there was no network port, the
    serial ports were blocked up, and the computer was in a secure room with
    no external connections).

    Then the NT POSIX subsystem was minimised and hidden, the OS/2 interface
    was never implemented, and Win32s was changed so that new Win32s apps
    would not run on OS/2. The Microsoft pretence of compatibility and
    vendor independence let them add new markets to their monopoly.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to David Brown on Fri Aug 23 08:29:41 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Fri, 23 Aug 2024 09:19:06 +0200, David Brown wrote:

    On 23/08/2024 02:19, Lawrence D'Oliveiro wrote:

    On Thu, 22 Aug 2024 12:47:16 +0200, David Brown wrote:

    But it is quite happy with
    mixtures of tabs and spaces as long as the result after tab-to-space
    conversion is consistent with Python syntax.

    Mixtures of tabs and spaces are accepted without complaint.

    I understood you to mean that different mixtures of tabs and spaces would
    work, so long as they were equivalent to the same indentation under the 8- spaces = 1 tab rule that you cited.

    In fact there is no such equivalence rule. Tabs are tabs, and spaces are spaces, and never the twain shall be interconvertible.

    (The incompatibilities between Python 2 and Python 3 are another pain in Python.

    The fundamental problem was that Unicode was a mess in Python 2 that
    needed to be cleaned up. Since they had no choice but to break backward compatibility in that regard, they figured they would fix a few other
    things while they were at it.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dmitry A. Kazakov@21:1/5 to Lawrence D'Oliveiro on Fri Aug 23 12:04:09 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 2024-08-23 10:29, Lawrence D'Oliveiro wrote:

    The fundamental problem was that Unicode was a mess in Python 2 that
    needed to be cleaned up. Since they had no choice but to break backward compatibility in that regard, they figured they would fix a few other
    things while they were at it.

    and again in Python 4... (:-))

    --
    Regards,
    Dmitry A. Kazakov
    http://www.dmitry-kazakov.de

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dmitry A. Kazakov@21:1/5 to Bart on Thu Aug 29 13:31:01 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 2024-08-29 12:49, Bart wrote:

    Without the constraints imposed by the language, I could just write it as:

        if a == b:
            s1
    RETURN
            s2
            s3

    NOW it stands out!

    In Ada I use indentation for the purpose:

    if A = B then -- This I will remove later
    s1;
    end if;
    s2;
    s3;

    I remember FORTRAN in its glory days had D-comments. In the first column
    the letter D meant a conditional, compiled in the debug mode, ignored otherwise.

    --
    Regards,
    Dmitry A. Kazakov
    http://www.dmitry-kazakov.de

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Lawrence D'Oliveiro on Thu Aug 29 14:05:41 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 29/08/2024 03:19, Lawrence D'Oliveiro wrote:
    On Wed, 28 Aug 2024 17:23:25 -0700, Keith Thompson wrote:

    That's not the conventional way to format a docstring. If you're using
    backslashes to splice lines in Python, it's likely you're doing
    something wrong.

    What exactly is wrong?

    I think "is not None" is more idiomatic.

    When I want an equality comparison, I use “==”, not “is”.

    You don't need the \ if you put the ( on the same line.

    But I do otherwise.

    You leave a space between "else" and ":". It's not wrong, but it's not
    something I've ever seen.

    People who look at my code tend to get triggered by the little things;
    maybe it’s a way to avoid thinking about the big things?

    """
    There are two ways of constructing a software design: One way is to make
    it so simple that there are obviously no deficiencies, and the other way
    is to make it so complicated that there are no obvious deficiencies. The
    first method is far more difficult.
    """

    You are clearly aiming for the second method here - put in so much extra
    crap and silliness that readers get caught up in that instead of
    noticing that most of the function is meaningless.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Keith Thompson on Thu Aug 29 14:01:05 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 29/08/2024 02:23, Keith Thompson wrote:
    Lawrence D'Oliveiro <ldo@nz.invalid> writes:
    On Wed, 28 Aug 2024 13:29:18 -0700, Keith Thompson wrote:
    But ok, I found your post and removed all the #end comments. I found it >>> just as readable without them as with them.

    You know what? You are right. That example was just too
    well-structured.

    So why not try to write /all/ your code in a well-structured manner, so
    that you don't feel the need to add these "#end" comments?


    Here’s a more dangerous one:

    def register_additional_standard(self, **kwargs) :
    "registers additional standard interfaces that are not automatically" \
    " installed at Connection creation time. Currently the only one is" \
    " the object-manager interface, registered with\n" \
    "\n" \
    " «conn».register_additional_standard(managed_objects = True)\n"

    That's not the conventional way to format a docstring. If you're using backslashes to splice lines in Python, it's likely you're doing
    something wrong.

    Agreed 100%.


    for key in kwargs :
    if kwargs[key] :
    if key == "managed_objects" :
    if self._managed_objects != None :

    I think "is not None" is more idiomatic.

    I don't know if that is true or not that it is more idiomatic - I would certainly be happy with either.

    def register_additional_standard(self, managed_objects) :
    """
    registers additional standard interfaces that are not automatically
    installed at Connection creation time. Currently the only one is
    the object-manager interface, registered with

    «conn».register_additional_standard(managed_objects = True)
    """

    if managed_objects :
    if self._managed_objects != None :
    raise asyncio.InvalidStateError("object manager
    interface already registered")
    self.register(
    path = "/",
    interface = ManagedObjectsHandler(),
    fallback = True
    )
    self._managed_objects = {}
    return self

    (Usenet formatting is limited to 72 characters standard - modern
    programming is not. Overly long lines are not good, but a hard limit
    at, say, 80 characters is a bad idea.)



    raise asyncio.InvalidStateError \
    (
    "object manager interface already registered" >> )

    You don't need the \ if you put the ( on the same line.

    Line continuation characters in Python are usually an indicator of poor formatting, or an unhealthy obsession with line length limits.


    #end if
    self.register \
    (
    path = "/",
    interface = ManagedObjectsHandler(),
    fallback = True
    )

    Again, you've decided how you want to place parentheses and you're
    forcing the syntax to cater to that. I might write that as:

    self.register(
    path = "/",
    interface = ManagedObjectsHandler(),
    fallback = True
    )

    self._managed_objects = {}
    else :

    You leave a space between "else" and ":". It's not wrong, but it's not something I've ever seen. It's likely to be just a little jarring to readers.

    I personally prefer a space before the colon in Python. It is probably
    less common than no space, but it is certainly not a rare habit.


    raise TypeError("unrecognized argument keyword “%s”" % key)

    Do you have a requirement to use older versions of Python that don't
    support f-strings?

    #end if
    #end if
    #end for
    return \
    self

    Why not just "return self"?

    Indeed.


    #end register_additional_standard

    versus

    def register_additional_standard(self, **kwargs) :
    "registers additional standard interfaces that are not automatically" \
    " installed at Connection creation time. Currently the only one is" \
    " the object-manager interface, registered with\n" \
    "\n" \
    " «conn».register_additional_standard(managed_objects = True)\n"
    for key in kwargs :
    if kwargs[key] :
    if key == "managed_objects" :
    if self._managed_objects != None :
    raise asyncio.InvalidStateError \
    (
    "object manager interface already registered" >> )
    self.register \
    (
    path = "/",
    interface = ManagedObjectsHandler(),
    fallback = True
    )
    self._managed_objects = {}
    else :
    raise TypeError("unrecognized argument keyword “%s”" % key)
    return self

    Again, the #end comments don't make it any more readable *for me*.
    I suspect that would be even more true for more experienced Python programmers.

    I don't know if I am more experienced than you in Python (I may have
    been using Python for longer, but you may have worked with it more), but
    I would say that the "#end" comments directly detract from readability.


    I was looking for quite a tricky example I remember seeing on the
    ArjanCodes channel on YouTube, but I can’t find it.

    In any language, if a block of code is so deeply indented that it's confusing, you should consider refactoring it. (Though that's not
    always the answer.)

    Agreed.


    I once reviewed some C code with misleading indentation. Depending on
    the viewer's tab settings (4 vs 8 columns) it looked either like this:

    if (condition)
    this;
    that;

    or like this:

    if (condition)
    this;
    that;

    Of course it meant the same to the compiler.

    As someone who works with C programming that is often high-reliability
    (not necessarily safety critical, but updates after production can be
    very expensive), both are unacceptable in the kind of coding standards
    we use. I accept single-line "if" statements without braces if they are
    simple enough, otherwise braces are required.

    if (condition) return;

    if (condition) {
    return;
    } else {
    break;
    }

    If the "true" statement is on a separate line, braces are /always/
    required for my type of code. Almost any indentation is done inside a
    pair of braces - it keeps everything simple and consistent, and it's
    easy to spot mistakes.


    In any language, I think it's important to use consistent indentation
    that reflects the structure of the code, and to avoid mixing tabs and
    spaces. (My personal preference is to use spaces exclusively, but I'll conform to what existing code does.) As I've said elsethread, Python's
    rules just force me to do what I would have done anyway.


    I do the same. (Well, I use tabs more than spaces, but otherwise I do
    the same.)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Muttley@dastardlyhq.com on Thu Aug 29 14:30:27 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 29/08/2024 09:28, Muttley@dastardlyhq.com wrote:
    On Wed, 28 Aug 2024 20:48:08 +0200
    David Brown <david.brown@hesbynett.no> wrote:
    On 28/08/2024 19:43, Muttley@dastardlyhq.com wrote:
    Writing editor editor macros in order to work around fundamentally bad
    language design is not something a programmer should have to waste
    time on.



    I don't know about Emacs, but in most editors the way you indent a
    block of code is to select the lines, then press "Tab".  Unindenting
    is "shift-Tab".  Changing tabs to spaces or spaces to tabs is done by
    selecting "Tabs to spaces" from the Edit menu, or something equally
    simple and obvious.  Many editor can be set to convert tabs to spaces
    (or vice versa) when saving files, perhaps specific to the file type
    (so you don't muck up your makefiles).

    It takes a special kind of genius to be able to program, and yet still
    have trouble with this kind of thing.

    Don't be a patronising prick, it doesn't help your argument. Personally I have better things to do that figure out some obscure functionality of vim
    to achieve something I shouldn't have to do in the first place if the language was designed properly. Thankfully I don't have to use Python much.


    Then don't use vim - use an editor that suits your needs.

    If you are trying to claim that you do software development, and that
    the editor(s) you use regularly do not have easily available functions
    for indenting and un-indenting sections of code, then you are either
    lying, or you /are/ an aforementioned special kind of genius.

    Presumably you are /not/ trying to claim that - you are just trolling.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Bart on Thu Aug 29 14:24:01 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 28/08/2024 21:27, Bart wrote:
    On 28/08/2024 19:48, David Brown wrote:
    On 28/08/2024 19:43, Muttley@dastardlyhq.com wrote:
    On Tue, 27 Aug 2024 21:34:54 -0000 (UTC)
    Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
    On Tue, 27 Aug 2024 11:26:18 +0100, Bart wrote:

    (2) You want to temporarily comment out an 'if' line so that the
    following block is unconditional. You can't do that with also
    unindenting the block.

    In Emacs, I have commands defined to adjust the indentation of the
    selected region. Surely any other decent editor would offer the same.

    Writing editor editor macros in order to work around fundamentally bad
    language design is not something a programmer should have to waste
    time on.



    I don't know about Emacs, but in most editors the way you indent a
    block of code is to select the lines, then press "Tab".  Unindenting
    is "shift-Tab".  Changing tabs to spaces or spaces to tabs is done by
    selecting "Tabs to spaces" from the Edit menu, or something equally
    simple and obvious.  Many editor can be set to convert tabs to spaces
    (or vice versa) when saving files, perhaps specific to the file type
    (so you don't muck up your makefiles).

    It takes a special kind of genius to be able to program, and yet still
    have trouble with this kind of thing.

    The main problem isn't in changing the indentation of a block of code;
    it is in HAVING to do so because of poor language design.

    If I am adding or removing blocks (such as surrounding existing code in
    a new conditional), then I /have/ to change the indentation - in /any/ language. (I use indents in my assembly programming too.) Call it OCD
    or compulsive behaviour if you like, but I cannot consider code to be
    finished - even to the level of a quick compile or test - if the
    indentation is not correct.

    I simply cannot see the problem with Python here, because I would not
    indent things in any other way in any language.

    The only thing I see as annoying in Python is when you have two or three indentations left hanging :

    def foo(a, b, c) :
    if a :
    if b :
    if c :
    doThis()

    That looks unfinished to me. So I will add a "return" at the end (with
    a single tab indent, in this case). If it is not the end of the
    function, I will sometimes use a "pass" to pull back the indent level.


    A lesser one
    is having to rely on whatever varied features that 100s of different
    editors may have to do so.

    I also rely on editors being able to accept keypresses, to load and save
    files, and to have features like "search".

    Of course, being a sane software developer, I do most of my programming
    using editors that are suitable for software development. Most
    professional carpenters use hammers for their nails, rather than bashing
    them in with stones - it's the same thing, really.


    And yet another, of more significance, if that after you've indented a
    block, it may now merge into an adjacent block that was already at that
    new indent. If you later need to revert that first block back to it's original position, you'd better make sure you mark that boundary.


    So mark the boundary. Add a blank line. Put a comment line describing
    the steps of the function. You are making up problems for which you
    already have good solutions that you would be using in any programming language.

    It is a language design issue pure and simple. Don't try and pin it on
    the users and make out it's due to lack of expertise with their editors.
    Of course we can all indent blocks; it's just an unnecessary palaver.

    Clearly your point of view is as a language /user/ where languages and
    their characteristics are an invariant that you can't do anything about, can't change, and need to work around.

    But some of us devise (and, importanly, implement) languages of our own
    and can be more vocal about misfeatures in others.


    Having made your own language(s) gives you no more and no less right to
    comment about features of other languages that you like or dislike.

    Your problem here is that you are obsessed with finding things that you
    want to see as misfeatures, design flaws, or problems in other languages
    - and then obsess about how you can find new ways to make it more
    difficult to "work around" them.

    Don't you ever just accept that a language is the way it is, and it is perfectly useable that way? Or think that perhaps other people in the
    world know better than you do about how they want their language to
    work? Has it never occurred to you that the people behind a given
    language - such as Python - considered various alternatives and decided
    that making it the way they did was the best choice overall for the
    language they wanted?

    As Bjarne Stustroup said, there are two kinds of programming languages -
    those that people complain about, and those that no one uses.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ben Bacarisse@21:1/5 to Dmitry A. Kazakov on Thu Aug 29 13:50:01 2024
    XPost: comp.unix.shell, comp.unix.programmer

    "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes:

    On 2024-08-29 12:49, Bart wrote:

    Without the constraints imposed by the language, I could just write it as: >> ááá if a == b:
    ááááááá s1
    RETURN
    ááááááá s2
    ááááááá s3
    NOW it stands out!

    In Ada I use indentation for the purpose:

    if A = B then -- This I will remove later
    s1;
    end if;
    s2;
    s3;

    I remember FORTRAN in its glory days had D-comments. In the first column
    the letter D meant a conditional, compiled in the debug mode, ignored otherwise.

    That was a non-standard extension, so it was not really part of FORTRAN
    but just some FORTRAN implementations. (The ones I have used didn't
    have that, for example.)

    --
    Ben.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Muttley@dastardlyhq.com@21:1/5 to David Brown on Thu Aug 29 16:19:45 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Thu, 29 Aug 2024 14:30:27 +0200
    David Brown <david.brown@hesbynett.no> wrote:
    Presumably you are /not/ trying to claim that - you are just trolling.

    Ah ok, you're the type who thinks anyone who disagrees with you is a troll. You're not worth the effort mate.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Janis Papanagnou@21:1/5 to David Brown on Thu Aug 29 18:44:35 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 29.08.2024 14:30, David Brown wrote:
    On 29/08/2024 09:28, Muttley@dastardlyhq.com wrote:
    [...]

    Then don't use vim - use an editor that suits your needs.

    LOL. (You appear to be joking. - If not, continue reading...)

    But what makes you think that his needs are not covered by Vim?


    If you are trying to claim that you do software development, and that
    the editor(s) you use regularly do not have easily available functions
    for indenting and un-indenting sections of code, then you are either
    lying, or you /are/ an aforementioned special kind of genius.

    Vim is an editor that has the most simple and also very powerful
    indenting for well structured data and programs I've yet seen.
    (Not mentioning its equally powerful other editing facilities.)

    And even badly designed languages can be indented in the same
    ways that other editors (more primitive ones or Emacs) provide.
    Not as efficient as with previously mentioned cleanly designed
    data or languages, but as efficient as all these other editors.

    Why should he use any editor that is - in the general case, for
    editing all sorts of data - mostly much less efficient than Vim?
    (From the handful of popular editors I don't see any candidate.)

    But this is not an untypical reflex on the Internet; ignoring
    factual design issues, questioning the used tools instead, and
    giving folks with different experiences and preferences names.

    Janis

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to John Ames on Thu Aug 29 21:27:36 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 29/08/2024 17:52, John Ames wrote:
    On Thu, 29 Aug 2024 14:24:01 +0200
    David Brown <david.brown@hesbynett.no> wrote:

    Don't you ever just accept that a language is the way it is, and it
    is perfectly useable that way? Or think that perhaps other people in
    the world know better than you do about how they want their language
    to work? Has it never occurred to you that the people behind a given
    language - such as Python - considered various alternatives and
    decided that making it the way they did was the best choice overall
    for the language they wanted?

    They probably did - but did they do that *because* of the point in
    question, in spite of it, or without any meaningful inclination toward
    or against it? There are plenty of other aspects about Python that may
    tip the balance in spite of its annoyances.


    I don't know the early history of Python, so I can't answer that. But
    there can be no doubt that the BDFL and other "founding fathers" of the language were aware of the pros and cons of making white space
    significant for block structuring in the language, and that they
    actively decided to make its syntax the way it is as the best balance,
    in their opinions, for the expected use of the language. However, it is
    also likely that they did not predict where the language would be, and
    how it would be used, decades later. Maybe if they had had a crystal
    ball they would have designed things differently - maybe not.

    /All/ languages, except perhaps Bart's private language that is only
    used by him, have their annoyances. I have worked at least a little
    with a fair number of languages, and I've never seen one that I thought
    was "perfect". But different people have different things that the like
    and dislike about any given language.

    So if you have the choice of which language to use (many programmers do
    not), you pick one that has more things you like for the task in
    question in comparison to the things you don't like.

    F'rinstance, the *very* comprehensive set of libraries make bashing out
    quick utilities to do A Complex Thing often very simple. (That was the
    reason I first used it - needed a quick-'n-easy way to programmatically deliver data in a POST request from a Windows box in production, and it
    beat the hell out of trying to wrap my head around Win32 network programming.) But if the language "wins" on that score, that doesn't
    mean its annoyances or flaws are any less real or worthy of complaint.

    Like, obviously it's way too late in the game for Python to change this
    now. But we can still say it's stupid for them to have done it that way
    in the first place. Is that a matter of opinion? Sure, but that's never stopped anybody from expressing themselves re: any other language. (How
    many people are still bitching about C being "insecure," 50+ years down
    the line?)


    You are welcome to your opinions on languages - I have plenty of my own
    (and I prefer explicit block delimiters - I would even go further in
    languages like C and insist on them in more situations). But it's
    important to understand that these are opinions - the designers of
    Python were /not/ stupid to have made the language that way. They just
    had different opinions from you, and the had a much better basis for
    forming those opinions than you or I.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Janis Papanagnou on Thu Aug 29 21:36:08 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 29/08/2024 18:44, Janis Papanagnou wrote:
    On 29.08.2024 14:30, David Brown wrote:
    On 29/08/2024 09:28, Muttley@dastardlyhq.com wrote:
    [...]

    Then don't use vim - use an editor that suits your needs.

    LOL. (You appear to be joking. - If not, continue reading...)


    I was not joking.

    But what makes you think that his needs are not covered by Vim?

    You seem to have missed the point - sorry if I was not clear.

    He complained that he didn't want to learn complicated macros in Vim
    just to be able to indent or un-indent lines of code. The solution is
    obvious - he should use an editor other than Vim.

    He could, of course, learn how to use Vim. It's a perfectly good editor
    with a lot of features. It's never been my cup of tea, and nor has
    Emacs - but that's preference and habit, and says nothing about whether
    or not it is a good editor or useful for other people.

    There are more than enough decent editors to choose from, that cover the
    basic needs of programmers. Some people use one editor for everything,
    others use a range for different purposes - whatever suits you. But it
    is pretty absurd to complain that it is difficult to indent code just
    because you (i.e., Muttley) think it is hard to do in one particular editor.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Muttley@dastardlyhq.com on Thu Aug 29 21:29:15 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 29/08/2024 18:19, Muttley@dastardlyhq.com wrote:
    On Thu, 29 Aug 2024 14:30:27 +0200
    David Brown <david.brown@hesbynett.no> wrote:
    Presumably you are /not/ trying to claim that - you are just trolling.

    Ah ok, you're the type who thinks anyone who disagrees with you is a troll.

    No, I was talking about /you/. I don't know of anyone here with whom I
    don't disagree at times, and most of the rest are not trolling.

    You're not worth the effort mate.


    Feel free to ignore my posts.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to David Brown on Thu Aug 29 22:57:17 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Thu, 29 Aug 2024 14:24:01 +0200, David Brown wrote:

    def foo(a, b, c) :
    if a :
    if b :
    if c :
    doThis()

    That looks unfinished to me. So I will add a "return" at the end (with
    a single tab indent, in this case).

    A redundant “return” ... kind of like my redundant “#end” comments, except
    yours work in a more restricted set of places ...

    Don't you ever just accept that a language is the way it is, and it is perfectly useable that way?

    Of course not.

    Or think that perhaps other people in the world know better than you do
    about how they want their language to work?

    And vice versa.

    Has it never occurred to you that the people behind a given
    language - such as Python - considered various alternatives and decided
    that making it the way they did was the best choice overall for the
    language they wanted?

    Barring a few obvious stupidities, yes of course they were, and are, smart people.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to David Brown on Thu Aug 29 23:03:54 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Thu, 29 Aug 2024 14:01:05 +0200, David Brown wrote:

    On 29/08/2024 02:23, Keith Thompson wrote:

    Lawrence D'Oliveiro <ldo@nz.invalid> writes:

    On Wed, 28 Aug 2024 13:29:18 -0700, Keith Thompson wrote:

    But ok, I found your post and removed all the #end comments. I found
    it just as readable without them as with them.

    You know what? You are right. That example was just too
    well-structured.

    So why not try to write /all/ your code in a well-structured manner, so
    that you don't feel the need to add these "#end" comments?

    Because not all examples can be made that neat, as I demonstrated.

    def register_additional_standard(self, managed_objects) :
    """
    registers additional standard interfaces that are not
    automatically installed at Connection creation time. Currently
    the only one is the object-manager interface, registered with

    «conn».register_additional_standard(managed_objects = True)
    """

    Note that Python’s indentation rules don’t apply to multiline string literals -- don’t you wish they did? So you end up with all that extra
    space within the literal. Do you see why I prefer to avoid that?

    Line continuation characters in Python are usually an indicator of poor formatting, or an unhealthy obsession with line length limits.

    I like to keep within a line length limit of about 100 characters.

    I don't know if I am more experienced than you in Python (I may have
    been using Python for longer, but you may have worked with it more), but
    I would say that the "#end" comments directly detract from readability.

    Think about why you bother to indent code in languages where the compiler ignores such indentation anyway: it means you are expressing the structure
    of code in two different ways, one via statement brackets, and the other
    via indentation. This redundancy aids in understanding that the code does
    what you think it does.

    Python gets rid of this redundancy, by having the compiler take notice of
    the whitespace and removing the statement bracketing symbols. So I put it
    back, by adding statement bracketing symbols that the compiler ignores.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Bart@21:1/5 to David Brown on Fri Aug 30 00:49:25 2024
    On 29/08/2024 13:24, David Brown wrote:
    On 28/08/2024 21:27, Bart wrote:
    On 28/08/2024 19:48, David Brown wrote:
    On 28/08/2024 19:43, Muttley@dastardlyhq.com wrote:
    On Tue, 27 Aug 2024 21:34:54 -0000 (UTC)
    Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
    On Tue, 27 Aug 2024 11:26:18 +0100, Bart wrote:

    (2) You want to temporarily comment out an 'if' line so that the
    following block is unconditional. You can't do that with also
    unindenting the block.

    In Emacs, I have commands defined to adjust the indentation of the
    selected region. Surely any other decent editor would offer the same. >>>>
    Writing editor editor macros in order to work around fundamentally bad >>>> language design is not something a programmer should have to waste
    time on.



    I don't know about Emacs, but in most editors the way you indent a
    block of code is to select the lines, then press "Tab".  Unindenting
    is "shift-Tab".  Changing tabs to spaces or spaces to tabs is done by
    selecting "Tabs to spaces" from the Edit menu, or something equally
    simple and obvious.  Many editor can be set to convert tabs to spaces
    (or vice versa) when saving files, perhaps specific to the file type
    (so you don't muck up your makefiles).

    It takes a special kind of genius to be able to program, and yet
    still have trouble with this kind of thing.

    The main problem isn't in changing the indentation of a block of code;
    it is in HAVING to do so because of poor language design.

    If I am adding or removing blocks (such as surrounding existing code in
    a new conditional), then I /have/ to change the indentation - in /any/ language.  (I use indents in my assembly programming too.)  Call it OCD
    or compulsive behaviour if you like, but I cannot consider code to be finished - even to the level of a quick compile or test - if the
    indentation is not correct.

    I simply cannot see the problem with Python here, because I would not
    indent things in any other way in any language.

    The only thing I see as annoying in Python is when you have two or three indentations left hanging :

    def foo(a, b, c) :
        if a :
            if b :
                if c :
                    doThis()

    Let's assume you know this ends here (as there is no concrete bit of
    syntax that will confirm it).

    You need to add another statement to that 'if b' block. Even with just
    two intervening lines, you need to take some care. With more, you either
    have to work your way down from 'if b' then move right one tab, or start
    from the first statement ('if c') and work down from that. At the same
    keep an eye out for cues as to the end of the 'if b' block.

    It should look like this afterwards:

    def foo(a, b, c) :
    if a :
    if b :
    if c :
    doThis()
    bnewstmt

    That new statement looks rather lonely and exposed though! Do the same
    with 'if a', and it becomes:


    def foo(a, b, c) :
    if a :
    if b :
    if c :
    doThis()
    bnewstmt

    # comment
    # comment
    anewstmt


    That looks unfinished to me.

    It's just too 'open'. The contents of foo look like they're leaking into
    the rest of the program. As it is, someone looking at this in the future wanting to a a new statement to 'if a:' might think it ends before the
    comments since that 'anewstmt' is too far from the main body.

    It needs delimiters:


    def foo(a, b, c) :
    if a :
    if b :
    if c :
    doThis()
    end
    bnewstmt
    end

    # comment
    # comment
    anewstmt
    end
    end

    Now you know that 'if a' doesn't end at that blank line, because no
    'end' has been seen for it.

    So I will add a "return" at the end (with
    a single tab indent, in this case).  If it is not the end of the
    function, I will sometimes use a "pass" to pull back the indent level.

    So you have problems too. Would you have needed 'return' if 'end's had
    been used in the original?

    Of course, being a sane software developer, I do most of my programming
    using editors that are suitable for software development.  Most
    professional carpenters use hammers for their nails, rather than bashing
    them in with stones - it's the same thing, really.


    And yet another, of more significance, if that after you've indented a
    block, it may now merge into an adjacent block that was already at
    that new indent. If you later need to revert that first block back to
    it's original position, you'd better make sure you mark that boundary.


    So mark the boundary.  Add a blank line.  Put a comment line describing
    the steps of the function.  You are making up problems for which you
    already have good solutions that you would be using in any programming language.

    How about just fixing the ******* language? That must be better than a
    million programmers wasting time creating their own fixes.

    Having made your own language(s) gives you no more and no less right to comment about features of other languages that you like or dislike.


    I had my opinions even before I used my own stuff.

    One thing I despised was the begin-end business in Algol60 and Pascal,
    which has the same nuisance as braces in C-like languages.

    I didn't like writing 'end else begin' any more than '} else {'. My
    stuff (and a few languages have picked up on it), uses just 'else',
    which also limits the placement possibilities when you have one token
    rather than three.


    Your problem here is that you are obsessed with finding things that you
    want to see as misfeatures, design flaws, or problems in other languages

    Yes. I'm into language design. But I'm also interested in aspects of it
    that many disregard, such as microfeatures, or ease of deployment.

    - and then obsess about how you can find new ways to make it more
    difficult to "work around" them.

    Fortunately I don't need to work with them much. If I did, I would find
    the means to make them tolerable.


    Don't you ever just accept that a language is the way it is, and it is perfectly useable that way?

    Well, I used Fortran IV for a year. But presumably lots of people
    weren't that happy with it as we've since had Fortran 77, 90, 95, 2008,
    2018 and 2023.

    It's not just me!


      Or think that perhaps other people in the
    world know better than you do about how they want their language to
    work?  Has it never occurred to you that the people behind a given
    language - such as Python - considered various alternatives and decided
    that making it the way they did was the best choice overall for the
    language they wanted?

    Python is full of ill-advised choices. And it's become almost as much of
    a monster as C++, with a million incompatible features bolted on.

    I'm not surprised that mere matters of syntax have low priority.


    As Bjarne Stustroup said, there are two kinds of programming languages - those that people complain about, and those that no one uses.


    Funny, I can complain about lots of languages that I never use!

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Keith Thompson on Fri Aug 30 02:55:06 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Thu, 29 Aug 2024 16:57:21 -0700, Keith Thompson wrote:

    Lawrence D'Oliveiro <ldo@nz.invalid> writes:
    [...]
    Think about why you bother to indent code in languages where the
    compiler ignores such indentation anyway: it means you are expressing
    the structure of code in two different ways, one via statement
    brackets, and the other via indentation. This redundancy aids in
    understanding that the code does what you think it does.

    Python gets rid of this redundancy, by having the compiler take notice
    of the whitespace and removing the statement bracketing symbols. So I
    put it back, by adding statement bracketing symbols that the compiler
    ignores.

    Another reason for “#end” comments is they give me something to jump to in the editor.

    I have Emacs commands defined to move quickly between lines with matching indentation. Since I have these at the beginning and end of every compound construct, that allows me easy navigation around my code.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Janis Papanagnou on Fri Aug 30 02:53:37 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Thu, 29 Aug 2024 18:44:35 +0200, Janis Papanagnou wrote:

    Vim is an editor that has the most simple and also very powerful
    indenting for well structured data and programs I've yet seen. (Not mentioning its equally powerful other editing facilities.)

    Vim is only good for text-editing, though. It assumes a file is split into lines. Emacs makes no such assumption, and can also edit non-text files.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Lawrence D'Oliveiro on Fri Aug 30 10:01:13 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 30/08/2024 01:03, Lawrence D'Oliveiro wrote:
    On Thu, 29 Aug 2024 14:01:05 +0200, David Brown wrote:

    On 29/08/2024 02:23, Keith Thompson wrote:

    Lawrence D'Oliveiro <ldo@nz.invalid> writes:

    On Wed, 28 Aug 2024 13:29:18 -0700, Keith Thompson wrote:

    But ok, I found your post and removed all the #end comments. I found >>>>> it just as readable without them as with them.

    You know what? You are right. That example was just too
    well-structured.

    So why not try to write /all/ your code in a well-structured manner, so
    that you don't feel the need to add these "#end" comments?

    Because not all examples can be made that neat, as I demonstrated.

    Your example could easily have been written in a more structured manner
    than you did. Keith and I both demonstrated that. (And when you remove
    the useless stuff from your function, it's even simpler.)

    I agree that not /all/ code can easily be written in a neat,
    well-structured manner - and that occasionally breaking your normal
    coding convention rules can bring out patterns in the code that make it
    easier to understand, and easier to write correctly. But the solid
    majority of code /can/ be written in a well-structured manner, for most languages.



    def register_additional_standard(self, managed_objects) :
    """
    registers additional standard interfaces that are not
    automatically installed at Connection creation time. Currently
    the only one is the object-manager interface, registered with

    «conn».register_additional_standard(managed_objects = True)
    """

    Note that Python’s indentation rules don’t apply to multiline string literals -- don’t you wish they did? So you end up with all that extra space within the literal. Do you see why I prefer to avoid that?

    No - or at least, it is very hard to comprehend why you might prefer the
    mess you gave. It is correct that Python multiline strings include any indentation in the strings. There are three possibilities here -
    sometimes you want the indents (and thus include them), sometimes you
    don't want them (and thus you align them at the left of the text), and sometimes you don't care (and thus put them wherever seems neatest).
    Most function docstrings fall into that third category, since they are
    mostly used as comments in the code and for the "help" command which
    ignores the leading indents.

    It is probably most common to have multiline docstrings at the left of
    the file. I have never before seen a silly mess with manual \n line
    breaks and line continuation characters, and I hope never to see it again.


    Line continuation characters in Python are usually an indicator of poor
    formatting, or an unhealthy obsession with line length limits.

    I like to keep within a line length limit of about 100 characters.


    That's a reasonable limit, but does not change my observation.

    I don't know if I am more experienced than you in Python (I may have
    been using Python for longer, but you may have worked with it more), but
    I would say that the "#end" comments directly detract from readability.

    Think about why you bother to indent code in languages where the compiler ignores such indentation anyway: it means you are expressing the structure
    of code in two different ways, one via statement brackets, and the other
    via indentation. This redundancy aids in understanding that the code does what you think it does.


    In languages with explicit blocking, the delimiters determine what the
    code does. The indents show the human reader what the code is supposed
    to do. These are, hopefully, the same thing - but they might not be.
    In Python, as there is only one source of blocking, there is no
    possibility of such an error (once you have ensured you have no mix of
    tabs and spaces).

    Redundancy is only a help if there is a way to automatically check and
    enforce consistency. Without that, redundancy can be worse than useless
    - if the two methods get out of sync, the casual reader will
    misunderstand the code, and the careful reader will see there is a
    problem but not know what it is.

    So for languages with explicit blocking, you need to be absolutely
    committed to keeping consistency, and use the tools you have - editors
    with automatic indents, gcc's "-Wmisleading-indentation" warning, and
    anything else to ease the cognitive burden and reduce the risk of inconsistencies.

    With Python, that is simply not an issue.


    (Another example of such redundancy is when people put comments saying
    what a piece of code does, rather than making the code itself clear.
    Changes to the code can easily lead to comments getting out of sync with
    the code, leading to confusion and misunderstanding.)


    Python gets rid of this redundancy, by having the compiler take notice of
    the whitespace and removing the statement bracketing symbols. So I put it back, by adding statement bracketing symbols that the compiler ignores.

    And that is worse than useless.

    At least with languages that have explicit block delimiters, the
    compiler will always have some checks on consistency. And tools (either compiler warnings, advanced editors, linters, etc.) can do more advanced checks. With comments, you have nothing.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Lawrence D'Oliveiro on Fri Aug 30 11:38:05 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 30/08/2024 00:57, Lawrence D'Oliveiro wrote:
    On Thu, 29 Aug 2024 14:24:01 +0200, David Brown wrote:

    def foo(a, b, c) :
    if a :
    if b :
    if c :
    doThis()

    That looks unfinished to me. So I will add a "return" at the end (with
    a single tab indent, in this case).

    A redundant “return” ... kind of like my redundant “#end” comments, except
    yours work in a more restricted set of places ...

    Yes - the restriction is a major advantage. Python can check it, and
    there are far fewer ways for the programmer to get it wrong.


    Don't you ever just accept that a language is the way it is, and it is
    perfectly useable that way?

    Of course not.

    How silly. You should work to improve the things you can, instead of
    wasting effort arguing with brick walls. If you want to get involved in
    the design and future of a language, that's fine, but few people have
    the time and skills needed or the opportunity to do it as serious paid
    work. Getting worked up about the way Python blocking works is about as productive as getting worked up about the way English language spelling
    works. There are countless other more useful ways to spend your time -
    and certainly many more enjoyable ways.


    Or think that perhaps other people in the world know better than you do
    about how they want their language to work?

    And vice versa.

    It's not your language, so there is no "vice versa".


    Has it never occurred to you that the people behind a given
    language - such as Python - considered various alternatives and decided
    that making it the way they did was the best choice overall for the
    language they wanted?

    Barring a few obvious stupidities, yes of course they were, and are, smart people.

    When there are a number of smart, experienced and educated people
    involved in the decisions, "obvious stupidities" are extremely unlikely.
    That's the point of involving multiple people and gathering opinions
    from many in the field.

    There can be design decisions that don't suit /you/ - but they were not designing a language for /you/. There can be design decisions that made
    sense at the time, but turned out to be unwise in the end. Those are
    not "obvious stupidities", even with 20/20 hindsight. And there can be compromises where it is known that a decision is bad in at least some
    ways, because it allows other better things to be done - again, not a "stupidity" even if the one aspect in isolation looks bad.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From candycanearter07@21:1/5 to Lawrence D'Oliveiro on Thu Sep 26 18:00:09 2024
    XPost: comp.unix.shell, comp.unix.programmer

    Lawrence D'Oliveiro <ldo@nz.invalid> wrote at 22:48 this Saturday (GMT):
    On Sat, 7 Sep 2024 18:30:03 -0000 (UTC), candycanearter07 wrote:

    Subjectively, I prefer early returns over nested ifs:

    Nested ifs nest, early returns don’t.


    Right, they remove some nesting which makes it easier to read.
    --
    user <candycane> is generated from /dev/urandom

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to All on Thu Sep 26 20:36:11 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Thu, 26 Sep 2024 18:00:09 -0000 (UTC), candycanearter07 wrote:

    Lawrence D'Oliveiro <ldo@nz.invalid> wrote at 22:48 this Saturday (GMT):

    On Sat, 7 Sep 2024 18:30:03 -0000 (UTC), candycanearter07 wrote:

    Subjectively, I prefer early returns over nested ifs:

    Nested ifs nest, early returns don’t.

    Right, they remove some nesting which makes it easier to read.

    Nestability helps with refactorability.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Muttley@dastardlyhq.com@21:1/5 to All on Fri Sep 27 08:03:43 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Thu, 26 Sep 2024 20:36:11 -0000 (UTC)
    Lawrence D'Oliveiro <ldo@nz.invalid> boringly babbled:
    On Thu, 26 Sep 2024 18:00:09 -0000 (UTC), candycanearter07 wrote:

    Lawrence D'Oliveiro <ldo@nz.invalid> wrote at 22:48 this Saturday (GMT):

    On Sat, 7 Sep 2024 18:30:03 -0000 (UTC), candycanearter07 wrote:

    Subjectively, I prefer early returns over nested ifs:

    Nested ifs nest, early returns don’t.

    Right, they remove some nesting which makes it easier to read.

    Nestability helps with refactorability.

    Hell it does. All it helps with is making the code harder to follow.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kalevi Kolttonen@21:1/5 to Lawrence D'Oliveiro on Fri Aug 16 14:57:15 2024
    XPost: comp.unix.shell, comp.unix.programmer

    In comp.unix.programmer Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
    On Thu, 15 Aug 2024 19:48:36 -0000 (UTC), Kalevi Kolttonen wrote:

    The last I checked, the O'Reilly Python book is just absolutely
    *MASSIVE*. The language has a huge number of features now ...

    No, it hasn’t. The core language reference spec is only a small fraction of, say, the Java language spec.

    Okay. I must confess that just seeing the book's size discouraged
    me from buying or reading it. Programming Python, 4th Edition by
    O'Reilly has whopping 1628 pages! This has to be one of the longest
    programming books ever published.

    It’s just that you can do so many things with Python. And that is down to the huge variety of off-the-shelf addon libraries that build on that core language spec. It has to be a strong, very solidly founded core in order
    to be such a versatile basis for these addons, and it is.

    So are you saying that most of the 1628 pages describe libraries
    instead of the core language?

    br,
    KK

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kalevi Kolttonen@21:1/5 to Kaz Kylheku on Fri Aug 16 15:02:20 2024
    XPost: comp.unix.shell, comp.unix.programmer

    In comp.unix.programmer Kaz Kylheku <643-408-1753@kylheku.com> wrote:
    On 2024-08-15, Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
    On Thu, 15 Aug 2024 19:48:36 -0000 (UTC), Kalevi Kolttonen wrote:

    The last I checked, the O'Reilly Python book is just absolutely
    *MASSIVE*. The language has a huge number of features now ...

    No, it hasn’t. The core language reference spec is only a small fraction >> of, say, the Java language spec.

    It’s just that you can do so many things with Python. And that is down to >> the huge variety of off-the-shelf addon libraries that build on that core
    language spec. It has to be a strong, very solidly founded core in order
    to be such a versatile basis for these addons, and it is.

    That's idiotic; you're saying that the standard library packages of
    Python are not part of Python, and do not contribute to its size.

    You seem to have a point. The core of C language is also small. I
    guess they even said in the original K & R book that C is a small
    language best described by a small book.

    But in order to do anything with C, you need to know the standard
    libraries. They have grown bigger and bigger during all these
    years. One could also well argue that to program on UNIX, you also
    need to know all the POSIX libraries.

    So it is indeed a vague question of what belongs in given programming languages.

    br,
    KK

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Stefan Ram@21:1/5 to Kalevi Kolttonen on Fri Aug 16 20:03:06 2024
    kalevi@kolttonen.fi (Kalevi Kolttonen) wrote or quoted:
    Okay. I must confess that just seeing the book's size discouraged
    me from buying or reading it. Programming Python, 4th Edition by
    O'Reilly has whopping 1628 pages! This has to be one of the longest >programming books ever published.

    I think the book market offers Python books large and small for
    people to choose according to their taste.

    You chose to focus on a book that does not please you because
    it's too large. Well, you could as well have chosen a tiny
    Python book and say it's too small! So your comment is more
    a criticism of your own choice of focus than of that book.

    So are you saying that most of the 1628 pages describe libraries
    instead of the core language?

    Well, I don't know that specific book, and so I cannot report
    its contents. But I don't think its author is named "O'Reilly".

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Kalevi Kolttonen on Fri Aug 16 23:27:18 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Fri, 16 Aug 2024 14:57:15 -0000 (UTC), Kalevi Kolttonen wrote:

    So are you saying that most of the 1628 pages describe libraries instead
    of the core language?

    I haven’t seen the book, but I would say most definitely. A good book
    would not just describe the libraries, but also how to use them
    effectively.

    There’s a decent amount in the standard Python libraries, but even more so
    in the huge number of third-party libraries. This is all part of the “batteries included” Python philosophy.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kaz Kylheku@21:1/5 to Lawrence D'Oliveiro on Sat Aug 17 01:01:05 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 2024-08-16, Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
    There’s a decent amount in the standard Python libraries, but even more so in the huge number of third-party libraries. This is all part of the “batteries included” Python philosophy.

    You can have all the batteries-included philosphy in the world, if the developers don't come to create all those libraries.

    Likewise, you can be set against "batteries included", yet be able to do nothing to stop an army of developers creating a package ecosystem.

    Philosophy does dick all, basically.

    Many current tools are structured completely contrary to the original philosophy behind their creation. Things that were supposed to be
    simple and small are anything but.

    People will crap on your worthless philosophy and do whatever they want.

    --
    TXR Programming Language: http://nongnu.org/txr
    Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
    Mastodon: @Kazinator@mstdn.ca

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Muttley@dastardlyhq.com@21:1/5 to All on Sat Aug 17 09:01:01 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Fri, 16 Aug 2024 15:02:20 -0000 (UTC)
    kalevi@kolttonen.fi (Kalevi Kolttonen) gabbled:
    So it is indeed a vague question of what belongs in given programming >languages.

    Indeed. And this gives rise to inconsistency. Why is threading now considered
    a core part of C++ but multi process isn't? Perhaps because Windows is hopeless at the latter in user space but it could just be personal preference within the C++ steering committee, who knows.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From D@21:1/5 to John Ames on Sat Aug 17 11:18:43 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Fri, 16 Aug 2024, John Ames wrote:

    On Fri, 16 Aug 2024 15:02:20 -0000 (UTC)
    kalevi@kolttonen.fi (Kalevi Kolttonen) wrote:

    You seem to have a point. The core of C language is also small. I
    guess they even said in the original K & R book that C is a small
    language best described by a small book.

    But in order to do anything with C, you need to know the standard
    libraries. They have grown bigger and bigger during all these
    years. One could also well argue that to program on UNIX, you also
    need to know all the POSIX libraries.

    What you *need* is also very much dependent on what you need to *do.*
    If all you're doing is batch-munging of files in some basic format, f'rexample, you don't particularly need to delve into POSIX esoterica
    or some whiz-bang Python bolt-on for frobbing the servos on a lunar
    probe while generating novel text from cosmic background radiation; you certainly can if you want to, but stdlib or the Python equivalent will
    get you there just fine.


    I have used bash for those use cases, and one benefit of that is that
    script from 10 or 15 years ago still work without any problems at all.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dmitry A. Kazakov@21:1/5 to Muttley@dastardlyhq.com on Sat Aug 17 12:58:31 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 2024-08-17 11:01, Muttley@dastardlyhq.com wrote:
    On Fri, 16 Aug 2024 15:02:20 -0000 (UTC)
    kalevi@kolttonen.fi (Kalevi Kolttonen) gabbled:
    So it is indeed a vague question of what belongs in given programming
    languages.

    Indeed. And this gives rise to inconsistency. Why is threading now considered a core part of C++ but multi process isn't? Perhaps because Windows is hopeless
    at the latter in user space but it could just be personal preference within the
    C++ steering committee, who knows.

    Windows inter-process API are far more advanced than what UNIX ever had.
    It would be enough to mention famous file locks. These days Linux has
    futex + file mapping. So, finally, you can create a system-wide mutex.
    Which under Windows is a single API call.
    The reason why processes are not included is that they are used to deal
    with some OS or design flaw that forces you to spawn some script or application. Then real-time embedded applications may have no processes
    at all.

    --
    Regards,
    Dmitry A. Kazakov
    http://www.dmitry-kazakov.de

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Lawrence D'Oliveiro on Fri Aug 23 13:36:43 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 23/08/2024 10:29, Lawrence D'Oliveiro wrote:
    On Fri, 23 Aug 2024 09:19:06 +0200, David Brown wrote:

    On 23/08/2024 02:19, Lawrence D'Oliveiro wrote:

    On Thu, 22 Aug 2024 12:47:16 +0200, David Brown wrote:

    But it is quite happy with
    mixtures of tabs and spaces as long as the result after tab-to-space
    conversion is consistent with Python syntax.

    Mixtures of tabs and spaces are accepted without complaint.

    I understood you to mean that different mixtures of tabs and spaces would work, so long as they were equivalent to the same indentation under the 8- spaces = 1 tab rule that you cited.

    That is what I was thinking, but I was not very clear or accurate.


    In fact there is no such equivalence rule. Tabs are tabs, and spaces are spaces, and never the twain shall be interconvertible.

    There /was/ such an equivalence rule in Python 2 - but it has been more restrictive in Python 3. I was not aware of the extent of the
    difference until recently.


    (The incompatibilities between Python 2 and Python 3 are another pain in
    Python.

    The fundamental problem was that Unicode was a mess in Python 2 that
    needed to be cleaned up. Since they had no choice but to break backward compatibility in that regard, they figured they would fix a few other
    things while they were at it.

    That's one thing - arguably quite a bit thing, but only one of many differences.

    Basically, there were lots of aspects of Python that they felt could be improved or done in better ways, but would break compatibility. Python
    has always had the philosophy that major version numbers did not need
    maximal compatibility - similar things happened between Python 1 and
    Python 2. The difference is that Python was massively more popular by
    the 2 to 3 change than it was at the 1 to 2 change, and there is still
    vast amounts of Python 2 code and libraries that are not available or
    easily convertible to Python 3.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Dmitry A. Kazakov on Fri Aug 23 22:52:27 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Fri, 23 Aug 2024 12:04:09 +0200, Dmitry A. Kazakov wrote:

    On 2024-08-23 10:29, Lawrence D'Oliveiro wrote:

    The fundamental problem was that Unicode was a mess in Python 2 that
    needed to be cleaned up. Since they had no choice but to break backward
    compatibility in that regard, they figured they would fix a few other
    things while they were at it.

    and again in Python 4... (:-))

    Apparently some Python developers were so spooked by all the badmouthing
    they received over the 2→3 transition that they have decided there will
    never be a “Python 4”.

    On the other hand, the deep-seated architectural changes going on with the removal of the GIL, and their potential for subtle backward-compatibility issues, seem to me like a good reason to say that the new versions should
    start numbering with 4.0.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Bart on Fri Aug 30 14:59:08 2024
    On 30/08/2024 01:49, Bart wrote:
    On 29/08/2024 13:24, David Brown wrote:
    On 28/08/2024 21:27, Bart wrote:
    On 28/08/2024 19:48, David Brown wrote:

    <snipping for brevity>

    It's just too 'open'. The contents of foo look like they're leaking into
    the rest of the program. As it is, someone looking at this in the future wanting to a a new statement to 'if a:' might think it ends before the comments since that 'anewstmt' is too far from the main body.

    It needs delimiters:


     def foo(a, b, c) :
          if a :
              if b :
                  if c :
                      doThis()
                  end
                  bnewstmt
               end

    # comment
    # comment
              anewstmt
          end
     end

    It does not /need/ delimiters.

    It does, sometimes, need a bit more care, especially if you have lots of nesting.

    (And again let me repeat - I prefer languages to have explicit
    delimiters. But that does not stop me being able to write Python code,
    or being happy with the language overall. There are a dozen things I
    dislike about Python, of which whitespace blocking is a very minor one,
    but there are many dozens more things I do like about it for the tasks
    for which I use the language.)


    Now you know that 'if a' doesn't end at that blank line, because no
    'end' has been seen for it.

    So I will add a "return" at the end (with a single tab indent, in this
    case).  If it is not the end of the function, I will sometimes use a
    "pass" to pull back the indent level.

    So you have problems too. Would you have needed 'return' if 'end's had
    been used in the original?

    I have, as I have said in several posts, added a "return" to make code
    clearer. I probably wouldn't have added them if Python had explicit
    block delimiters - I rarely have a plain "return" at the end of C
    functions (with no return type).

    But just because I sometimes add a "return" at the end of functions does
    not mean I see its use of indents for blocks as a problem. It's just different. And if an occasional "return" makes things clear, then the "problem" is solved simply and effortlessly, and is no longer a "problem".


    Of course, being a sane software developer, I do most of my
    programming using editors that are suitable for software development.
    Most professional carpenters use hammers for their nails, rather than
    bashing them in with stones - it's the same thing, really.


    And yet another, of more significance, if that after you've indented
    a block, it may now merge into an adjacent block that was already at
    that new indent. If you later need to revert that first block back to
    it's original position, you'd better make sure you mark that boundary.


    So mark the boundary.  Add a blank line.  Put a comment line
    describing the steps of the function.  You are making up problems for
    which you already have good solutions that you would be using in any
    programming language.

    How about just fixing the ******* language? That must be better than a million programmers wasting time creating their own fixes.

    Ah, so it is better to invalidate all the work done by these million programmers so far, along with all the tools, books, courses,
    documentation, etc., than to say that people writing big functions might
    want to add an occasional comment? Yes, I can see how that makes
    perfect sense.


    Having made your own language(s) gives you no more and no less right
    to comment about features of other languages that you like or dislike.


    I had my opinions even before I used my own stuff.


    Sure. We all have opinions about all sorts of things. Some people even
    have /informed/ opinions, that might be relevant to other people.

    One thing I despised was the begin-end business in Algol60 and Pascal,
    which has the same nuisance as braces in C-like languages.


    You don't like whitespace based blocks, and you don't like explicit
    delimiters for blocks. Maybe you just don't like structured
    programming? (Not all programming languages are structured.)

    I didn't like writing 'end else begin' any more than '} else {'. My
    stuff (and a few languages have picked up on it), uses just 'else',
    which also limits the placement possibilities when you have one token
    rather than three.


    Ah, it is the need to press a couple of extra keys that you despise so much?


    Your problem here is that you are obsessed with finding things that
    you want to see as misfeatures, design flaws, or problems in other
    languages

    Yes. I'm into language design. But I'm also interested in aspects of it
    that many disregard, such as microfeatures, or ease of deployment.


    That's great. But being interested in languages, their design, and
    their features does not mean having an obsession about calling their
    features "flaws".

    - and then obsess about how you can find new ways to make it more
    difficult to "work around" them.

    Fortunately I don't need to work with them much. If I did, I would find
    the means to make them tolerable.


    For someone who doesn't use programming languages much (other than
    perhaps your own ones), you certainly spend a lot of time complaining
    about them!


    Don't you ever just accept that a language is the way it is, and it is
    perfectly useable that way?

    Well, I used Fortran IV for a year. But presumably lots of people
    weren't that happy with it as we've since had Fortran 77, 90, 95, 2008,
    2018 and 2023.

    It's not just me!


    For every programmer involved in changing and developing the Fortran
    language, there are a thousand programmers who use it - whichever
    version of it they find best for their job. Now, it is important that
    these one-in-a-thousand programmers are there, improving the language.
    But most of us are in the 999-in-a-thousand group that /use/ the
    language. (In that one-in-a-thousand I am including the people who
    actively take part in discussions or proposals for changing the
    language, but not people who just moan about stuff in discussion groups.)

    Clearly you can take your own complaints seriously for your own
    languages, and they are very important to you personally. But in the
    grand scheme of things, they are utterly irrelevant to everyone else.
    So you are also in the 999-in-a-thousand group, just like everyone else
    here.

    Complaining about languages (or any kind of tool) doesn't change them -
    it doesn't do anything except make you less happy about using them.
    It's fine to discuss alternative ways to handle aspects of a language
    that you don't like, and to see if you can make it work better for your
    needs and preferences. It's fine to compare it to other languages, and
    see if there are alternatives that would suit you better. And sometimes
    having a rant is fun - after all, complaining (especially about the
    weather) is the national pastime for Brits. But mostly it is counter-productive.



      Or think that perhaps other people in the world know better than you
    do about how they want their language to work?  Has it never occurred
    to you that the people behind a given language - such as Python -
    considered various alternatives and decided that making it the way
    they did was the best choice overall for the language they wanted?

    Python is full of ill-advised choices. And it's become almost as much of
    a monster as C++, with a million incompatible features bolted on.


    So don't use it if you don't like it. Mushy peas are an ill-advised
    choice - I choose not to eat them, rather than to go to cookery groups
    and tell everyone how horrible they are.

    I'm not surprised that mere matters of syntax have low priority.


    As Bjarne Stustroup said, there are two kinds of programming languages
    - those that people complain about, and those that no one uses.


    Funny, I can complain about lots of languages that I never use!

    Yes, and no one takes your opinions seriously. Do you think there might
    be some reason for that?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From vallor@21:1/5 to Keith.S.Thompson+u@gmail.com on Fri Aug 30 14:01:14 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Thu, 29 Aug 2024 16:57:21 -0700, Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote in <87zfou9926.fsf@nosuchdomain.example.com>:

    Lawrence D'Oliveiro <ldo@nz.invalid> writes:
    [...]
    Think about why you bother to indent code in languages where the
    compiler ignores such indentation anyway: it means you are expressing
    the structure of code in two different ways, one via statement
    brackets, and the other via indentation. This redundancy aids in
    understanding that the code does what you think it does.

    Python gets rid of this redundancy, by having the compiler take notice
    of the whitespace and removing the statement bracketing symbols. So I
    put it back, by adding statement bracketing symbols that the compiler
    ignores.

    You might find Bython useful.

    https://github.com/mathialo/bython

    (I don't, but you might.)

    Thank you for the pointer.

    (Had been wondering if there was something like "ratfor
    for python", and here it is. :) )

    --
    -v

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Scott Lurndal@21:1/5 to Lawrence D'Oliveiro on Fri Aug 30 14:33:31 2024
    XPost: comp.unix.shell, comp.unix.programmer

    Lawrence D'Oliveiro <ldo@nz.invalid> writes:
    On Thu, 29 Aug 2024 18:44:35 +0200, Janis Papanagnou wrote:

    Vim is an editor that has the most simple and also very powerful
    indenting for well structured data and programs I've yet seen. (Not
    mentioning its equally powerful other editing facilities.)

    Vim is only good for text-editing, though

    Again, L'D'O' is wrong.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Bart@21:1/5 to David Brown on Fri Aug 30 15:55:36 2024
    On 30/08/2024 13:59, David Brown wrote:
    On 30/08/2024 01:49, Bart wrote:
    On 29/08/2024 13:24, David Brown wrote:
    On 28/08/2024 21:27, Bart wrote:
    On 28/08/2024 19:48, David Brown wrote:

    <snipping for brevity>

    It's just too 'open'. The contents of foo look like they're leaking
    into the rest of the program. As it is, someone looking at this in the
    future wanting to a a new statement to 'if a:' might think it ends
    before the comments since that 'anewstmt' is too far from the main body.

    It needs delimiters:


      def foo(a, b, c) :
           if a :
               if b :
                   if c :
                       doThis()
                   end
                   bnewstmt
                end

    # comment
    # comment
               anewstmt
           end
      end

    It does not /need/ delimiters.

    There's lot of things that language syntax might not need. For example,
    I could dispense with the closing parentheses here:

    x = (a + (b + (c + d

    as they can supplied as needed at end-of-line. But it's much better idea
    to supply them for all sorts of reasons.

    (My Casio calculator allows such parentheses to be left out.)

    It does, sometimes, need a bit more care, especially if you have lots of nesting.

    A /lot/ more care.

    (And again let me repeat - I prefer languages to have explicit
    delimiters.  But that does not stop me being able to write Python code,
    or being happy with the language overall.  There are a dozen things I dislike about Python, of which whitespace blocking is a very minor one,
    but there are many dozens more things I do like about it for the tasks
    for which I use the language.)

    I just find the syntax fragile.

    How about just fixing the ******* language? That must be better than a
    million programmers wasting time creating their own fixes.

    Ah, so it is better to invalidate all the work done by these million programmers so far, along with all the tools, books, courses,
    documentation, etc., than to say that people writing big functions might
    want to add an occasional comment?  Yes, I can see how that makes
    perfect sense.

    If you're going fix it, then fix up, and not wait 30+ years to do so!

    But there can be ways to do it without needing to change existing code
    or tools.


    Having made your own language(s) gives you no more and no less right
    to comment about features of other languages that you like or dislike.


    I had my opinions even before I used my own stuff.


    Sure.  We all have opinions about all sorts of things.  Some people even have /informed/ opinions, that might be relevant to other people.

    One thing I despised was the begin-end business in Algol60 and Pascal,
    which has the same nuisance as braces in C-like languages.


    You don't like whitespace based blocks, and you don't like explicit delimiters for blocks.  Maybe you just don't like structured
    programming?  (Not all programming languages are structured.)

    Both brace-style (and especially C-style optional braces) and
    indent-based have their problems.


    I didn't like writing 'end else begin' any more than '} else {'. My
    stuff (and a few languages have picked up on it), uses just 'else',
    which also limits the placement possibilities when you have one token
    rather than three.


    Ah, it is the need to press a couple of extra keys that you despise so
    much?

    no, it's just poor ergonomics. Language designers must have thought it
    neat to allow only a single statement for function bodies, loop bodies,
    or branches of conditional code.

    If someone wanted more than one statement, they wrapped them inside a 'compound' statement (and hence you ended up with conditional '{-}' and conditional 'begin-end'.

    But look at these examples:

    if (cond) {s1; s2;} else {s3; s4;}
    if cond then begin s1; s2 end else begin s3; s4 end

    It's clear that those first sets of block delimiters are not needed: s1
    and s2 are already delimited by ') ... else' or 'then ... else'.

    A delimiter is only really needed at the end of the final 'else' block:

    if (cond) s1; s2; else s3; s4;}
    if cond then s1; s2 else s3; s4 end

    With the second line, it works (this is what Algol68 introduced, and
    what I copied).

    But that first line looks weird with its unbalanced closing }. There can
    also be a problem if you wanted to dispense with the brackets around
    '(cond)', as now 'cond' runs into 's1'.

    So C-style syntax is not an easy fix; better to leave it.

    Note that Python does use block delimiters in some cases:

    if cond:
    s1
    s2
    else
    s3
    s4

    Like the 'else' here. It is the one for the final block that is missing.

    Yes. I'm into language design. But I'm also interested in aspects of
    it that many disregard, such as microfeatures, or ease of deployment.


    That's great.  But being interested in languages, their design, and
    their features does not mean having an obsession about calling their
    features "flaws".

    Are you saying that no language (C for example) has flaws?

    If not, then why can't I call them flaws?

    It's not just me!


    For every programmer involved in changing and developing the Fortran language, there are a thousand programmers who use it - whichever
    version of it they find best for their job.  Now, it is important that
    these one-in-a-thousand programmers are there, improving the language.
    But most of us are in the 999-in-a-thousand group that /use/ the
    language.  (In that one-in-a-thousand I am including the people who
    actively take part in discussions or proposals for changing the
    language, but not people who just moan about stuff in discussion groups.)

    So I don't count?

    Apparently I'm in the 999/1000 group even though I don't use those
    languages. But I can't be in the 1/1000 group because I'm not involved
    in those languages.

    So I guess I'm nowhere.

    Clearly you can take your own complaints seriously for your own
    languages, and they are very important to you personally.  But in the
    grand scheme of things, they are utterly irrelevant to everyone else. So
    you are also in the 999-in-a-thousand group, just like everyone else here.

    Not really. You just want to belittle the stuff I do.

    Pretty much everything I've complained about in a mainstream language,
    is something that I've fixed in my own products. So I know much work
    that was to do, how well it worked, or whether it failed, or if I
    decided it wasn't worthwhile.

    People in the 999/1000 group don't normally run their own languages, or
    manage their own implementations of existing languages, to try such experiments.

    In my case the experiment has been running since 1982.



    Complaining about languages (or any kind of tool) doesn't change them -
    it doesn't do anything except make you less happy about using them. It's
    fine to discuss alternative ways to handle aspects of a language that
    you don't like, and to see if you can make it work better for your needs
    and preferences.  It's fine to compare it to other languages, and see if there are alternatives that would suit you better.  And sometimes having
    a rant is fun - after all, complaining (especially about the weather) is
    the national pastime for Brits.  But mostly it is counter-productive.

    You still get it. I can actually change my 'weather'! You're just jealous.

    Python is full of ill-advised choices. And it's become almost as much
    of a monster as C++, with a million incompatible features bolted on.


    So don't use it if you don't like it.  Mushy peas are an ill-advised
    choice - I choose not to eat them, rather than to go to cookery groups
    and tell everyone how horrible they are.

    This isn't a Python group nor a C group. Any language can be discussed including private ones.


    Funny, I can complain about lots of languages that I never use!

    Yes, and no one takes your opinions seriously.  Do you think there might
    be some reason for that?

    You don't, certainly.

    I have to keep reminding you, the stuff I do isn't just mouthing off, it
    is actually implementing things. And it's not just toy hobbyist stuff
    either, it's *what I used to earn a living*.

    Even last century I could write stuff like this:

    [10]int a, b

    a := b

    This copies array b to a. Even after 50 years, C can't do this, you have
    to write (AFTER including string.h, jesus..):

    memcpy(a, b, sizeof(a)/sizeof(a[0]));

    But here a compiler can't check that a and b are the same size, or even
    of the same type! Nor can it check I've supplied the right size.

    According to you however, I'm not allowed to point out such shortcomings
    or 'flaws' in a language, because I don't have any clout.

    So, the flaws don't exist, or do they only exist if that 1/1000 Alpha individual says they do?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to John Ames on Fri Aug 30 18:54:54 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 30/08/2024 17:28, John Ames wrote:
    On Fri, 30 Aug 2024 11:38:05 +0200
    David Brown <david.brown@hesbynett.no> wrote:

    Getting worked up about the way Python blocking works is about as
    productive as getting worked up about the way English language
    spelling works. There are countless other more useful ways to spend
    your time - and certainly many more enjoyable ways.

    Some people actually enjoy arguing on the Internet, y'know.

    Up to a point, I agree. Where would the internet be without arguments?
    Cat videos and porn, I suppose.

    But sometimes I think discussions could be a little more informative and
    a little less repetitive ranting. Occasionally it is also nice to learn something new from the internet. (I actually learned from this thread
    that Python 3 is better at checking for mixed tabs and spaces than
    Python 2 was.)


    When there are a number of smart, experienced and educated people
    involved in the decisions, "obvious stupidities" are extremely
    unlikely. That's the point of involving multiple people and gathering
    opinions from many in the field.

    You may consider it as "unlikely" as you wish, but the fact is that
    literal whitespace has been considered Obviously Stupid in the computer- programming world for so long that it was the subject of a joke re: JCL
    in "Real Programmers Don't Use Pascal," published in 1983.

    That's not to say that "considered Obviously Stupid" is the same thing
    as "objectively wrong" - but if your argument is that all of this is on
    equal footing as Just Opinions, discounting decades of established
    opinion across the industry in preference to the opinions of the subset
    of Python developers & advocates who believe in literal whitespace as Unambiguously Good rather gives the lie to that.


    Python is a hugely popular language, with whitespace for blocks. C, C++
    and Java are hugely poplar languages with braces as delimiters. I don't
    see how anyone can get an "established opinion" from that.

    But to be fair, the worst case of significant whitespace /was/ obviously
    stupid - that is makefiles treating tabs and spaces differently. The
    original author of make said himself that it was a daft idea, but
    unfortunately the utility took off in popularity so quickly that it
    could not be rectified.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to John Ames on Fri Aug 30 18:42:33 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 30/08/2024 17:14, John Ames wrote:
    On Thu, 29 Aug 2024 21:27:36 +0200
    David Brown <david.brown@hesbynett.no> wrote:

    /All/ languages, except perhaps Bart's private language that is only
    used by him, have their annoyances. I have worked at least a little
    with a fair number of languages, and I've never seen one that I
    thought was "perfect". But different people have different things
    that the like and dislike about any given language.

    So if you have the choice of which language to use (many programmers
    do not), you pick one that has more things you like for the task in
    question in comparison to the things you don't like.

    Sure - but picking one that best suits your needs doesn't mean you
    can't critique its annoyances/flaws. This team-sports mentality is just weird.

    (I gather the politically correct response to that is "I'm not weird -
    /you/ are weird" :-) )

    There's a difference between critiquing something and saying the
    language designers were stupid. I can say I prefer explicit blocking delimiters. I can give reasons why I think those are better than
    white-space based blocks. But to have any kind of useful discussion,
    you need to be able to consider what advantages the alternatives have,
    and think about why some people might have different opinions. Writing
    "I get lost with white-space indentation and have to add lots of
    comments - therefore the language is flawed and the designers made
    stupid decisions" is not helpful critique - it's just ranting.

    Of course you will find things you dislike about any language you use.
    And discussing those things, and ways to mitigate their impact, is also
    fine. It's the "this language is fundamentally flawed because /I/
    dislike a particular aspect of it" attitude I disagree with.


    But it's important to understand that these are opinions - the
    designers of Python were /not/ stupid to have made the language that
    way. They just had different opinions from you, and the had a much
    better basis for forming those opinions than you or I.

    Yeah, well, your opinion that my opinion is just, like, my opinion is
    just, like, your opinion, man.


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Muttley@dastardlyhq.com@21:1/5 to All on Fri Aug 30 19:20:10 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Fri, 30 Aug 2024 08:14:21 -0700
    John Ames <commodorejohn@gmail.com> gabbled:
    On Thu, 29 Aug 2024 21:27:36 +0200
    David Brown <david.brown@hesbynett.no> wrote:

    /All/ languages, except perhaps Bart's private language that is only
    used by him, have their annoyances. I have worked at least a little
    with a fair number of languages, and I've never seen one that I
    thought was "perfect". But different people have different things
    that the like and dislike about any given language.

    So if you have the choice of which language to use (many programmers
    do not), you pick one that has more things you like for the task in
    question in comparison to the things you don't like.

    Sure - but picking one that best suits your needs doesn't mean you
    can't critique its annoyances/flaws. This team-sports mentality is just >weird.

    Some insecure people feel an attack on their favourite language is some kind
    of attack or slight against them personally. Its a pathetic and juvenile trait that unfortunately is found a lot amongst IT types.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Muttley@dastardlyhq.com@21:1/5 to All on Fri Aug 30 19:17:47 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Thu, 29 Aug 2024 21:36:08 +0200
    David Brown <david.brown@hesbynett.no> gabbled:
    On 29/08/2024 18:44, Janis Papanagnou wrote:
    On 29.08.2024 14:30, David Brown wrote:
    On 29/08/2024 09:28, Muttley@dastardlyhq.com wrote:
    [...]

    Then don't use vim - use an editor that suits your needs.

    LOL. (You appear to be joking. - If not, continue reading...)


    I was not joking.

    But what makes you think that his needs are not covered by Vim?

    You seem to have missed the point - sorry if I was not clear.

    The irony :)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From D@21:1/5 to Scott Lurndal on Fri Aug 30 23:36:07 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Fri, 30 Aug 2024, Scott Lurndal wrote:

    Lawrence D'Oliveiro <ldo@nz.invalid> writes:
    On Thu, 29 Aug 2024 18:44:35 +0200, Janis Papanagnou wrote:

    Vim is an editor that has the most simple and also very powerful
    indenting for well structured data and programs I've yet seen. (Not
    mentioning its equally powerful other editing facilities.)

    Vim is only good for text-editing, though

    Again, L'D'O' is wrong.


    This is the truth! Nothing of value in his posts.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Bart on Sat Aug 31 00:00:17 2024
    On Fri, 30 Aug 2024 15:55:36 +0100, Bart wrote:

    There's lot of things that language syntax might not need. For example,
    I could dispense with the closing parentheses here:

    x = (a + (b + (c + d

    as they can supplied as needed at end-of-line.

    Then you can’t continue an expression across multiple lines.

    There was one language vaguely I recall (might have been a Lisp dialect)
    where a single “]” would be interpreted as closing all currently-unmatched “(”. Scheme, I believe, realizes that long lines of “))))” just make the
    (human) reader’s eyes glaze over, so they allow “[” and “]” with the same
    meanings as “(” and “)”, but you must pair like with like. As if “)])]” is
    much of an improvement.

    People can, and do, experiment with many different ideas in programming languages.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to David Brown on Fri Aug 30 23:42:31 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Fri, 30 Aug 2024 11:38:05 +0200, David Brown wrote:

    You should work to improve the things you can, instead of
    wasting effort arguing with brick walls.

    Which is exactly what I have been doing. You are just another of those
    trying to dispute my techniques.

    It's not your language, so there is no "vice versa".

    It’s open source. It’s *everybody*’s language.

    Barring a few obvious stupidities, yes of course they were, and are,
    smart people.

    When there are a number of smart, experienced and educated people
    involved in the decisions, "obvious stupidities" are extremely unlikely.

    Now I know you haven’t used Python that much.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Keith Thompson on Fri Aug 30 23:52:12 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Wed, 28 Aug 2024 19:19:38 -0700, Keith Thompson wrote:

    My impression is that your unconventional style indicates a relative
    lack of experience in Python.

    You think maybe I should practise by writing more Python code?

    OK, how about your thoughts on comparing this

    for attrname in obj.tag_attrs :
    attr = getattr(obj, attrname)
    if attr != None :
    if isinstance(attr, enum.Enum) :
    attr = attr.value
    elif isinstance(attr, Type) :
    attr = unparse_signature(attr)
    elif not isinstance(attr, str) :
    raise TypeError("unexpected attribute type %s for %s" % (type(attr).__name__, repr(attr)))
    attrs.append("%s=%s" % (attrname, quote_xml_attr(attr)))
    out.write(" " * indent + "<" + tag_name)

    with this

    for attrname in obj.tag_attrs :
    attr = getattr(obj, attrname)
    if attr != None :
    if isinstance(attr, enum.Enum) :
    attr = attr.value
    elif isinstance(attr, Type) :
    attr = unparse_signature(attr)
    elif not isinstance(attr, str) :
    raise TypeError("unexpected attribute type %s for %s" % (type(attr).__name__, repr(attr)))
    attrs.append("%s=%s" % (attrname, quote_xml_attr(attr)))
    out.write(" " * indent + "<" + tag_name)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to David Brown on Fri Aug 30 23:49:51 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Thu, 29 Aug 2024 14:05:41 +0200, David Brown wrote:

    ... put in so much extra
    crap and silliness that readers get caught up in that instead of
    noticing that most of the function is meaningless.

    Interesting. Now you are trying to claim that, because you don’t
    understand what the code does, that makes it somehow “meaningless”?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Bart@21:1/5 to Keith Thompson on Sat Aug 31 10:51:45 2024
    On 31/08/2024 05:37, Keith Thompson wrote:
    Lawrence D'Oliveiro <ldo@nz.invalid> writes:
    On Wed, 28 Aug 2024 19:19:38 -0700, Keith Thompson wrote:
    My impression is that your unconventional style indicates a relative
    lack of experience in Python.

    You think maybe I should practise by writing more Python code?

    And you snipped the part where I acknowledged that might be an invalid conclusion. I have no opinion on what you should do.

    OK, how about your thoughts on comparing this

    for attrname in obj.tag_attrs :
    attr = getattr(obj, attrname)
    if attr != None :
    if isinstance(attr, enum.Enum) :
    attr = attr.value
    elif isinstance(attr, Type) :
    attr = unparse_signature(attr)
    elif not isinstance(attr, str) :
    raise TypeError("unexpected attribute type %s for %s" % (type(attr).__name__, repr(attr)))
    attrs.append("%s=%s" % (attrname, quote_xml_attr(attr)))
    out.write(" " * indent + "<" + tag_name)

    with this

    for attrname in obj.tag_attrs :
    attr = getattr(obj, attrname)
    if attr != None :
    if isinstance(attr, enum.Enum) :
    attr = attr.value
    elif isinstance(attr, Type) :
    attr = unparse_signature(attr)
    elif not isinstance(attr, str) :
    raise TypeError("unexpected attribute type %s for %s" % (type(attr).__name__, repr(attr)))
    attrs.append("%s=%s" % (attrname, quote_xml_attr(attr)))
    out.write(" " * indent + "<" + tag_name)

    The difference is obvious: the second calls attrs.append() even if attr
    is None. I don't know what point you're trying to make.


    Was it? I was convinced he'd posted exactly the same code by mistake,
    even though my brain told me there something that about them that didn't
    match. It took me nearly a minute to spot the difference.

    I don't know how much quicker it would have been with 'end' delimiters,
    but then the versions would have been:

    end
    A...
    end

    and:
    end
    end
    A...

    instead of:

    A...
    and:

    A...

    Disregarding indentation, it's (end, A, end) vs (end, end A) instead of
    (A) and (A).

    I think it would have been more obvious than with no 'end's.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Janis Papanagnou@21:1/5 to Lawrence D'Oliveiro on Sat Sep 14 10:06:12 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 30.08.2024 04:53, Lawrence D'Oliveiro wrote:
    On Thu, 29 Aug 2024 18:44:35 +0200, Janis Papanagnou wrote:

    Vim is an editor that has the most simple and also very powerful
    indenting for well structured data and programs I've yet seen. (Not
    mentioning its equally powerful other editing facilities.)

    Vim is only good for text-editing, though.

    "Only"? - Yes, Vim is a text-editor. (With only few functions beyond.)
    And it does that in an excellent most efficient way I've not yet seen
    in any other text editor. (Exactly what I need for universal editing
    of any text. YMMV.)

    It assumes a file is split into
    lines. Emacs makes no such assumption, and can also edit non-text files.

    You have obviously no clue.

    Janis

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Janis Papanagnou@21:1/5 to David Brown on Sat Sep 14 09:59:46 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 29.08.2024 21:36, David Brown wrote:
    On 29/08/2024 18:44, Janis Papanagnou wrote:
    On 29.08.2024 14:30, David Brown wrote:
    On 29/08/2024 09:28, Muttley@dastardlyhq.com wrote:
    [...]

    Then don't use vim - use an editor that suits your needs.
    [...]

    But what makes you think that his needs are not covered by Vim?

    You seem to have missed the point - sorry if I was not clear.

    He complained that he didn't want to learn complicated macros in Vim
    just to be able to indent or un-indent lines of code. The solution is obvious - he should use an editor other than Vim.

    This is not what I'd call a solution. I'd call it elusion; and in both
    senses - if he didn't use his editor for that space-indenting because
    he doesn't know how to do it he could look that up, but it is not any
    issue to do that, only more laborious than indenting brace structures,
    and the suggestion to switch to another tool is also elusive because
    it doesn't address the issue (he would still have to learn how to do
    it in any other tool). - But that was not the point.


    He could, of course, learn how to use Vim. It's a perfectly good editor
    with a lot of features. [...]

    The point was about language design and (well known) problems with a
    design that uses white-space for semantical purposes. That the brace
    structures can usually be edited in better, simpler ways (beyond also
    providing safety etc. using a more sophisticated designed language).


    There are more than enough decent editors to choose from, that cover the basic needs of programmers. Some people use one editor for everything, others use a range for different purposes - whatever suits you. But it
    is pretty absurd to complain that it is difficult to indent code just
    because you (i.e., Muttley) think it is hard to do in one particular
    editor.

    As said; it was about "the language was designed properly"[Muttley].
    And saying that switching the editor would solve something here is
    just missing the point.

    You can (also in Vim) write macros, as you correctly imply, or do
    all the things that you can do with "other tools" (but only equally
    laborious as in these other tools) as I already said. You can also
    (for that specific IMO mis-designed language) enable "folding" (by
    spaces) in Vim to not have to write macros (and not littering the
    standard editor environment) that makes it comparably simply to do
    the indentation more comfortably with less keystrokes. But nothing
    beats the editing of parenthesized structures. (And doesn't change
    any language mis-design.) YMMV.

    Janis

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Janis Papanagnou@21:1/5 to Muttley@dastardlyhq.com on Sat Sep 14 10:16:35 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On 30.08.2024 21:20, Muttley@dastardlyhq.com wrote:
    On Fri, 30 Aug 2024 08:14:21 -0700
    John Ames <commodorejohn@gmail.com> gabbled:
    [...]
    Sure - but picking one that best suits your needs doesn't mean you
    can't critique its annoyances/flaws. This team-sports mentality is just
    weird.

    Some insecure people feel an attack on their favourite language is some kind of attack or slight against them personally. Its a pathetic and juvenile trait
    that unfortunately is found a lot amongst IT types.

    It's not restricted to languages or IT-stuff; you can see it with
    books or films or music or political or religious preferences...

    In IT we had as well various "wars" in the past. More considerate
    folks avoid such wars (and respect diversity of thoughts/opinions
    and preferences) by focusing on the facts alone. Other folks feel
    an urge to (unnecessarily) ignite them.

    Janis

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Janis Papanagnou on Sat Sep 14 09:34:35 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Sat, 14 Sep 2024 10:06:12 +0200, Janis Papanagnou wrote:

    On 30.08.2024 04:53, Lawrence D'Oliveiro wrote:

    Emacs makes no such assumption, and can also edit non-text files.

    You have obviously no clue.

    I have actually used it for that. That’s my “clue” to you.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Muttley@dastardlyhq.com@21:1/5 to All on Sat Sep 14 09:25:23 2024
    XPost: comp.unix.shell, comp.unix.programmer

    On Sat, 14 Sep 2024 10:16:35 +0200
    Janis Papanagnou <janis_papanagnou+ng@hotmail.com> gabbled:
    On 30.08.2024 21:20, Muttley@dastardlyhq.com wrote:
    On Fri, 30 Aug 2024 08:14:21 -0700
    John Ames <commodorejohn@gmail.com> gabbled:
    [...]
    Sure - but picking one that best suits your needs doesn't mean you
    can't critique its annoyances/flaws. This team-sports mentality is just
    weird.

    Some insecure people feel an attack on their favourite language is some kind >> of attack or slight against them personally. Its a pathetic and juvenile >trait
    that unfortunately is found a lot amongst IT types.

    It's not restricted to languages or IT-stuff; you can see it with
    books or films or music or political or religious preferences...

    True. Usually people with fragile egos and/or low self esteem who validate themselves via some belief or preference.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)