Hacker News new | ask | show | jobs
by Ntrails 2634 days ago
> meaning - correct, performant, maintainable, understandable, clever and so on

My favourite part of this is how often these criteria are essentially at odds.

    - Understandable *and* performant?  
    - Clever *and* maintainable?
But, you know, I'm also bad at all this so maybe it's just me :p
2 comments

IME it's you (but /Pace/, no criticism intended, it may be that my area of databases + business dev allows this more easily than yours).

Part of it is using the tools others aren't aware of, so simple things become simple (counterexample on codinghorror, someone not knowing that XML has libraries to parse it, and started parsing it manually with regeps. From my own experience taking over a web-scraping project, I used XSLT where they previously used regexps). I have plenty of other examples of people doing things the hard way because they didn't read the docs.

Part of understandability is recognising a simple solution exists instead of a tangled ball. The simple SQL solutions are often most efficient, with tweaking, and the most understandable (which does NOT get you out of writing comments, BTW!)

Performant? The easiest code to optimise is that which is well written and nominally 'less than efficient'. This separation of layers allows me to put in new layers easily as I can see what's going on. Example: for an SQL + pascal product I got a minimum 10X speedup on the GUI, which really made a huge difference to the users, by sliding in a 3rd layer between 2 existing layers. It was simple and quick to do (3 days).

Other example: if someone had thought for a moment about creative use of SQL indexes they'd not have written another complex - and slooooooow - feature in the product I just mentioned.

So IME understandable = clever = performant = maintainable surprisingly often.

(disclaimer: I'm no coding god, I make plenty of mistakes too).

Yeah, I didn't really mean everything at once, I just wanted to make clear that "the beautiful" can be disaggregated into some engineering qualities.
Yeah, it was more a comment on the natural compromises that come about from trying to be all of the best things in your code. Perfect being enemy of good etc.

Agree entirely that they're all things that contribute to "good"