Re:CoffeeScript: two sugars, no bitter aftertaste
by valisystem on Monday January 30, 2012 @06:43AM
(#3528335)
What about browser support ? No stack trace, no proper file:lineno for exceptions, the code you put in the console is not the one you work with. Those are essential to my work flow, and I guess, surely not everyone, but many other nevertheless. This is the same problem we have with those fancy css processors.
Re:CoffeeScript: two sugars, no bitter aftertaste
by jashkenas on Monday January 30, 2012 @09:57AM
(#3528998)
If this is the sticking point that's preventing you from giving CoffeeScript a try -- don't let it.
Not having source map support in browsers is certainly less than ideal, and yet... 95% of the folks who raise this issue have never tried CoffeeScript, and 95% of the people who have tried CoffeeScript will tell you it's not an issue.
Re:CoffeeScript: two sugars, no bitter aftertaste
by dagw on Monday January 30, 2012 @06:50AM
(#3528358)
The nice thing with coffeescript is that it complies to very readable Javascript with an almost one to one matching between lines in coffscript and lines in javascript. So as such it is pretty trivial to find the corresponding line in your coffescript file, given a line in your javascript file.
Re:CoffeeScript: two sugars, no bitter aftertaste
by showell30 on Monday January 30, 2012 @09:58AM
(#3529003)
I agree that matching up line numbers is usually pretty trivial, although I also see how this complicates the workflow for people. To make matching lines even easier, I've written this tool: https://github.com/showell/CoffeeScriptLineMatcher
Re:CoffeeScript: two sugars, no bitter aftertaste
by Jare on Monday January 30, 2012 @10:48AM
(#3529197)
It's just a space that contains names. The result is actually pretty similar to C++'s anonymous namespaces, which is why I guess I didn't blink at the name.
Not having source map support in browsers is certainly less than ideal, and yet... 95% of the folks who raise this issue have never tried CoffeeScript, and 95% of the people who have tried CoffeeScript will tell you it's not an issue.
[1] http://peter.sh/2012/01/css-selector-profiler-source-mapping...
"What’s happened? The required_field_names variable has been scoped by var, and the whole script has been wrapped in a namespace."
It's been wrapped in a closure. Namespace, to me, implies that it's been stashed somewhere easily accessible in the future.
The article is adapted from something I wrote for .net magazine, so the audience perhaps wouldn't have been familiar with the terminology.