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.

What are some examples of elegant, lean programs?

1 pointsby zoskiaabout 10 years ago
As the title suggests, what are some examples of programs that are often described as elegant, lean, and so on? I keep hearing the term, but I don't know how it looks. Help?

4 comments

informatimagoabout 10 years ago
That&#x27;s a good question, and nowadays, it feels indeed quite hard to find such programs, when applications with multi-decamegabyte-sized sources abound.<p>Furthermore, in general, in practice things get very bad when you have to add input validation, error handling and other special cases.<p>See <a href="http://www.gigamonkeys.com/code-reading/" rel="nofollow">http:&#x2F;&#x2F;www.gigamonkeys.com&#x2F;code-reading&#x2F;</a><p>I guess recent examples of lean and elegant programs could be found in the works of Alan Kay and his team:<p><a href="http://www.tele-task.de/archive/video/flash/14029/" rel="nofollow">http:&#x2F;&#x2F;www.tele-task.de&#x2F;archive&#x2F;video&#x2F;flash&#x2F;14029&#x2F;</a><p>or<p><a href="https://www.youtube.com/watch?v=gZmcmdsoAXU" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=gZmcmdsoAXU</a> <a href="https://www.youtube.com/watch?v=-UOmItPa4iA" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=-UOmItPa4iA</a> <a href="https://www.youtube.com/watch?v=QlPavndhYxQ" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=QlPavndhYxQ</a> <a href="https://www.youtube.com/watch?v=y9xLi0iJg1g" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=y9xLi0iJg1g</a><p>In general, where you have more abstraction, you will find more elegance and leaner code.<p>As a microscopic example, check <a href="https://news.ycombinator.com/item?id=9211609" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=9211609</a><p><pre><code> def hamming(a,b) return sum(x!=y for x,y in map(None,a,b)) </code></pre> is elegant and lean.<p>Other implementations involving lower level details, such as computing the length of the vectors and indexing individual slots explicitely, and taking ten times more lines of codes, are clearly not more elegant and definitely not leaner.<p>Factored over a whole application, this kind of differences grow to an unmanageable hundrend megabytes source monster that is unmanageable by anybody, or a lean and elegant hundred kilobytes source that you can read and start to understand in a week end. Much more maintainable.
jonjackyabout 10 years ago
Many examples here. Also search for &quot;tiny ...&quot; or &quot;minimal ...&quot; with more search terms to narrow down the category<p><a href="http://kmkeen.com/tiny-code/index.html" rel="nofollow">http:&#x2F;&#x2F;kmkeen.com&#x2F;tiny-code&#x2F;index.html</a>
RodgerTheGreatabout 10 years ago
JonesForth: <a href="https://github.com/AlexandreAbreu/jonesforth" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;AlexandreAbreu&#x2F;jonesforth</a>
MichaelCrawfordabout 10 years ago
djbdns - Daniel J. Bernstein&#x27;s nameserver. I use it, it&#x27;s quite simple to set up and configure, reliable, and far more secure than bind.
评论 #9241687 未加载