My formatted-by-productivity-standards brain agrees, my heart disagrees. I enjoy the art of programming. I love to think that, for certain types of projects, I am allowed to aim for and reach perfection. My vision of perfection is not yours, so what. If your "good enough" is actually your perfection because of business impact, user happiness or optimal time management, good for you. Just don't tell me that my perfect…
It's OK if your code is just good enough
31–40 of 149 posts
Re: It's OK if your code is just good enough
#32If a developer can write error-free binary code that improves performance (as seen by the user) by 0.1%, BUT the next developer (or even the same dev months later) can't adjust the code without all hell breaking loose, then that code is basically awful.
Side note: add your newline at the end of your files before commit! Ugh
Re: It's OK if your code is just good enough
#33For something to be "good enough" it still has to be good. This feels like evil propaganda aimed at the poor souls who work for cash-strapped and inexperienced entrepreneurs.
Implementing a feature fast is no excuse for writing crappy code.
There are many sets of constraints to satisfy when you're writing code. I agree chasing "perfection" is pointless, but too often you see inexperienced people rationalizing their shoddy work. If you're excusing yourself from bothering with crazy optimizations that have little to no business impact, fine it's good enough. If you're excusing spaghetti, you're the inexperienced person I'm talking about. The "good enough" example from the article sounds like spaghetti.
Re: It's OK if your code is just good enough
#34Re: It's OK if your code is just good enough
#35Earlier quoted context omitted.
I like to say that users includes the people working with (using) your code in the future. It changes the definition of user compared to the normal usage, but I think it's a good point.
You can change the definition but you change the fact that those "users" aren't paying you.
If the thing being written is not going to be updated at all, then, sure, quality is not important.
Re: It's OK if your code is just good enough
#36Re: It's OK if your code is just good enough
#37Your code is a distillation of how well you understand the problem and how it's being solved. Confusion usually means either the requirements are not well-understood, you still have unknowns, or you simply don't understand the problem/solution well enough to express it to both humans and the computer fluently. All of those involve thinking more and getting more information.
Really, I write the best code I can given the circumstances so I don't have to keep coming back to the same section of code over and over. I want to solve it as well as necessary and move onto something new.
Also, why is the tech industry so weird in how it continually feels the need to degrade the importance of technical skills? Is it seen as taboo that there are still large differences in individual programmer skill?
Re: It's OK if your code is just good enough
#38I wonder what's the median life expectancy of a piece of code.
At least for my own code, I'm pretty sure its an inverse relationship to quality. The masterpiece I fretted over for endless hours is guaranteed to be obsolete within 1 year. The crappy hack with the comment that says "@TODO make not be garbage sorry" is cursed to live on for eternity.
Re: It's OK if your code is just good enough
#39Unless the code is running on critical systems that put human lives at risk, good enough is the perfect amount of good. Getting things done is more important. Excluding above scenario, either you will make mistakes, or you are not tackling meaningful tasks. And that's okay. Allocate time for clean up when there's less ambiguity. The more you explore the problem, the better the issues become. First implementation will…
Re: It's OK if your code is just good enough
#40Context and priority should be defined for a project, not just left to the decision of each developer.
I am building code for a startup right now. The context and priority is to "get the damn thing working". Thus code quality is largely irrelevant - this codebase is flat out garbage - it is full of commented out code, duplication, files that were obviated ages ago. It is unstructured, disorganised, uses different approaches to solving the same problem all over the place - there are ZERO tests, no CI/CD, the code is uploaded directly to production. This is exactly the right way to build this because none of those "terrible sins" matter when you have no customers and your only goal is to get something working as fast as possible and every secong spent making things nice is a waste of time and money because if the business fails then every second spent making things nice was wasted.
If however I was working for Nasa on code that was running a rocket launch system, then hopefully it is stated to all programmers working on the system that reliability is priority one. This informs every about how the code is written from that point. It means few lines of code, alot more eyes on the code, must more rigorous quality control and much lower overall output.
If however I was working in an ordinary business making a CRM system then the stated priority I imagine would be something like "we want a balance between productivity, reliability, maintainability" etc. This explicit definition of the context and priority sets the scene for how the code will be written.
I've never worked anywhere that is was explicitly stated across a range of parameters what the code should prioritise in terms of security/reliability/performance/maintainability/time to market/quality etc.