by TheFuture · 13y ago · 0 comments
If you're writing some deep enterprise level back-end stuff that is going to be integrated in a large, expensive system, obviously it really is worthwhile to do it right.
If you're cranking out another piece of shit marketing website, or even better, anything app or mobile related, no matter how much planning and testing and pride you put in to it, it is almost always completely worthless in a couple years.
Everything is changing so fast right now, the platform, device, language, database, etc, may not even exist in 5 years. 5 years! That's a hell of a depreciation schedule for a $200k project.
I really learned not to invest much time and finesse into those kinds of projects. When i was younger i was thinking "oh, someone may look at the code, keep it clean...". Nearly 10 Years later and dozens of projects later: Only 5% of my code ever got even a second glance or had to be changed...
If your attitude is that reading code is a lost cause, you'll create a bunch of shitty, illegible code.
People forget that outside of the corporate world, there actually is code that people (a) enjoy reading, and (b) write with the intention of making it comprehensible.
There is an impedance mismatch between the way computers work and the way the real world works.
Software works in clear conditionals, numbers without any uncertainties, events that flow deterministically based on relatively simple rules.
The real world works in probabilities, half truths, imprecise numbers, special cases, partial information, irrational actors and deliberate rule breakers.
When you start writing a new piece of software, at first you tackle the most common cases of the real world. At this point it is possible to write clean code and well defined abstractions. However, eventually you are going to get users that will find that your software is too simplistic and doesn't take into account common sense exceptions, doesn't give them enough flexibility to deal with partial information and doesn't allow them to act according to unwritten exceptions to the rules. You have two choices. Either refuse to bend your software to the real world to keep code simplicity or start coding in the exceptions that your users desperately want.
Computers don't understand common sense so you have to translate all these exceptions into well defined rules and heuristics even though this does not reflect how things work in reality. Because computers don't think probabilistically, these heuristic tend to be numerous and complexe and difficult to deal with.
The main jobs of programmers in my opinion, is to manage this complexity so that their programs don't become too unpredictable when the thousands of exceptions interact together in unexpected ways. It's quite the balancing act but I think the best developers are those that don't back down and are able to face these types of problems. Sometimes this means refactoring some exceptions out of the system, or moving it somewhere where it doesn't cause unwanted interactions but sometimes it means leaving it in and managing it as best as you can so that your software can deal with the world as ambiguous and fuzzy as it is. A developer that ignores the fuzziness of the world in order to write clean code, is naïve and ineffective in my opinion.
It doesn't mean that you should write crapy code, it just means that sometimes you have to in order to meet the exceptions in the wild.
On the other hand, that first product I worked on is still in service, over 15 years later.
Obviously, this doesn't apply to life saving (or threatening) software like medical, defense, embedded systems etc.
Making it technically good is a way of making it interesting and something to be proud of. You could also make something that is yours. You could also make something that is really actually important. Without any of those outlets people will just hate their jobs and only live for their time off.