4 ms·
Ask HN: How do you manage perfection?
We work in an harsh industry.
Computers demand perfection. Code must be perfect or code doesn't work as intended. As Douglas Crockford once said, we humans are awful at being perfect. There is no "good enough" in code - there is only perfect or a product that doesn't work as intended.
Perfection can drive people crazy. So how do you guys do it? How do you guys manage perfection? Or are we all just a bit crazy :)
- nostrademons 15y agoSimple: I don't. I disagree with your premise. It is perfectly acceptable for a product to be imperfect and not work as intended, as long as it does something useful. Oftentimes, the programs that are imperfect are far more useful than ones that are perfect, not the least because they actually exist. There're bugs in Google Search that are there intentionally. Because fixing them would introduce a cost to users (usually in latency) that is not worth introducing. Heck, the whole idea of a ranking algorithm precludes perfection: every time you make a change to ranking, it will make some queries better and some queries worse, and the goal of the engineer is to find changes that improve things more than they degrade them. This doesn't stop Google from being useful. Engineering is all about trade-offs. Once you're out of school, there's no such thing as a perfect score anymore.
- diminium 15y agoSo your telling me code can be imperfect, just good enough? I can leave an extra "." in the code and nothing bad will happen?
- HeyLaughingBoy 15y agoSometimes nothing bad will happen, for certain values of "bad." Have you ever had to do Risk Analysis? I have to do it on my (an others') code pretty frequently. One thing to consider is what is the "bad" thing that can happen. If the worst impact of the bug is that a line of text has an extra period at the end, that's generally not a big deal. If the database is corrupted because an extra period causes a parse error; that's High risk. The entire planet is imperfect, yet we stumble through life somehow.
- nostrademons 15y agoYes, you absolutely can leave an extra "." in the code and nothing bad will happen. The compiler will complain, you'll fix it, and then you move on. More generally, I expect programmers I work with to know basic things like the language syntax. If you don't, learn them, and then you know them. I'd be surprised to see someone "working" in the industry if they can't get their code to compile. The interesting stuff happens when you start using those tools to build things where there's no right or wrong answer. Being able to write code that runs is just a tool; the big question is "what can you do with it?" And if you keep the mindset that everything has to be perfect, you'll find yourself locked out of many of the interesting things you can do with computers.
- Pheter 15y agoConsider a poorly written program: Cryptic variable names, lack of documentation, tightly coupled. The code would be far from perfect, but if it works then it may be considered 'good enough'. In fact, I'll go out on a limb and suggest that most (if not all) non-trivial code is imperfect yet 'good enough'.
- mgallivan 15y agoThere's a difference between the syntax of your code and the program as a whole. We're all able to express our ideas perfectly (or near-perfectly) with the English language. Subjects, nouns, punctuation - those are relatively easy things. But I challenge you to ever find one perfect idea expressed by those rules. The same is true for software.
- traxtech 15y agoPerfection in software : the goal is the journey.
- HeyLaughingBoy 15y agoIt really doesn't matter what "computers" demand; it matters what you can live with. Case in point: I recently discovered a bug in code I wrote back in 1999. The bug would only cause a problem early in the machinery startup sequence and only when a particular, buggy version of hardware was installed. Even then, it was fairly benign and showed an appropriate error message and would almost always work properly when the operator restarted the machine. The point is that the majority of bugs that make it out the door are not showstoppers. The same complexity that causes bugs to be introduced can mitigate their impact: need a very specific, often rare, sequence of operations to invoke the buggy code. As a result, it's frequently the case that no-one cares about it.
- maruz 15y agoDone is better than perfect - @Facebook