logoalt Hacker News

attila-lendvaitoday at 9:42 AM1 replyview on HN

but sometimes that is not worth it... IOW, it optimizes only to a couple of variables.

it's important not to lose sight of the ultimate goal: to get the machine to do what we want with the least amount of total human attention throughout the entire lifetime of the software.

it's a typical trap for good/idealist programmers to spend too much time on code that should already have been re-written, or not even written to begin with (because faster iteration can help refining the model/understanding, which in turn may lead to abandoning bad paths whose implementation should never have been refined to a better quality implementation).

i think it's a more important principle to always mark kludges and punts in the code and the design.

IOW sloppiness is allowed, but only when it's explicitly marked formally in code, and when not possible, then informally in comments and docs.

but then this entire discussion highly depends on the problem domain (e.g. on the cost of the various failures, etc).


Replies

jkhdigitaltoday at 11:57 AM

I don’t completely disagree, just like 90%. Junior developers typically aren’t taught the design patterns in the first place so they dig deeper holes rather than immediately recognizing that they need to refactor, pull out an interface and decorate/delegate/etc.

I’m also going to point out that this is a data structures course that I’m teaching, so extensibility and composability are paramount concerns because the interfaces we implement are at the heart of almost everything else in an application.