Better HN
topnewbestaskshowjobs
Log inSign up

ricardo_

3 karma · joined Jun 2, 2011 (15y ago) · 2 submissions

Submissions

comment 15y ago · link · parent

IMO expressiveness has to do with being close to natural language: "multiply number by 2 for every number in 1 to 10". "map" is CS vocabulary.

The conditional could be placed outside the string and still be a one-liner. It's there mostly for "flow".

comment 15y ago · link · parent

looks like I'm late to the party.. I rewrote most of them in CoffeeScript: http://ricardo.cc/2011/06/02/10-CoffeeScript-One-Liners-to-I...

I'm specially fond of

    "Happy Birthday #{if i is 3 then "dear Robert" else "to You"}" for i in [1..4]