4 ms·
Agreed, I dig the functional example you posted. Completely personally I think the CS example I posted fits my style more and is a bit terser. Also the CS rese
by shittyanalogy 13y ago
Agreed, I dig the functional example you posted. Completely personally I think the CS example I posted fits my style more and is a bit terser.
Also the CS reserved word problem you speak of surely isn't harder than learning to program in the functional style. I mean come on. ;)
- olalonde 13y agoI agree that using functional style was not fair (comment edited :)). By the way, here's a non contrived CS example directly from CS's source which I find really hard to understand: https://github.com/jashkenas/coffee-script/blob/master/src/grammar.coffee#L612 https://github.com/jashkenas/coffee-script/blob/master/src/g... tokens = [] for name, alternatives of grammar grammar[name] = for alt in alternatives for token in alt[0].split ' ' tokens.push token unless grammar[token] alt[1] = "return #{alt[1]}" if name is 'Root' alt Why is a loop assigned to a variable? I understand that loops are expressions but the intent here is not immediately clear and definitely requires some thinking. That's what I mean by readability (terseness is another thing).