Hacker News new | past | comments | ask | show | jobs | submit login

All four are prevalent in our industry.

I recall a self taught dev (or maybe from a bootcamp) coming up with a cascade of nested if-else, nested 8 deep. Someone with a background in CS asked him what he was trying to do and basically concluded that what he was trying to do could be expressed as a state machine. To which the initial dev replied that it was "way too fancy" and that he didn't need the code to be fancy, just work.




+9000 for your post.

The ugly part: The nested-8-deep solution was faster to market and costs less. And, it will be thrown away in 6 months during the "big rewrite after we scale". So the perfect-is-the-enemy-of-good state machine solution written by an expensive engineer has less value. Oompf.


Possibly. Or not. It could be that the elegant expression can be written in less time by the expensive engineer, doesn't need to be rewritten in 6 months, and it may be that both of these people are getting paid the same anyway. So you can make up any "just so" story that you like about a made-up anecdote. If programs A and B implement the same function and both have adequate performance, then the differences between the two artifacts come down to style.


> If programs A and B implement the same function and both have adequate performance, then the differences between the two artifacts come down to style.

What about maintainability? Extensibility and ease of debugging?

I've seen chunks of projects re-written, just because it was simply impossible to extend them without significant efforts!


Well yes, that's what we're talking about. I mean that the compiled artifact is equivalent, but of course you may have reason to care about the style of the code.


> I mean that the compiled artifact is equivalent

Are they? Source readability will still matter if you end up using a debugger!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: