Hacker News new | ask | show | jobs
by gavinhoward 955 days ago
Upfront, I mostly agree with the post.

However, I may be a tad famous about striving for perfection in my code. [1] [2]

Why? If "good enough" is good enough, why do I go further?

For a few reasons:

1. I want the industry to be more professional [3] where it matters, and I need to set an example.

2. The kind of software I write already has alternatives, so mine needs to be far better to get adopted. And it does. [4]

3. Also, I am just a perfectionist. It's a problem.

Anyway, "good enough" is good enough most of the time; just make sure that your situation doesn't require more.

[1]: https://gavinhoward.com/2019/08/why-perfect-software-is-near...

[2]: https://git.gavinhoward.com/gavin/bc/src/commit/22253a3a6/ME...

[3]: https://gavinhoward.com/2022/10/we-must-professionalize-prog...

[4]: https://gavinhoward.com/2023/02/my-code-conquered-another-os...

1 comments

The first file I looked at in that codebase has a “goto” (as well as some IMO hacky-ish logic). Now I’m not going to say this is never right (but it probably isn’t), but it takes a lot of hubris to claim you are “striving for perfection” and I just don’t see perfect code using goto, sorry.
The goto's are for proper cleanup on error.

All of the options for doing so in C are awful; I just think goto is the least bad option. Otherwise, you get if statements that keep nesting, deeper and deeper.

And what's the hacky-ish logic you're talking about?