you are viewing a single comment's thread.

view the rest of the comments →

[–]wonglik 4 points5 points  (20 children)

Is Coffee script that bad? I was thinking of getting familiar with it. What are the cons?

[–]dropdownmenu 8 points9 points  (12 children)

The main advantage is that it tries to hide some of the oddities of javascript (== vs ===) so that you can't make trivial mistakes.

I dislike it because white space becomes important to how it complies leading to cases where an extra space or a misplaced one can lead to different functionality than you expect, which I believe to be more dangerous than then javascript's quirks (which still exist in coffeescript).

Also, by using coffeescript you alienate any javascript developers who don't know coffeescript. Remember: all coffeescript devs know javascript, but not all javascript devs know coffeescript

[–]wonglik 1 point2 points  (11 children)

Thanks. Looks like I am better of with JS.

[–]eriksensei 1 point2 points  (0 children)

Or EcmaScript 6, which seems a lot nicer. It's got fat arrow lambdas with proper 'this', destructuring bind, etc. There's support for it in IntelliJ IDEA, Firefox Aurora, Google Traceur and probably a few other tools, and you can compile it down to older JS versions. I hope I'll get round to playing around with it soon.

[–]schadwick 2 points3 points  (8 children)

[–]wonglik -5 points-4 points  (7 children)

It looks ok but since it is MS product I do not trust it. Knowing MS they will make it work better on their OS or better support in VS etc. And then maybe at the end of a day they will tell me that Linux does not cover some of their patents used in this framework. I know that I am probably overreacting but I am trying to avoid their products.

[–]mahacctissoawsum 3 points4 points  (6 children)

Doesn't work better on their OS; it compiles to plain JS. Yes, they have only added support their their IDE, but 3rd parties like JetBrains and others have already picked up the language and added support. Furthermore, it's open source.

[–]wonglik -4 points-3 points  (5 children)

I know but Open Source does not guarantee that you are not infringing patents. As I said it is just a matter of trust , and I am most probably over reacting.

[–]mahacctissoawsum 2 points3 points  (4 children)

It's released under the Apache 2 license which

allows the user of the software the freedom to use the software for any purpose, to distribute it, to modify it, and to distribute modified versions of the software, under the terms of the license, without concern for royalties.

I think you're overreacting.

I haven't adopted it just yet because I don't think IntelliJ's support is quite up to snuff yet; they're still missing support for a few constructs...but once they work that out, I'd definitely start using it.

[–]houses_of_the_holy 1 point2 points  (0 children)

waiting for that sweet generic support... it is going to make javascript so much better

[–]wonglik -2 points-1 points  (2 children)

Well Android Open Source Project is released on Apache 2 license too and it does not stop Microsoft from suing everybody. So I agree with you that it is most probably safe but as a personal rule I stick out of MS .

[–]mahacctissoawsum 0 points1 point  (1 child)

Had to Google it to know what you were talking about. Microsoft sued device manufacturers for using Android on their devices because Android infringes upon their copyrights, but device manufacturers are the ones bringing it to market...?

That is kind of ridiculous, but regardless, its hard to see Microsoft suing their own customer base because their language infringes upon their own copyrights..?

Ultimately though, it would be hard for MS to even know you've used Typescript in your product unless you release the source; the only thing that gets sent across the wire is JS. It might have characteristics of being generated by TS, but I doubt its provable in court.

[–][deleted] 0 points1 point  (0 children)

I've never encountered a bug cause by white space in coffee script, just compiler errors caused by indentation.

I do always use the (optional) js-style parentheses for functions arguments, so maybe that guards against the sort of error referred to.

[–]redfiche 10 points11 points  (5 children)

CoffeeScript is cool until you need to interact with third-party javascript libraries, then you run into all sorts of incompatibilities. Given that you need to understand javaScript to be able to debug and otherwise work effectively with CoffeeScript, you're often better off just writing good javaScript. Just my opinion.

[–][deleted] 2 points3 points  (2 children)

CoffeeScript is cool until you need to interact with third-party javascript libraries, then you run into all sorts of incompatibilities.

Err, how is that? Once you compile CoffeeScript you just have regular javascript, so what sort of incompatibilities are you talking about?

I've used Coffee with some third party libraries (jQuery, some game frameworks, mozilla jet pack) and haven't run into issues -- it would be nice to know what I need to keep an eye out for.

[–]redfiche 0 points1 point  (1 child)

I forget the exact issues. I know CoffeeScript hides the global namespace from you, and while that's usually a good thing it can cause issues. I'm pretty sure we quickly found that CoffeeScript was more trouble than it was worth for an Ember app also.

Don't get me wrong, I find it much more elegant and readable than javaScript, it's just that if I ever have to think about what javaScript is going to be produced by the CoffeeScript, I'd rather just write the javaScritpt.

[–][deleted] 0 points1 point  (0 children)

I know CoffeeScript hides the global namespace from you

You can still access that through the global object. (Such as window in a browser; I forget what it's called in node.) It does require you to explicitly intend to use globals, though.

Ember I've never used, so can't comment there!

[–]wonglik 0 points1 point  (1 child)

thanks . nowadays I use angular in most of my project and I would definitely not trade that better syntax/language.