3 ms·
I've seen terrible JS, but I've seen much worse CS. Most programmers have relatively no sense of organization, and when unleashed with CS create things far more
by tjholowaychuk 15y ago
I've seen terrible JS, but I've seen much worse CS. Most programmers have relatively no sense of organization, and when unleashed with CS create things far more nasty than their JS counterparts.
nasty: https://github.com/jashkenas/coffee-script/blob/master/src/rewriter.coffee#L93 https://github.com/jashkenas/coffee-script/blob/master/src/r...
nasty: https://github.com/jashkenas/coffee-script/blob/master/src/optparse.coffee#L36 https://github.com/jashkenas/coffee-script/blob/master/src/o...
nasty: https://github.com/jashkenas/coffee-script/blob/master/src/command.coffee#L89 https://github.com/jashkenas/coffee-script/blob/master/src/c...
sexy: https://github.com/jashkenas/coffee-script/blob/master/src/grammar.coffee#L278 https://github.com/jashkenas/coffee-script/blob/master/src/g...
- jashkenas 15y agoUnfortunately, in this particular case, the code was equally nasty even when all of those methods were written in Ruby, and has grown nastier over time through pull requests. I think it tells you far more about the author than the language ;)
- thejefflarson 15y agoI've seen terrible assembly but I've seen much worse C. Most programmers have relatively no sense of organization, and when unleashed with C create things far more nasty than their assembly counterparts. nasty: https://github.com/mirrors/gcc/blob/master/gcc/c-family/c-common.c#L1976 https://github.com/mirrors/gcc/blob/master/gcc/c-family/c-co... nasty: https://github.com/mirrors/gcc/blob/master/gcc/c-family/c-lex.c#L937 https://github.com/mirrors/gcc/blob/master/gcc/c-family/c-le... But you get the idea. I'm merely pointing out that compilers are tricky and complicated beasts. And especially in the rewriter CS has to jump through hoops to disambiguate.
- tjholowaychuk 15y agoI dont know if I would call CS complicated, but yeah you'll get that all the way down. Noobs will write their js, bigger noobs write CS, smarter people off writing C, and even smarter people writing ASM. Most will still write nasty code regardless but the ambiguity in CS makes this far more painful to consume