3 ms·
> Verbally Readable !== Quicker Comprehension -> is Coffee-Script's greatest trick. When I first started poking through the codebase, it would take me ages to
by geraldalewis 15y ago
> Verbally Readable !== Quicker Comprehension
-> is Coffee-Script's greatest trick. When I first started poking through the codebase, it would take me ages to 'sound out' each line. Coffee-Script is succinct not simply because its syntax is short, but because it is dense. Everything is an `expression`, which means I can be more expressive/loc.
I can now read it as fast as any other language, which means I can comprehend code faster.
> doSomething() if five and six and seven
That was difficult for me to parse as well until I saw it enough. Which is true of everything new I have ever learned. Some syntax took me out of the C comfort zone, and I am better for it. There's a feel that code written "out of order" has that I instinctively like for some scenarios.
> Therefore it will never really be supported natively, and will always be a compile-to-JS language, and will therefore always have a terrible debugging experience.
Mozilla has been working on this issue in earnest (https://github.com/mozilla/source-map https://github.com/mozilla/source-map). It seems that compile-to-JS languages may be part of some greater strategy. Surely, Google must be working on something similar for Dart. Some progress has been made on the GitHub Issue: https://github.com/jashkenas/coffee-script/issues/558 https://github.com/jashkenas/coffee-script/issues/558
- ryanflorence 15y agoWe scan the left side of the code when reading. Checking the right side of the code to see if it actually will execute must invariably be slower. Also, the language encourages super long comprehensions.
- geraldalewis 15y ago> We scan the left side of the code when reading Exactly. Sometimes you want the predicate muted so the consequence is highlighted. I agree that it seems counterintuitive, but I'm pretty sensitive to code flow and it works for me personally.
- ryanflorence 15y agoconsequence is still on the left edge in my rewrites though, not sure why you'd want to mute control flow aside from reading it out loud. Admittedly, you can still do some ugly one-liners in JS, the undertone of all my points though is that coffeescript's draw is the really beautiful, readable code, which leads to (at least for me) stuff that's harder to follow when I'm not writing it.
- ryanflorence 15y agoSource mapping will be helpful, but clearly fewer people than I'd expect know how to use the debugging tools in their browser to the extent that I use them. I don't want a line number, I want a break point or watch expression in my code while I'm debugging, I don't want to go back to my editor until I know the state of my app that's causing problems. It is all very minor, but it piles up and slows me down.
- javajosh 15y agoPerhaps an article (or webcast) on how you use your debugging tools is in order.