4 ms·
I felt the same way when I switched from CoffeeScript to TypeScript but the type checking was worth all the braces, returns and lack of existential operator. I
by dugmartin 9y ago
I felt the same way when I switched from CoffeeScript to TypeScript but the type checking was worth all the braces, returns and lack of existential operator. If CoffeeScript added an (optional) type system I'd switch back in an instant.
- kbp 9y ago> If CoffeeScript added an (optional) type system I'd switch back in an instant. The home page talks a little about achieving this by using Flow annotations in Coffeescript source and then having the build system pass the Javascript output to Flow: http://coffeescript.org/#type-annotations http://coffeescript.org/#type-annotations
- GeoffreyBooth 9y agoIt’s not elegant, but there is a way to do type checking in CoffeeScript: http://coffeescript.org/#type-annotations http://coffeescript.org/#type-annotations
- ralmidani 9y agoThanks for the link. :) But wow, "not elegant" is an understatement.
- Yaggo 9y agoThis is cool! That being said, it would be very nice to have (optional) syntactically more beautiful type annotation. I assume Flow must be compatible with regular javascript, but CoffeeScript could take more flexible approach. I have no idea what the actual syntax could be, though.
- ralmidani 9y agoThat would be really nice, but CoffeeScript will probably not be adding types unless they start adding them to JavaScript. It is a dilemma, but so far I have gotten by without type-checking.
- vanderZwan 9y agoWell, guess it's time for someone to build yet another layer of abstraction by writing a typed superset that compiles-to-CoffeeScript then! (I'm joking, but actually.. why not?)
- rattray 9y agoYou might like LightScript: http://lightscript.org http://lightscript.org Good interop with Flow isn't quite there yet, though.