Hacker News new | ask | show | jobs
by bluetomcat 1382 days ago
Software is written by humans for solving a new problem with new constraints and requirements. Code being understandable to other humans is a desirable side-effect, but in no way primary. Some problems are inherently hard and few humans have the capacity to reason about them, no matter how nicely-formatted, modularised and linted your code is.
2 comments

All the more reason not to make it any more complicated than necessary (even if it's in the expense of some code elegance). Not just for other people, but also for the future you, coming to maintain this. Going back to your code after three years, and someone else approaching the code for the first time are not that much different.

Also this is why I love automation, like scripts for everything. It's like a memo to your future self, with the side benefit of sparing you menial work. I keep even single one liner commands as their own shell scripts with a descriptive name.

Try to read and understand everything your write. If it doesn't click immediately or needs too much outside context or "working memory", make it simpler. Failing that, elaborate in comments.

Sometimes it has to be complicated. Complication in one area (usually infrastructure code) enables simplicity in other areas (usually application code). An OS memory manager deals with the complexity of page management, so as to present the nice abstraction of an orderly address space to applications. An SQL query optimiser is complex in order to allow dumb and "understandable" queries from applications.
It isn’t just about code. It’s about the software’s user. Humans and the programming is one part. But the software is for people. The problems being solved are for people. It is humans all the way down. In this way I view software as a very humanistic domain. That is why the theme of communication angle resonates with me so much. Agile is misused a lot but for goodness sake, talk to your users. Even if your user is just you.

This is exactly the thinking I see people trapped in and was pointing out. Focused on solving the engineering problems, not the humans that come before and after the problem (both end users and developers). We know there are hard things in engineering and problem solving ain’t easy. I think in an absolute sense you are right, but in a practical sense, it is more than a desirable side effect. Code once written and solving a problem can live on for a very ling time.