logoalt Hacker News

hnlmorgtoday at 8:02 AM4 repliesview on HN

I think developers sometimes get too obsessed with code quality thinking that smarter code makes them a better developer. In fact I’ve seen developers fall into the trap of mistaking their code as the product and thus spend so much time beautifying it that that fail to ever release anything.

Then you have the other end of the spectrum where people are too focused on hacking stuff together that the end result is unmaintainable.

The reality is there needs to be a bit of both to be a good developer.

For example, if you’re building a proof of concept (POC), then it’s more important to prove the idea than it is to define the architecture. And the reason for that is because you don’t always understand how the final product (whether it’s commercial software or a FOSS library) is best architected until you’ve gone through a few drafts of the idea. So spaghetti code isn’t necessarily a bad thing.

But then when you know your idea works and you need to flesh it out into something more durable, you start to refactor the spaghetti into something more maintainable.

Fabrice mainly releases POCs while Carmack mainly releases finished products. So it’s unsurprising you’ll see a difference in the style of architecting in their code.

I used to be someone who focused on beautiful code for my POCs too. And used to fail to release any personal projects. Then one day I learned to embrace the chaos of POCs and realised that you can getting something built and tarting it up afterwards was better than failing to build anything at all.


Replies

21asdffdsa12today at 8:09 AM

But the code quality is speed. And reach. You can not advance, unless you can read the code, you can understand the model, you can not scale beyond a certain point. The beauty of the architecture is the ability to build a spaceship compared to a train of kerosene tankers. Physically similar, but in capability radical different.

I find this very scary. Somebody unable to perceive capabilities and tech-debt. If you can not perceive that- you should not be let near executive decisions or code-base evaluation. This is literally the difference between rocket-science and exploding failed projects. Everyone can pile up explosives, not everyone can go to space today.

Its a great interview topic to filter this kind of candidate out of companies.

show 7 replies
nixon_why69today at 8:21 AM

It's the opposite, better-factored code makes me, a mediocre developer, capable of making progress instead of hitting a complexity wall.

It's separate from striving for "beautiful" code, beauty within well-factored boundaries yields dimishing returns compared to just having the boundaries.

show 1 reply
TremendousJudgetoday at 2:27 PM

>For example, if you’re building a proof of concept (POC), then it’s more important to prove the idea than it is to define the architecture.

I have tried to do this for POCs (just hacking everything together), and I always get stuck very quickly. Then until I figure out some sort of architecture for what I'm supposed to be doing I can't proceed. It's like, once I have the first step (of several) of the a POC working, I literally cannot think of how to implement the second one until the first one is somewhat well organized

psychoslavetoday at 10:13 AM

> I think developers sometimes get too obsessed with code quality thinking that smarter code makes them a better developer.

Not much about "smartness", but code can by far outlast many "product" sold on top of it, so it can make sense to polish them more than the ready to throw gift paper.

People will certainly buy nice gift paper wrapping cheap crap music toy of the day. But they will also value differently access to a beautiful handcrafted musical instrument. On the other hands, people who don’t even play any music won’t be able to assess any musical appliance.