by lisper · 1y ago · 0 comments
There's yer problem right there. Code quantity is not correlated with value. In fact, it can be negatively correlated with value if it's buggy and laden with technical debt. Measuring productivity by lines of code produced actively discourages writing clean, maintainable, bug-free code.
But not so much about maintaining and debugging all those lines of code once they’re created.
Math left as an exercise for the reader.
That being said, I've found AI to be quite powerful given that I already know what infra I'm planning to use and restricting it to use only those tools and services.
Once he was done debugging it he put it all back to how it was originally...
The mind boggles.
I mean, it looks like the same level as adding explicit temporary variable because the debugger won't give provide values of the different part of an expression assigned to a third variable. That's a way to circumvent the tool limitation, just as you can add a tap or map in a middle of a chain if the debugger is too rudimentary to provide more conveniency.
Injection or whatever fancy term used for passing function pointers around is ofent write only.
With method chaining at each step you have only the complexity of the current method inputs to deal with: that's a far better noise/signal ratio.
The reason code is terser is because it forces to streamline the process to a single output at a time, rather than an unrestricted number of variable control flow and return combined in a way that is easy to accumulate but all the more complicated to grasp later on.
** "No Code" or Nihilist Software Engineering **
No code runs faster than no code.
No code has fewer bugs than no code.
No code uses less memory than no code.
No code is easier to understand than no code.
No code is the best way to have secure and reliable applications. Write nothing; deploy nowhere.
One of my most productive days was throwing away 1,000 lines of code. -- Ken Thompson
The cheapest, fastest, and most reliable components are those that aren’t there. -- Gordon Bell
Deleted code is debugged code. -- Jeff Sickel
Measuring programming progress by lines of code is like measuring aircraft building progress by weight. -- Bill Gates
* Master Foo and the Ten Thousand Lines *
Master Foo once said to a visiting programmer: “There is more Unix-nature in one line of shell script than there is in ten thousand lines of C.”
The programmer, who was very proud of his mastery of C, said: “How can this be? C is the language in which the very kernel of Unix is implemented!”
Master Foo replied: “That is so. Nevertheless, there is more Unix-nature in one line of shell script than there is in ten thousand lines of C.”
The programmer grew distressed. “But through the C language we experience the enlightenment of the Patriarch Ritchie! We become as one with the operating system and the machine, reaping matchless performance!”
Master Foo replied: “All that you say is true. But there is still more Unix-nature in one line of shell script than there is in ten thousand lines of C.”
The programmer scoffed at Master Foo and rose to depart. But Master Foo nodded to his student Nubi, who wrote a line of shell script on a nearby whiteboard, and said: “Master programmer, consider this pipeline. Implemented in pure C, would it not span ten thousand lines?”
The programmer muttered through his beard, contemplating what Nubi had written. Finally he agreed that it was so.
“And how many hours would you require to implement and debug that C program?” asked Nubi.
“Many,” admitted the visiting programmer. “But only a fool would spend the time to do that when so many more worthy tasks await him.”
“And who better understands the Unix-nature?” Master Foo asked. “Is it he who writes the ten thousand lines, or he who, perceiving the emptiness of the task, gains merit by not coding?”
Upon hearing this, the programmer was enlightened.
Source: http://www.catb.org/~esr/writings/unix-koans/ten-thousand.ht...
Bash and C are both old and flawed early implementations that brought great ideas.
Bash can be replaced by a much safer language that retains its shell nature (easily able to weave together many Unix programs).
You could certainly replace bash and traditional Unix shells with something else. My favorite attempt is scsh (though mainly for the "acknowledgements" section of its reference manual.)
But I'm in favor of a Unix/Linux command shell and scripting language that has type and taint checking for command arguments, and which differentiates between code and data. Typed data pipes could be nice as well.
However, Unix/Linux isn't (yet) designed for those features. For example exec() doesn't type check command arguments.