Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Minimalism - Omit Needless Code (demon.co.uk)
13 points by visitor4rmindia on July 12, 2009 | hide | past | favorite | 6 comments


It's not just short words that count; simple words count too.

A 5-word sentence with words that nobody knows, communicates nothing (or at least wastes time, as the dictionary is consulted).

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.

This is an interesting statement:

"Code is not written to be read by Everyman: it needs an audience, and will be better off for having one in mind."

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).

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.

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 1000 other places 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 just that loop.


How ironic, a 4136 word essay about minimalism.


I think the only things that need to be written about minimalism are examples of it in action.


Rule 17: Omit needless words! Omit needless words! Omit needless words!


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.


Clarity - Eschew Extraneous Obfuscation




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: