Live data from Hacker News

It's OK if your code is just good enough

shiftmag.dev

21–30 of 149 posts

Re: It's OK if your code is just good enough

#21

Yes let's happily dive & swim in the sewer of mediocrity that is the modern software industry. Our hardware keeps getting better and better and our devices become slower and slower, while the apps keep glitching and crashing at an ever increasing rate. It's like the fat acceptance movement "it's OK if you're plus sized, or plus plus plus sized, or I guess multiply exponent factorial sized". But it's really not OK. No…

If you haven't seen Jonathan Blow his talk about preventing the collapse of civilisation, you are probably his soulmate.

Re: It's OK if your code is just good enough

#22

I 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

#24
post #20

1) Make it work. 2) Make it right. 3) Make it fast.

Then some jackass who doesn't know an std::int32_t from a *std::basic_string_view demands you cut off somewhere around step 0.99.

Meanwhile if you 2) 3) 1), you get cut off around step 2.99 and everyone's life sucks less.

Re: It's OK if your code is just good enough

#25
post #12
post #5

I think there's a pretty wide range between 3 and 4 that is worth exploring. Maybe the real problem I have with this article is that once you peg 3 as "good enough" and 5 as unachievable, then there's a whole mess of interesting quality levels squeezed between the 3..5 range. If we peg 3 as "good enough to ship and stand behind it", then I'm immediately thinking about getting the code to somewhere in the 3.5 range. A…

Agree. I always try to remind my self: - make it - make it work - make it fast

Make it last?

Re: It's OK if your code is just good enough

#26

Somehow code quality has become a topic completely divorced from product quality. Your users don't care how clean your source code is, but they definitely care if it's slow and buggy.

Chasing code quality and code-quality-adjacent metrics often results in buggy apps. Copying and pasting a line of code can become a future bug when someone doesn't refactor a line of code. But building some overwrought framework to avoid ever repeating anything can introduce classes of bugs that are much much harder to solve because of the layers of indirection. And depending on what vertical you're in, sometimes rel…

> building some overwrought framework to avoid ever repeating anything can introduce classes of bugs that are much much harder to solve because of the layers of indirection

The development of an engineer:

1. newbie - follow the rules because you're told to

2. master - follow the rules because you understand them

3. guru - break the rules because your knowledge transcends them

I often see code that follows the rules right into a swamp. Your example is a fine illustration of this.

Re: It's OK if your code is just good enough

#27
post #19

Somehow code quality has become a topic completely divorced from product quality. Your users don't care how clean your source code is, but they definitely care if it's slow and buggy.

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.

Re: It's OK if your code is just good enough

#28
Not to mention Perfection is defined differently be everyone. It's all opinion, someone's "perfect" code is another persons shit code.

And it's not even just different among people. Along the time dimension your perfect code can become bad later as requirements change and things evolve you may realize that what was once (in your opinion) perfect code was actually a very bad way to incorporate a certain feature.

Think of perfect code as a controversial literature novel. There is literally no point in building perfection unless your goal is only to build perfection for yourself rather then a customer/audience.

Re: It's OK if your code is just good enough

#29
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 perfection does not exist.

Sometimes, it's good to know that you can do something just for the beauty of it, and programming could (should!) be one of them.

Re: It's OK if your code is just good enough

#30

I 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.

Only the good die young
Post reply on HN