Hacker News new | past | comments | ask | show | jobs | submit login
Js2coffee: convert JavaScript to CoffeeScript (js2coffee.org)
17 points by DanielRibeiro on Oct 9, 2012 | hide | past | favorite | 4 comments



Neat.

Some code does not round-trip. This JS terminates but if I convert the resulting CS back to JS, I get an infinite loop.

    function test() {
        var i;
        var countdown = function(n) {
            var i;
            for (var i = n; i > 0; i--) {
                console.log(i);
            }
        }
        for (var i = 0; i < 10; i++) {
            countdown(i);
        }
    } 
    test();


This is a great resource that's been around for a little while. Excellent for starting out with CS or migrating existing projects.


As a new coffeescripter, this is really interesting to be able to check syntax out - nice find


I use this all the time, except I don't like some of the syntaxes that it generates. I tend to avoid

    EXPR if COND
    EXPR unless COND
type of code, because the order of execution isn't very clear.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: