News for hackers. Stuff that matters.
Re:Ask HN: What are some great examples of well-written, cle... by BallCramp on Sunday May 16, 2021 @01:03AM (#27171348)
"Well written" is hard to demonstrate, because (aside from being somewhat subjective) it's something that might only play itself out over a long period. For example, can you take one feature and completely remove it, without creating a nightmare for yourself? Can you add a new feature without needing to re-write and rearrange a million other things? And then on the opposite end of the spectrum, is everything so de-coupled that it adds needless structural complexity?

I think my biggest lesson as a programmer was returning to large projects I hadn't touched in a few months, needing to implement big changes. Nothing else has developed my sense of where, when, and how to separate concerns.

I'd recommend toying around with "design patterns", which forces you to think about different approaches. But I might be answering this at a different scale than you're asking. Personally I've found my biggest challenges have been structural... rather than coming up with tight little algorithms for things.

Re:Ask HN: What are some great examples of well-written, cle... by martyalain on Sunday May 16, 2021 @12:55AM (#27171326)
Re:Ask HN: What are some great examples of well-written, cle... by samsquire on Sunday May 16, 2021 @12:29AM (#27171245)
Try reading your language's standard library.

You don't want to be clever when writing code. Clever is hard to read. You want to be readable.

Re:Ask HN: What are some great examples of well-written, cle... by 0xcde4c3db on Sunday May 16, 2021 @12:52AM (#27171312)
System V /bin/true (after a fashion) [1]

[1] http://trillian.mit.edu/~jc/humor/ATT_Copyright_true.html

Re:Ask HN: What are some great examples of well-written, cle... by brudgers on Sunday May 16, 2021 @08:24AM (#27173196)
Have you considered Knuth's Art of Computer Programming?