Live data from Hacker News

Your code may be elegant, but mine works

omniti.com

61–70 of 174 posts

Re: Your code may be elegant, but mine works

#61
While I mostly agree with the article, it's a bit short sighted. "Building crap is ok as long as it's done".

Whether you plan to stick around long term matters here. Are you just pumping some crap out at a 6 month contract and don't want to hold up any sprints? This is a good approach. Are you working at some stepping stone type company where you don't really care and are looking for something else?

If you're at a company you love and you plan to be there a while, you really should make a more concerted effort to build better stuff. The shortcuts you take now will catch up with you later. Also Technical debt is a real thing.

Hacking it and "Getting it done" for some hyperactive project manager who doesn't understand tech is fine and dandy for the short term, but if you stick around long enough you'll pay for those sins.

Re: Your code may be elegant, but mine works

#62
post #60

I'd add more controversy here: if deadline is unrealistic it is ok to miss it and do things the right way. Deploying ugly piece of shortcut that is going to give you grief for the next 5 years is not worth making for the sake of pulling your skin off to met unrealistic deadline that was created by the layer of clueless management. Follow your professional intuition of course.

So true. Deadlines are the enemy of quality software but if you can push a few deadlines back up front you can build scalable workable stuff later on and it pays off.

Re: Your code may be elegant, but mine works

#63
First - it's not about elegance. It's really about organizing, arranging, structuring the code so that the brain can handle it efficiently (which in turn gives you the nice properties of maintainability etc.). As a side effect, the brain also perceives it as elegant.

Second - it is not one or the other. It needs to both work and be comprehensible. Delivering "non-elegant" code that works though, is job half done.

Re: Your code may be elegant, but mine works

#65

I live by a comment Joe Armstrong made on this (from Erlang and OTP in Action): "Make it work, then make it beautiful, then if you really, really have to, make it fast." (The quote continues "90 percent of the time, if you make it beautiful, it will already be fast. So really, just make it beautiful!")

This sentiment is why I only work in domains that value high-quality work. My definition of high-quality is something that's done well enough that it doesn't have any obvious issues, based upon the current product vision. It should be designed well enough that we can move onto subsequent requirements afterwards.

My clients/employers don't have a say in the quality of the finished product they receive. (They may be angry about this, but my responsibility is to my profession first, and them second.)

Re: Your code may be elegant, but mine works

#68
post #52
post #28

There's basically just one golden rule: a programmer tries to minimize his total amount of work (because then s/he has more work capability available for any of the more interesting stuff). This applies to throwaway code vs. maintainable code as well. In programmer's head there's a running judgement ongoing while crafting something new: there are constant decisions on if cheating with quick'n'dirty hacks is the way o…

There's a sub-species of programmer that loves /programming/. Not getting things done with code, but the act of writing code itself. They'll happily over engineer and refactor things for eternity if left unchecked. Leave them alone for two years, come back and ask if Hello World is done? "Not yet, I'm working on optimizing the text to speech plugin api". It's to these people that this article should really be speakin…

Definitely. And there are programmers that love code for its own sake, rather than for what it does. They seem to be motivated by "what would another programmer think if s/he saw my code?" -- rather than, "what will the user think?"

Re: Your code may be elegant, but mine works

#70

My code might not be that elegant, but it's maintainable . I've followed "hey, it works" developers who knocked out functionality quickly. Their by-product was Lovecraftian code.

This is a far better metric. Elegance, while a worthwhile goal, is at its best a vague notion and at its worst, a guise for all sorts of leaky abstractions.
Post reply on HN