Hacker News new | past | comments | ask | show | jobs | submit login
500 Lines or Less (aosabook.org)
138 points by yadongwen on July 27, 2016 | hide | past | favorite | 19 comments




I'm liking this trend. Basic ideas of full blown pieces of software often take surprisingly few LOC to implement. Anyone willing to guess how long the first release of git was?. https://github.com/git/git/commit/e83c5163316f89bfbde7d9ab23...


A URL shortener made literate (43 lines) [0]

[0] http://bitemyapp.com/posts/2014-11-22-literate-url-shortener...


What blows my mind is that it's actually like 15% shorter than since that includes the makefile and readme


Shouldn't it be "500 Lines or Fewer"?


I like the Wikipedia article [1] especially the historical use section:

"Less has always been used in English with counting nouns."

Over the years I've changed from prescriptivist to descriptivist. Surprisingly because once I started to teach English my eyes opened to the vast discrepancy between formal grammar and actual use. Eventually I began to realise that language is what people use, not what people tell you to use. I still correct people when they are learning English but I'm only strict where it interferes with meaning. Using less instead of fewer certainly does NOT confuse the meaning.

[1] https://en.wikipedia.org/wiki/Fewer_vs._less

Edit: jake-low beat me to it - I'll leave the link though


I'm generally sympathetic to descriptivism, but I encourage people to stick to prescriptivist rules in situations where departing from them would lead to reputational damage. (Then again, it's probably worse to be branded a pedant...)

Of course this situation is manifestly unfair to ESL speakers, or anyone whose lack of familiarity with formal English leads to misconceptions about their intelligence.


It's related to Postel's Law: you can be as prescriptivist as you like for your personal writing, just don't ding other people for being descriptivist, or a second-language speaker.


I am very much in favour of common politeness. Also there is the plain fact that there is no rule saying every utterance must have correct grammar and usage.

But style guides that fail to describe the rules that have emerged over the centuries, and which actively avoid giving guidance on edge cases, do not help anyone. Especially not foreigners wishing to learn English.


Less has always been used in English with counting nouns.

There has always been bad grammar too. Also forms that were once fully correct can become incorrect. I try (with mixed success) to stick with whatever pedantic people have claimed was the rule for the last 100 years or so.

Using "less" instead of "fewer" is not very damaging. But when style guides consistently say "you can do this, or that, it's up to you" then the language just becomes more ambiguous and opaque than it already is.

A good example is allowing "phenomena" as a singular. This just creates ambiguity. Now if people had started to use "phenomenons" as a plural, there might be a reason to rubber-stamp it.


> then the language just becomes more ambiguous and opaque than it already is.

It's already completely ambiguous in almost every way imaginable. We still manage to get by.


Historically, yes, but current usage has relaxed. See [1].

Personally, I read the title to be a pun on "30 minutes or less", a phrase American pizzerias sometimes use to advertise guarantees about their delivery times. The book is promising to show you useful programs in "500 lines or less, guaranteed!".

[1]: https://en.wikipedia.org/wiki/Fewer_vs._less


They wanted to save the 1 character.


The web is dark and full of errors.


(non native speaker here)

I parse "less" as "less code" and not "fewer lines".


The crawler looked so pretty that I'm hacking away on a real crawler based on coroutines: https://github.com/cocrawler/cocrawler


Such a short life and so much awesome to learn. Very promising book.


The source for the book is available at https://github.com/aosabook/500lines


Awesome. Can't wait to dig through this.




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

Search: