Live data from Hacker News

The Essence of Programming (2021)

gingerbill.org

11–20 of 69 posts

Re: The Essence of Programming (2021)

#11

This seems on the right track. On the notion of ”programming is a tool to solve problems that you have in the domain of computers” though: Writing a computer program serves two separate purposes: to communicate a set of functions to the machine, but also to communicate the purpose of these functions to a human. The former is for execution and the latter is for code review and, later, debugging. Any old clown can get…

> The fact that it happens to execute without bugs and produces the correct output is far less important than the code being readable, comprehensible, and consistent as part of the larger system. It's more important that a function looks good, than that it actually works? I'm sorry, but that sounds stupid. A computer is a functioning machine first. If it worked from the start, it wouldn't need to be fixed later. You…

All things being equal in code correctness: the preference is cleaner parseable (by humans) code, as opposed to for example: having a while(true) loop with no exit condition, no way to get out of said loop - and have the code work perfectly exiting the loop due to esoteric features that take weeks to figure out, and are brittle to system changes (no code is static).

So yeah: code readability becomes the deciding factor for both what to accept: and what will be (most importantly) the most efficient use of development hours on fixing…

Or a better way of putting it… We are monkeys that bribed rocks and copper to think for us with electricity: design code and systems that even a monkey could maintain.

Re: The Essence of Programming (2021)

#12

"Data dominates. If you've chosen the right data structures and organized things well, the algorithms will almost always be self-evident. Data structures, not algorithms, are central to programming." - Rob Pike, "Rules of Programming" The essence of programming is data.

or, from ~15 years earlier, with vocabulary to match: "Show me your flowcharts, and conceal your tables, and I shall continue to be mystified; show me your tables and I won’t usually need your flowcharts: they’ll be obvious."

Re: The Essence of Programming (2021)

#13

"Data dominates. If you've chosen the right data structures and organized things well, the algorithms will almost always be self-evident. Data structures, not algorithms, are central to programming." - Rob Pike, "Rules of Programming" The essence of programming is data.

[deleted]

Re: The Essence of Programming (2021)

#14

This seems on the right track. On the notion of ”programming is a tool to solve problems that you have in the domain of computers” though: Writing a computer program serves two separate purposes: to communicate a set of functions to the machine, but also to communicate the purpose of these functions to a human. The former is for execution and the latter is for code review and, later, debugging. Any old clown can get…

I disagree. A program is meant to produce useful output. Yes it should be written well (code clarity is a very strong correlator to the validity of a program), but the primary goal is that it should work.

Re: The Essence of Programming (2021)

#15

"Data dominates. If you've chosen the right data structures and organized things well, the algorithms will almost always be self-evident. Data structures, not algorithms, are central to programming." - Rob Pike, "Rules of Programming" The essence of programming is data.

or, from ~15 years earlier, with vocabulary to match: "Show me your flowcharts, and conceal your tables, and I shall continue to be mystified; show me your tables and I won’t usually need your flowcharts: they’ll be obvious."

aka "Representation is the essence of programming" - Fred Brooks, Mythical Man Month

Re: The Essence of Programming (2021)

#16

Earlier quoted context omitted.

> The fact that it happens to execute without bugs and produces the correct output is far less important than the code being readable, comprehensible, and consistent as part of the larger system. It's more important that a function looks good, than that it actually works? I'm sorry, but that sounds stupid. A computer is a functioning machine first. If it worked from the start, it wouldn't need to be fixed later. You…

> If it worked from the start, it wouldn't need to be fixed later. True. But you ignore the fact that NO SOFTWARE IS EVER DONE. Software always has bugs, and even if it didn't, it will bitrot as the business needs change. In theory, it's better to have 100% working software. In practice, that never happens (or only happens for a few weeks at best). Eventually the software needs to be changed. In that case, software t…

  "Software is never rewritten. Projects last longer than expected; programmers get bored or burned out; management moves on the newer challenges. The attitude of ‘good enough’ reflects reality.

  Instead of being rewritten, software has features added. And becomes more complex. So complex that no one dares change it, or improve it, for fear of unintended consequences. But adding to it seems relatively safe. We need dedicated programmers who commit their careers to single applications. Rewriting them over and over until they’re perfect. Such people will never exist. The world is too full of more interesting things to do.

  The only hope is to abandon complex software. Embrace simple. Forget backward compatibility." - Chuck Moore

Re: The Essence of Programming (2021)

#17

This seems on the right track. On the notion of ”programming is a tool to solve problems that you have in the domain of computers” though: Writing a computer program serves two separate purposes: to communicate a set of functions to the machine, but also to communicate the purpose of these functions to a human. The former is for execution and the latter is for code review and, later, debugging. Any old clown can get…

> The fact that it happens to execute without bugs and produces the correct output is far less important than the code being readable, comprehensible, and consistent as part of the larger system. It's more important that a function looks good, than that it actually works? I'm sorry, but that sounds stupid. A computer is a functioning machine first. If it worked from the start, it wouldn't need to be fixed later. You…

Software spends a significant amount of its lifecycle in a state of "not done" and/or "not working". The possibility of getting software to "done" or "working" hinges critically on the ability of a human to read, understand, predict, and change that software.

Once the software is done, sure, throw away the source code entirely (if you dare).

Re: The Essence of Programming (2021)

#18

This seems on the right track. On the notion of ”programming is a tool to solve problems that you have in the domain of computers” though: Writing a computer program serves two separate purposes: to communicate a set of functions to the machine, but also to communicate the purpose of these functions to a human. The former is for execution and the latter is for code review and, later, debugging. Any old clown can get…

> The fact that it happens to execute without bugs and produces the correct output is far less important than the code being readable, comprehensible, and consistent as part of the larger system. It's more important that a function looks good, than that it actually works? I'm sorry, but that sounds stupid. A computer is a functioning machine first. If it worked from the start, it wouldn't need to be fixed later. You…

> I'm sorry, but that sounds stupid. A computer is a functioning machine first.

It is not stupid - just counter-intuitive, which should give us a pause to think. You say, "A computer is a functioning machine first" - yes - but consider why SICP says, "Programs are meant to be read by humans and only incidentally for computers to execute." (see a discussion on the quote https://news.ycombinator.com/item?id=16431701).

Re: The Essence of Programming (2021)

#19
Ugh. Programming is not craft. It becomes craft when journeyman that haven't yet matured into being able to understand the whole system see the application of holistic approach with success and think they've reached some sort of enlightenment.

Approaching the issue of solving problems with incomplete information, they end up with circular conclusion, like the essence of programming being operating the computer.

At some point some realize that programming is modeling a domain and it's transformations into a format that is computable and then engineering starts to happen.

Re: The Essence of Programming (2021)

#20

I don't think programmers, let alone beginners, worry that much about the best way to solve a problem. Usually they are struggling with any way to solve it at all. You may get the impression from reading some online Q&A sites that everyone wants "the best" solution because of the way a lot of questions get asked. But in fact, phrases like "a good way" or "the best way" are more often than not purely rhetorical device…

I worked with this guy who repeatedly said "There's lots of ways to do it that don't work."

I try an approach, but I run into X. I try a different approach, but I can't make it work because of Y. I try a third approach, but Z. So I ask around about a good approach - one that won't run into these issues. When I do, I'm really asking for an approach that avoids X, Y, Z, W, and however many more are out there. I'm asking for something close to a best practice.

If you buy that approaches that are free from major pitfalls are rare, then I think you and I are in agreement.

Post reply on HN