• The Value of a 2nd Look At Code

    From c186282@3:633/10 to All on Saturday, January 24, 2026 21:55:28
    Looking for something to do this past week I decided
    to take a look at a couple of older Python scripts
    that help with my video security setup.

    They worked ... however on review it's amazing that
    they did work. Messy patched and re-patched and
    re-patched code, lots of flags, hard to even follow
    the themes.

    So ... went at them. Both are now nearly half the
    size and the logic is much improved and CAN be
    followed. Only ONE de-facto flag now for a bit
    that had to be 'adaptive'. Co-running processes
    are prevented, confirmation that what's supposed
    to be running IS running now too. Better, more
    detailed logging.

    All in about half the space.

    So ... "I made it work" may be good, but "I made
    it work WELL" is the GOAL.


    --- PyGate Linux v1.5.5
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Stéphane CARPENTIER@3:633/10 to All on Sunday, January 25, 2026 11:07:20
    Le 25-01-2026, c186282 <c186282@nnada.net> a ‚critÿ:

    So ... went at them. Both are now nearly half the
    size and the logic is much improved and CAN be
    followed. Only ONE de-facto flag now for a bit
    that had to be 'adaptive'. Co-running processes
    are prevented, confirmation that what's supposed
    to be running IS running now too. Better, more
    detailed logging.

    All in about half the space.

    So ... "I made it work" may be good, but "I made
    it work WELL" is the GOAL.

    It's always like that: first you make it work then you improve it. Well,
    a lot of times, the process stops when it works. I don't remember who
    said that code is not finish when there is nothing more to add but when
    there is nothing more to remove.

    That's why it's stupid to consider the best programmer as the one who
    produce more lines of code than others.

    And, from what I saw, actually, the AI produce a lot of code which must
    be removed.

    --
    Si vous avez du temps … perdre :
    https://scarpet42.gitlab.io

    --- PyGate Linux v1.5.5
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Charlie Gibbs@3:633/10 to All on Sunday, January 25, 2026 17:14:39
    On 2026-01-25, St‚phane CARPENTIER <sc@fiat-linux.fr> wrote:

    Le 25-01-2026, c186282 <c186282@nnada.net> a ‚critÿ:

    So ... went at them. Both are now nearly half the
    size and the logic is much improved and CAN be
    followed. Only ONE de-facto flag now for a bit
    that had to be 'adaptive'. Co-running processes
    are prevented, confirmation that what's supposed
    to be running IS running now too. Better, more
    detailed logging.

    All in about half the space.

    So ... "I made it work" may be good, but "I made
    it work WELL" is the GOAL.

    It's always like that: first you make it work then you improve it.

    FSVO "improve". In many cases this means "make money", even
    (or especially) at the expense of quality in the traditional sense.

    Well, a lot of times, the process stops when it works. I don't remember
    who said that code is not finish when there is nothing more to add but
    when there is nothing more to remove.

    Antoine de Saint-Exup‚ry

    That's why it's stupid to consider the best programmer as the one who
    produce more lines of code than others.

    Unless you're being paid by the line.

    And, from what I saw, actually, the AI produce a lot of code which must
    be removed.

    Reminds me of my early days when I'd take over maintenance of someone
    else's code - or code that "just grew". I'd typically reduce the line
    count by 30% - or even 50% in some cases.

    --
    /~\ Charlie Gibbs | Growth for the sake of
    \ / <cgibbs@kltpzyxm.invalid> | growth is the ideology
    X I'm really at ac.dekanfrus | of the cancer cell.
    / \ if you read it the right way. | -- Edward Abbey

    --- PyGate Linux v1.5.5
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Sunday, January 25, 2026 19:16:30
    On 25 Jan 2026 11:07:20 GMT, St‚phane CARPENTIER wrote:

    That's why it's stupid to consider the best programmer as the one
    who produce more lines of code than others.

    I once took a program of about 8000 lines of code, written by someone
    else, and cut its size in half.

    Actually the basic idea behind the simplification was very simple. The
    program was a plugin doing import and export of object definitions
    between the host application?s internal format and an external
    database. The import function was one gigantic sequence of handlers
    for all the database fields, which generated corresponding attributes
    for application objects, while the export function went the other way.

    What I did was replace the bulk of both functions with a single table
    of the correspondences between the two data representations. That
    shrank the import and export functions down to just a couple of dozen
    lines each -- they became just interpreters of table entries. I also
    found some discrepancies between the two original functions, which
    disappeared as a result of using the common table.

    This is called ?data-driven? or ?table-driven? programming. It?s quite
    a common technique for reducing code size. Less code to write means
    less code to maintain going forward, and less opportunity for bugs to
    sneak in. Win-win.

    --- PyGate Linux v1.5.5
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From c186282@3:633/10 to All on Sunday, January 25, 2026 21:52:08
    On 1/25/26 12:14, Charlie Gibbs wrote:
    On 2026-01-25, St‚phane CARPENTIER <sc@fiat-linux.fr> wrote:

    Le 25-01-2026, c186282 <c186282@nnada.net> a ‚critÿ:

    So ... went at them. Both are now nearly half the
    size and the logic is much improved and CAN be
    followed. Only ONE de-facto flag now for a bit
    that had to be 'adaptive'. Co-running processes
    are prevented, confirmation that what's supposed
    to be running IS running now too. Better, more
    detailed logging.

    All in about half the space.

    So ... "I made it work" may be good, but "I made
    it work WELL" is the GOAL.

    It's always like that: first you make it work then you improve it.

    FSVO "improve". In many cases this means "make money", even
    (or especially) at the expense of quality in the traditional sense.

    Um ... CAN I suppose .... but I was talking about
    overall quality, not some commercial scam like a
    new-year-model car.

    Well, a lot of times, the process stops when it works. I don't remember
    who said that code is not finish when there is nothing more to add but
    when there is nothing more to remove.

    Antoine de Saint-Exup‚ry

    That's why it's stupid to consider the best programmer as the one who
    produce more lines of code than others.

    Unless you're being paid by the line.

    And, from what I saw, actually, the AI produce a lot of code which must
    be removed.

    Reminds me of my early days when I'd take over maintenance of someone
    else's code - or code that "just grew". I'd typically reduce the line
    count by 30% - or even 50% in some cases.

    First-passed at code are often inefficient. The first
    goal is just to Make It Work. However no good programmer
    should LEAVE it at that. Refine, polish, de-crap for
    the 2nd pass.

    I suspect that stuff like programs may leave waking
    consciousness, but somewhere deep down keep some
    little processes running. Then, when you go back to
    it after awhile, new and better approaches and tweaks
    seem to come easily.

    Let's say I subscribe to the theory of the mind as
    a sack full of onions :-)


    --- PyGate Linux v1.5.6
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From c186282@3:633/10 to All on Sunday, January 25, 2026 21:52:47
    On 1/25/26 12:53, Stefan Ram wrote:
    =?UTF-8?Q?St=C3=A9phane?= CARPENTIER <sc@fiat-linux.fr> wrote or quoted:
    That's why it's stupid to consider the best programmer as the one who
    produce more lines of code than others.

    These topics fit right in on comp.lang.misc, not comp.os.linux.misc.

    And what's wrong with Linux ?



    --- PyGate Linux v1.5.6
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From c186282@3:633/10 to All on Sunday, January 25, 2026 21:58:30
    On 1/25/26 14:16, Lawrence D?Oliveiro wrote:
    On 25 Jan 2026 11:07:20 GMT, St‚phane CARPENTIER wrote:

    That's why it's stupid to consider the best programmer as the one
    who produce more lines of code than others.

    I once took a program of about 8000 lines of code, written by someone
    else, and cut its size in half.

    Actually the basic idea behind the simplification was very simple. The program was a plugin doing import and export of object definitions
    between the host application?s internal format and an external
    database. The import function was one gigantic sequence of handlers
    for all the database fields, which generated corresponding attributes
    for application objects, while the export function went the other way.

    What I did was replace the bulk of both functions with a single table
    of the correspondences between the two data representations. That
    shrank the import and export functions down to just a couple of dozen
    lines each -- they became just interpreters of table entries. I also
    found some discrepancies between the two original functions, which disappeared as a result of using the common table.

    This is called ?data-driven? or ?table-driven? programming. It?s quite
    a common technique for reducing code size. Less code to write means
    less code to maintain going forward, and less opportunity for bugs to
    sneak in. Win-win.

    "Table-logic"/"Table-IQ" can work very well in many
    cases. Can save a lot of more complex coding.

    Sounds like your original author quickly thought of *A*
    method and just ran with it - never going back to think
    about any of it later (or maybe was just never given
    the time).


    --- PyGate Linux v1.5.6
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Charlie Gibbs@3:633/10 to All on Monday, January 26, 2026 04:33:48
    On 2026-01-26, c186282 <c186282@nnada.net> wrote:

    "Table-logic"/"Table-IQ" can work very well in many
    cases. Can save a lot of more complex coding.

    True - but until you get a feel for the kind of data you're
    working with, it might not be apparent that a table-driven
    approach is feasible. Hindsight is 20/20...

    Sounds like your original author quickly thought of *A*
    method and just ran with it - never going back to think
    about any of it later (or maybe was just never given
    the time).

    That often happens when the boss is less concerned with having
    it done Right as in having it done Right Now. Yes, sometimes
    there are legitimate reasons for this (e.g. an irate customer
    who is about to walk), but sooner or later the quick-and-dirty
    approach is going to come back to bite you.

    "There's never time to do it right, but always time to do it over."

    --
    /~\ Charlie Gibbs | Growth for the sake of
    \ / <cgibbs@kltpzyxm.invalid> | growth is the ideology
    X I'm really at ac.dekanfrus | of the cancer cell.
    / \ if you read it the right way. | -- Edward Abbey

    --- PyGate Linux v1.5.6
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Monday, January 26, 2026 04:46:05
    On Mon, 26 Jan 2026 04:33:48 GMT, Charlie Gibbs wrote:

    ... it might not be apparent that a table-driven approach is
    feasible.

    A certain repetitiveness in the code is a common giveaway.

    --- PyGate Linux v1.5.6
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From c186282@3:633/10 to All on Monday, January 26, 2026 00:44:14
    On 1/25/26 23:33, Charlie Gibbs wrote:
    On 2026-01-26, c186282 <c186282@nnada.net> wrote:

    "Table-logic"/"Table-IQ" can work very well in many
    cases. Can save a lot of more complex coding.

    True - but until you get a feel for the kind of data you're
    working with, it might not be apparent that a table-driven
    approach is feasible. Hindsight is 20/20...

    Sounds like your original author quickly thought of *A*
    method and just ran with it - never going back to think
    about any of it later (or maybe was just never given
    the time).

    That often happens when the boss is less concerned with having
    it done Right as in having it done Right Now. Yes, sometimes
    there are legitimate reasons for this (e.g. an irate customer
    who is about to walk), but sooner or later the quick-and-dirty
    approach is going to come back to bite you.

    "There's never time to do it right, but always time to do it over."

    Well ... really ... not always time to
    do it over ......

    I positioned myself well, more or less my
    own boss in the corp. But a lot do not have
    that luxury. Get it done NOW, move ON to the
    next project ... who CARES if it's any good.
    Slavery.


    --- PyGate Linux v1.5.6
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From c186282@3:633/10 to All on Monday, January 26, 2026 01:05:35
    On 1/25/26 23:46, Lawrence D?Oliveiro wrote:
    On Mon, 26 Jan 2026 04:33:48 GMT, Charlie Gibbs wrote:

    ... it might not be apparent that a table-driven approach is
    feasible.

    A certain repetitiveness in the code is a common giveaway.

    You've gotta LOOK at it, THINK about it.
    Complex algorithmic approaches can be found
    online, cut-n-paste is easy. However there
    are times where what really needs to be done
    can be essentially encapsulated in stupid
    things like tables.

    A long time back I had to build a micro-controller
    device to run a pump relative to the speed of a
    vehicle. However temperature, wear, minor hardware
    change-outs MIGHT alter the equation. One thinks of
    variations of the usual PID solutions. However uC's
    generally have no hardware math capabilities, so
    floating math uses up a HUGE amount of time.

    My fix was an 'adaptive' table ... speed and motor
    power. When the vehicle maintained a speed for
    maybe 30 seconds the motor power was memorized,
    updated the table. If the flow was cut off, then
    resumed, you didn't have to do a huge recalc. As
    the whole equation wasn't likely to change in a
    minute this allowed the motor to resume the last
    speed in an instant. No complex PID-style shit
    and tuning needed - only a simple 'fuzzy' algo to
    get things fine-tuned in the first place. This
    was ideal for a tiny CPU - let it do more very
    easily, and all integer.

    First models were 8051s, changed to a Rabbit-2000
    for model 2. I liked the Rabbit-2000 ... alas the
    R-3000 went to WAY TOO SMALL pin spacing, mere
    humans could not easily make add-on stuff. Anything
    less than 3mm - forget it ! Ah, the joy of hand-
    drilling PCBs :-)


    --- PyGate Linux v1.5.6
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris Ahlstrom@3:633/10 to All on Monday, January 26, 2026 07:09:11
    Charlie Gibbs wrote this post by blinking in Morse code:

    On 2026-01-25, St‚phane CARPENTIER <sc@fiat-linux.fr> wrote:

    Le 25-01-2026, c186282 <c186282@nnada.net> a ‚critÿ:

    So ... went at them. Both are now nearly half the
    size and the logic is much improved and CAN be
    followed. Only ONE de-facto flag now for a bit
    that had to be 'adaptive'. Co-running processes
    are prevented, confirmation that what's supposed
    to be running IS running now too. Better, more
    detailed logging.

    All in about half the space.

    So ... "I made it work" may be good, but "I made
    it work WELL" is the GOAL.

    It's always like that: first you make it work then you improve it.

    FSVO "improve". In many cases this means "make money", even
    (or especially) at the expense of quality in the traditional sense.

    Well, a lot of times, the process stops when it works. I don't remember
    who said that code is not finish when there is nothing more to add but
    when there is nothing more to remove.

    Antoine de Saint-Exup‚ry

    That's why it's stupid to consider the best programmer as the one who
    produce more lines of code than others.

    Unless you're being paid by the line.

    <https://devhumor.com/media/dilbert-s-team-writes-a-minivan>

    And, from what I saw, actually, the AI produce a lot of code which must
    be removed.

    Reminds me of my early days when I'd take over maintenance of someone
    else's code - or code that "just grew". I'd typically reduce the line
    count by 30% - or even 50% in some cases.

    Heck, I keep finding bugs, created years ago, in my own software
    projects.

    --
    The wise programmer is told about the Tao and follows it. The average programmer is told about the Tao and searches for it. The foolish programmer is told about the Tao and laughs at it. If it were not for laughter, there would be no Tao.
    The highest sounds are the hardest to hear. Going forward is a way to retreat. Greater talent shows itself late in life. Even a perfect program still has bugs.
    -- Geoffrey James, "The Tao of Programming"

    --- PyGate Linux v1.5.6
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris Ahlstrom@3:633/10 to All on Monday, January 26, 2026 07:11:48
    Lawrence D?Oliveiro wrote this post by blinking in Morse code:

    On 25 Jan 2026 11:07:20 GMT, St‚phane CARPENTIER wrote:

    That's why it's stupid to consider the best programmer as the one
    who produce more lines of code than others.

    I once took a program of about 8000 lines of code, written by someone
    else, and cut its size in half.

    Actually the basic idea behind the simplification was very simple. The program was a plugin doing import and export of object definitions
    between the host application?s internal format and an external
    database. The import function was one gigantic sequence of handlers
    for all the database fields, which generated corresponding attributes
    for application objects, while the export function went the other way.

    What I did was replace the bulk of both functions with a single table
    of the correspondences between the two data representations. That
    shrank the import and export functions down to just a couple of dozen
    lines each -- they became just interpreters of table entries. I also
    found some discrepancies between the two original functions, which disappeared as a result of using the common table.

    This is called ?data-driven? or ?table-driven? programming. It?s quite
    a common technique for reducing code size. Less code to write means
    less code to maintain going forward, and less opportunity for bugs to
    sneak in. Win-win.

    "Show me your flowchart and conceal your tables, and I shall
    continue to be mystified. Show me your tables, and I won't
    usually need your flowchart; it'll be obvious."
    -- Fred Brooks, The Mythical Man Month (1975)

    --
    Women, when they have made a sheep of a man, always tell him that he is a
    lion with a will of iron.
    -- Honore' de Balzac

    --- PyGate Linux v1.5.6
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From John Ames@3:633/10 to All on Monday, January 26, 2026 08:18:36
    On Sun, 25 Jan 2026 21:52:08 -0500
    c186282 <c186282@nnada.net> wrote:

    I suspect that stuff like programs may leave waking consciousness,
    but somewhere deep down keep some little processes running. Then,
    when you go back to it after awhile, new and better approaches and
    tweaks seem to come easily.

    Absolutely. Our lead developer at $EMPLOYER has often related stories
    of working on a problem for hours or days, leaving off and going to
    bed, and waking up the next morning with the answer waiting for him.


    --- PyGate Linux v1.5.6
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From c186282@3:633/10 to All on Monday, January 26, 2026 13:04:59
    On 1/26/26 11:18, John Ames wrote:
    On Sun, 25 Jan 2026 21:52:08 -0500
    c186282 <c186282@nnada.net> wrote:

    I suspect that stuff like programs may leave waking consciousness,
    but somewhere deep down keep some little processes running. Then,
    when you go back to it after awhile, new and better approaches and
    tweaks seem to come easily.

    Absolutely. Our lead developer at $EMPLOYER has often related stories
    of working on a problem for hours or days, leaving off and going to
    bed, and waking up the next morning with the answer waiting for him.

    Minds seem to be multi-tasking/multi-threaded - and
    nothing's ever gone, just shunted to a background
    process.


    --- PyGate Linux v1.5.6
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Charlie Gibbs@3:633/10 to All on Tuesday, January 27, 2026 01:26:15
    On 2026-01-26, John Ames <commodorejohn@gmail.com> wrote:

    On Sun, 25 Jan 2026 21:52:08 -0500
    c186282 <c186282@nnada.net> wrote:

    I suspect that stuff like programs may leave waking consciousness,
    but somewhere deep down keep some little processes running. Then,
    when you go back to it after awhile, new and better approaches and
    tweaks seem to come easily.

    Absolutely. Our lead developer at $EMPLOYER has often related stories
    of working on a problem for hours or days, leaving off and going to
    bed, and waking up the next morning with the answer waiting for him.

    I often get inspirations in the shower.

    Then there's the more embarrassing version: you've been sweating
    over a bug for several days, and a cow orker walking by glances
    at your listing and says, "There it is."

    --
    /~\ Charlie Gibbs | Growth for the sake of
    \ / <cgibbs@kltpzyxm.invalid> | growth is the ideology
    X I'm really at ac.dekanfrus | of the cancer cell.
    / \ if you read it the right way. | -- Edward Abbey

    --- PyGate Linux v1.5.6
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Charlie Gibbs@3:633/10 to All on Tuesday, January 27, 2026 01:26:16
    On 2026-01-26, Lawrence D?Oliveiro <ldo@nz.invalid> wrote:

    On Mon, 26 Jan 2026 04:33:48 GMT, Charlie Gibbs wrote:

    ... it might not be apparent that a table-driven approach is
    feasible.

    A certain repetitiveness in the code is a common giveaway.

    True, but refactoring might be a better solution. If you
    have a good algorithm you might not need no steenkin' tables
    (which must be maintained when new data values crop up).

    --
    /~\ Charlie Gibbs | Growth for the sake of
    \ / <cgibbs@kltpzyxm.invalid> | growth is the ideology
    X I'm really at ac.dekanfrus | of the cancer cell.
    / \ if you read it the right way. | -- Edward Abbey

    --- PyGate Linux v1.5.6
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Charlie Gibbs@3:633/10 to All on Tuesday, January 27, 2026 01:26:17
    On 2026-01-26, Chris Ahlstrom <OFeem1987@teleworm.us> wrote:

    Charlie Gibbs wrote this post by blinking in Morse code:

    Reminds me of my early days when I'd take over maintenance of someone
    else's code - or code that "just grew". I'd typically reduce the line
    count by 30% - or even 50% in some cases.

    Heck, I keep finding bugs, created years ago, in my own software
    projects.

    It's scary how many years a bug can lurk undetected.
    Especially if it turns out to be a Schrodinbug.

    --
    /~\ Charlie Gibbs | Growth for the sake of
    \ / <cgibbs@kltpzyxm.invalid> | growth is the ideology
    X I'm really at ac.dekanfrus | of the cancer cell.
    / \ if you read it the right way. | -- Edward Abbey

    --- PyGate Linux v1.5.6
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Tuesday, January 27, 2026 05:13:21
    On Tue, 27 Jan 2026 01:26:16 GMT, Charlie Gibbs wrote:

    On 2026-01-26, Lawrence D?Oliveiro <ldo@nz.invalid> wrote:

    On Mon, 26 Jan 2026 04:33:48 GMT, Charlie Gibbs wrote:

    ... it might not be apparent that a table-driven approach is
    feasible.

    A certain repetitiveness in the code is a common giveaway.

    True, but refactoring might be a better solution.

    That is a form of refactoring.

    If you have a good algorithm you might not need no steenkin' tables
    (which must be maintained when new data values crop up).

    The point with rule tables is they are easier to maintain than code.

    Think of them as a form of DSL.

    --- PyGate Linux v1.5.6
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From c186282@3:633/10 to All on Tuesday, January 27, 2026 01:23:12
    On 1/26/26 20:26, Charlie Gibbs wrote:
    On 2026-01-26, Chris Ahlstrom <OFeem1987@teleworm.us> wrote:

    Charlie Gibbs wrote this post by blinking in Morse code:

    Reminds me of my early days when I'd take over maintenance of someone
    else's code - or code that "just grew". I'd typically reduce the line
    count by 30% - or even 50% in some cases.

    Heck, I keep finding bugs, created years ago, in my own software
    projects.

    It's scary how many years a bug can lurk undetected.
    Especially if it turns out to be a Schrodinbug.

    Sometimes, by luck, you never hit the exact combo
    of events that trigger the bug. Doesn't mean it
    won't happen.

    It's easy to miss 'special combo' bugs while in a
    hurry to get software working. Again, a good reason
    to revisit old code.


    --- PyGate Linux v1.5.6
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Marc Haber@3:633/10 to All on Tuesday, January 27, 2026 08:58:51
    John Ames <commodorejohn@gmail.com> wrote:
    On Sun, 25 Jan 2026 21:52:08 -0500
    c186282 <c186282@nnada.net> wrote:
    I suspect that stuff like programs may leave waking consciousness,
    but somewhere deep down keep some little processes running. Then,
    when you go back to it after awhile, new and better approaches and
    tweaks seem to come easily.

    Absolutely. Our lead developer at $EMPLOYER has often related stories
    of working on a problem for hours or days, leaving off and going to
    bed, and waking up the next morning with the answer waiting for him.

    That often happens, yes. But I also have the situation when I go to
    bed with an open issue that it takes me too long to get to sleep
    because I keep pondering about the issue.

    It also helps to explain the problem so someone. MIT used to have a
    teddy bear in next to the door to the user helldesk, people had to
    explain their problem to the bear before being allowed in. People tell
    that many people stopped right in their explanation and went back to
    their console.

    In the last months I made the experience that is also helps to explain
    the issue to an LLM.

    Greetings
    Marc
    -- ---------------------------------------------------------------------------- Marc Haber | " Questions are the | Mailadresse im Header Rhein-Neckar, DE | Beginning of Wisdom " |
    Nordisch by Nature | Lt. Worf, TNG "Rightful Heir" | Fon: *49 6224 1600402

    --- PyGate Linux v1.5.6
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From The Natural Philosopher@3:633/10 to All on Tuesday, January 27, 2026 10:24:46
    On 27/01/2026 06:23, c186282 wrote:
    Sometimes, by luck, you never hit the exact combo
    ÿ of events that trigger the bug. Doesn't mean it
    ÿ won't happen.

    Indeed, At some point I need to rewrite the code in my ultrasonic sensor
    to properly detach from the wifi point before committing suicide.

    Ive already trained the far end to die even if the *TCP* socket isn't
    closed properly.

    These are not so much bugs as neatness, to avoid zombie records in the
    wifi point's log or processes in the server...


    --
    No Apple devices were knowingly used in the preparation of this post.


    --- PyGate Linux v1.5.6
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Computer Nerd Kev@3:633/10 to All on Thursday, January 29, 2026 08:26:03
    Marc Haber <mh+usenetspam1118@zugschl.us> wrote:
    John Ames <commodorejohn@gmail.com> wrote:
    On Sun, 25 Jan 2026 21:52:08 -0500
    c186282 <c186282@nnada.net> wrote:
    I suspect that stuff like programs may leave waking consciousness,
    but somewhere deep down keep some little processes running. Then,
    when you go back to it after awhile, new and better approaches and
    tweaks seem to come easily.

    Absolutely. Our lead developer at $EMPLOYER has often related stories
    of working on a problem for hours or days, leaving off and going to
    bed, and waking up the next morning with the answer waiting for him.

    That often happens, yes. But I also have the situation when I go to
    bed with an open issue that it takes me too long to get to sleep
    because I keep pondering about the issue.

    I usually find the obvious answer while lying in bed, and go to
    sleep entirely satisfied. Then after working on it the next day I
    discover that in my tiredness I'd just forgotten most of the
    constraints that made the problem difficult in the first place.
    Good for sleep, bad for problem solving (especially if I don't
    remember in the morning either and start extensively redesigning
    things).

    It also helps to explain the problem so someone. MIT used to have a
    teddy bear in next to the door to the user helldesk, people had to
    explain their problem to the bear before being allowed in. People tell
    that many people stopped right in their explanation and went back to
    their console.

    Most times I go to start a technical topic on Usenet I realise the
    answer by the time I've got to the end of writing it and just keep
    it as a private note.

    In the last months I made the experience that is also helps to explain
    the issue to an LLM.

    Well I guess that's the modern version of what I do.

    --
    __ __
    #_ < |\| |< _#

    --- PyGate Linux v1.5.6
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From c186282@3:633/10 to All on Wednesday, January 28, 2026 23:10:28
    On 1/28/26 17:26, Computer Nerd Kev wrote:
    Marc Haber <mh+usenetspam1118@zugschl.us> wrote:
    John Ames <commodorejohn@gmail.com> wrote:
    On Sun, 25 Jan 2026 21:52:08 -0500
    c186282 <c186282@nnada.net> wrote:
    I suspect that stuff like programs may leave waking consciousness,
    but somewhere deep down keep some little processes running. Then,
    when you go back to it after awhile, new and better approaches and
    tweaks seem to come easily.

    Absolutely. Our lead developer at $EMPLOYER has often related stories
    of working on a problem for hours or days, leaving off and going to
    bed, and waking up the next morning with the answer waiting for him.

    That often happens, yes. But I also have the situation when I go to
    bed with an open issue that it takes me too long to get to sleep
    because I keep pondering about the issue.

    I usually find the obvious answer while lying in bed, and go to
    sleep entirely satisfied. Then after working on it the next day I
    discover that in my tiredness I'd just forgotten most of the
    constraints that made the problem difficult in the first place.
    Good for sleep, bad for problem solving (especially if I don't
    remember in the morning either and start extensively redesigning
    things).


    I came upon a five-line solution to a 25 line programming
    problem while riding a motorcycle down an interstate. It
    had been vexing me, "there HAS to be an easier way" ...
    and then .......

    Motorcycle riding CAN be kinda 'zen' :-)


    It also helps to explain the problem so someone. MIT used to have a
    teddy bear in next to the door to the user helldesk, people had to
    explain their problem to the bear before being allowed in. People tell
    that many people stopped right in their explanation and went back to
    their console.

    Most times I go to start a technical topic on Usenet I realise the
    answer by the time I've got to the end of writing it and just keep
    it as a private note.

    In the last months I made the experience that is also helps to explain
    the issue to an LLM.

    Well I guess that's the modern version of what I do.


    LLMs are good for what LLMs are good for.

    But they're NOT smart/creative humans.

    So, we STILL have an ecological niche - for now.

    NN hardware is almost there now ... NNs may be
    far more 'like people' in how they learn/think.
    Can probably fit a hardware-optimal NN that fits
    inside a bot too ....


    --- PyGate Linux v1.5.6
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Stéphane CARPENTIER@3:633/10 to All on Saturday, January 31, 2026 10:16:27
    Le 25-01-2026, Charlie Gibbs <cgibbs@kltpzyxm.invalid> a ‚critÿ:
    On 2026-01-25, St‚phane CARPENTIER <sc@fiat-linux.fr> wrote:

    Well, a lot of times, the process stops when it works. I don't remember
    who said that code is not finish when there is nothing more to add but
    when there is nothing more to remove.

    Antoine de Saint-Exup‚ry

    OK, I'm not proud to have forgotten that. He was probably more speaking
    about writing books than writing code, but there are a lot of
    similarities in the two processes.

    That's why it's stupid to consider the best programmer as the one who
    produce more lines of code than others.

    Unless you're being paid by the line.

    If that exist for writing articles in some newspapers (well more
    precisely they are payed by the word which is strongly correlated), I
    never heard of it for writing code.

    Which would be a very bad idea because people would start to put one
    word by line every time it's possible (it looks easy in C or javascript,
    I'm not sure it's possible in python). And the programs would be
    unreadable. It would encourage obfuscation.

    So, I'm happy I never heard about a programmer paid by the line and I
    strongly hope I'll never heard about that.

    And, from what I saw, actually, the AI produce a lot of code which must
    be removed.

    Reminds me of my early days when I'd take over maintenance of someone
    else's code - or code that "just grew". I'd typically reduce the line
    count by 30% - or even 50% in some cases.

    I never saw your code, but I'm pretty sure it's not the same garbage.

    More than often I saw AI code putting useless lines decreasing the speed
    of the program. For example, one unused variable initiated in a very
    strange way looking for unheard environmental variables treating them
    complexly and, to the end, even if the environmental variable did exist, replace its value by an empty string. So, if a modern computer this
    useless initiation doesn't take much time, it obfuscates the code and if
    too many of them are present, it can start to have some impacts.

    I never saw anything like that in code written by humans.

    --
    Si vous avez du temps … perdre :
    https://scarpet42.gitlab.io

    --- PyGate Linux v1.5.8
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Stéphane CARPENTIER@3:633/10 to All on Saturday, January 31, 2026 10:26:12
    Le 26-01-2026, c186282 <c186282@nnada.net> a ‚critÿ:

    First-passed at code are often inefficient. The first
    goal is just to Make It Work.

    Agreed.

    However no good programmer should LEAVE it at that. Refine, polish,
    de-crap for the 2nd pass.

    I don't agree here. It really depends on your goal. If your program is a
    one time script designed to avoid you hours of manual stuff, then if the
    first pass took you half an hour to work, it's enough and a good
    programmer should leave it like that. Now, if your script is designed
    only for you to be used from time to time, you should take some time to
    take care of some edge case which can appear in your environment. But
    you shouldn't take too much time with things that doesn't concern you.
    And if your purpose is to provide your program to the entire world,
    then, yes at that time you should polish it and take care of every edge
    case that can happen.

    But a good programmer doesn't have to consider he's writing a code
    designed for the entire world each time he's starting to write a little program.

    --
    Si vous avez du temps … perdre :
    https://scarpet42.gitlab.io

    --- PyGate Linux v1.5.8
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Charlie Gibbs@3:633/10 to All on Saturday, January 31, 2026 19:39:49
    On 2026-01-31, St‚phane CARPENTIER <sc@fiat-linux.fr> wrote:

    Le 26-01-2026, c186282 <c186282@nnada.net> a ‚critÿ:

    First-passed at code are often inefficient. The first
    goal is just to Make It Work.

    Agreed.

    However no good programmer should LEAVE it at that. Refine, polish,
    de-crap for the 2nd pass.

    I don't agree here. It really depends on your goal. If your program is a
    one time script designed to avoid you hours of manual stuff, then if the first pass took you half an hour to work, it's enough and a good
    programmer should leave it like that. Now, if your script is designed
    only for you to be used from time to time, you should take some time to
    take care of some edge case which can appear in your environment. But
    you shouldn't take too much time with things that doesn't concern you.
    And if your purpose is to provide your program to the entire world,
    then, yes at that time you should polish it and take care of every edge
    case that can happen.

    But a good programmer doesn't have to consider he's writing a code
    designed for the entire world each time he's starting to write a little program.

    Although I agree with you in principle, you have to be careful.
    Consider the case of a one-shot program you wrote to create a
    listing that was only going to be used during a clean-up effort.
    Then some manager sees it and says, "Hey, I _like_ this report!
    Have a copy on my desk every Monday morning."

    Hence one of my Words to Live By: A one-shot program is one
    that you'll only need once... this week.

    --
    /~\ Charlie Gibbs | Growth for the sake of
    \ / <cgibbs@kltpzyxm.invalid> | growth is the ideology
    X I'm really at ac.dekanfrus | of the cancer cell.
    / \ if you read it the right way. | -- Edward Abbey

    --- PyGate Linux v1.5.8
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From c186282@3:633/10 to All on Saturday, January 31, 2026 23:57:38
    On 1/31/26 14:39, Charlie Gibbs wrote:
    On 2026-01-31, St‚phane CARPENTIER <sc@fiat-linux.fr> wrote:

    Le 26-01-2026, c186282 <c186282@nnada.net> a ‚critÿ:

    First-passed at code are often inefficient. The first
    goal is just to Make It Work.

    Agreed.

    However no good programmer should LEAVE it at that. Refine, polish,
    de-crap for the 2nd pass.

    I don't agree here. It really depends on your goal. If your program is a
    one time script designed to avoid you hours of manual stuff, then if the
    first pass took you half an hour to work, it's enough and a good
    programmer should leave it like that. Now, if your script is designed
    only for you to be used from time to time, you should take some time to
    take care of some edge case which can appear in your environment. But
    you shouldn't take too much time with things that doesn't concern you.
    And if your purpose is to provide your program to the entire world,
    then, yes at that time you should polish it and take care of every edge
    case that can happen.

    But a good programmer doesn't have to consider he's writing a code
    designed for the entire world each time he's starting to write a little
    program.

    Although I agree with you in principle, you have to be careful.
    Consider the case of a one-shot program you wrote to create a
    listing that was only going to be used during a clean-up effort.
    Then some manager sees it and says, "Hey, I _like_ this report!
    Have a copy on my desk every Monday morning."

    Hence one of my Words to Live By: A one-shot program is one
    that you'll only need once... this week.


    Long long back where I worked bought it's first
    color printer - an expensive, hideously slow,
    Epson jet that needed special paper for high-rez.

    My boss said we kind of needed to find a few
    reasons to justify the money to the higher ups.

    So ... I whipped up some quick-n-dirty 123
    spreadsheets. A multi-year graph on top and
    a table of years/numbers below so exact
    figures could be seen. Took about a day to
    make 'em work.

    Had to start printing at 5pm so all the
    copies would be ready by 9am next morning.
    Yea, THAT slow :-)

    35+ years later, even after I retired, the
    bosses STILL wanted those reports every month.
    Were they sexy and pretty, no. However they
    nicely encapsulated exactly what they needed
    to see in immediately comprehensible form.

    So, a 'today', mostly PR, bit of coding
    became a decades-long thing. A few refinements
    were added, rough calx smoothed out and smoothed
    again, but the basics didn't change. From 123
    to Quattro to Excel to Libre ... the new guy
    likely ported them back to Excel. Did the
    final clean-up just before I left, to make
    it easier for the new guy, who was kind of
    a poor coder (more a 101% all-M$ Solutions
    expert instead).

    So hell YES ... ethic and pride if nothing else ...
    DO make those 'just for today' bits of code NICE.
    SO many times I've had to re-use them for decades.

    Just today I needed code to reset USB devices, as
    if you'd just plugged in everything after boot.
    Found (re-found?) a simple whipped-together
    shell script (by 'Eli') that went through them
    all and restarted. Probably a whipped-together
    little script, but nice and clear and did the
    damned job. (lots of USB drives, they don't
    ALWAYS mount on a reboot, so gotta fake a
    new plug-in, run the code in root crontab).

    Oh, "LABEL=" fstab entries get around the quirk
    of Linux mounting drives to different /dev/sdaX
    on reboots ....


    --- PyGate Linux v1.5.10
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)