TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Minimalism - Omit Needless Code

13 pointsby visitor4rmindiaalmost 16 years ago

5 comments

makecheckalmost 16 years ago
It's not just short words that count; simple words count too.<p>A 5-word sentence with words that nobody knows, communicates nothing (or at least wastes time, as the dictionary is consulted).<p>The programming equivalent of this is to have a very good reason (and compactness isn't one) for using an advanced language feature. If nobody knows what the hell it does, and it isn't doing anything all that complicated, then you've wasted everyone's time.<p>This is an interesting statement:<p>"Code is not written to be read by Everyman: it needs an audience, and will be better off for having one in mind."<p>Well, yes it is written for the everyman. Organizations will have more average programmers than good ones, and if you care at all about maintainability, you will choose the path that is clearest (even if you are an expert).<p>Even if you can prove that a fancy solution is worthwhile -- and sometimes it may be, for speed/etc. -- you're still generally making debugging more difficult by hiding everything away, so it's a trade-off at best.<p>Take the article's for-loop example. The for_each() function is very hard to debug, because the only logical breakpoint is inside the code that iterates. And as a reusable object, that code could be run in <i>1000 other places</i> besides the point of interest; if you needed to insert a logging instance for just one case, you couldn't do it without affecting the 1000 other cases. With a regular for-loop, there's an easy place to insert code for debugging <i>just</i> that loop.
garnet7almost 16 years ago
Rule 17: Omit needless words! Omit needless words! Omit needless words!
评论 #700732 未加载
edw519almost 16 years ago
How ironic, a 4136 word essay about minimalism.
评论 #700982 未加载
pshcalmost 16 years ago
As always with this sort of writing the piece itself doesn't follow the rule it sets: there are many needless paragraphs spent ranting about laptop battery monitors.
pbhjalmost 16 years ago
Clarity - Eschew Extraneous Obfuscation