Live data from Hacker News

Discourse ditches CoffeeScript

meta.discourse.org

41–50 of 84 posts

Re: Discourse ditches CoffeeScript

#42
post #24
post #20

> CoffeeScript has significant whitespace. So instant no. It makes it a pain in the butt to parse. It's annoying. Most people (except for Python developers) don't like it. Due to being difficult to parse, you will have problems when you try to refactor. Not to mention the problems of re-indenting everything when you have really long and ugly blocks you want to clean up (happens). maybe people should stop writing unin…

No one is writing un-indented code. The issue is lack of metadata for automatic indentation. In C if I shift a block of code a quick gg=G will reformat and reindent. Possible because blocks are explicit and whitespace is separate from scope. By the same token autogeneration of {}'s is impossible in C. This is obvious but obfuscated in Python from whitespaces' overloading. The issue is autogeneration of blocks. In any…

No one is writing un-indented code.

Oh I beg to differ. I've seen lots of terrible unindented or patchily-indented code. Especially in Wordpress plugins.

Re: Discourse ditches CoffeeScript

#43
I find this a curious debate to have so early in Discourse's life. There doesn't appear to be a pain point, so it's mostly speculation. If this happens, then that consequence, but if this happens, then that other consequence...

I would stick with CoffeeScript until it becomes painful. There is relatively little downside risk. If and when you have great people refusing to contribute code because they hate CoffeeScript, well, that'll be a pain point. On the other hand, what if you get a bunch of other people who like contributing code because they can do it in CoffeeScript?

Are there meaningful statistics collected? Until there are, or at least a weighty collection of anecdotes, I'm sure there's something more important to worry about.

Re: Discourse ditches CoffeeScript

#44
post #12
post #11

Earlier quoted context omitted.

The whole point of lexical scoping is that code in an inner scope can't mess with an outer scope's variables without meaning to. CoffeeScript doesn't achieve that. The same code in an inner scope means different things depending on whether the outer scope uses the same variable names. It's broken.

Lexical scoping is a term to classify languages. The 'point' is to make it easier to understand how a language behaves. If you want to have var with the same name as something in an outer scope, there are ways to do it, specifically an IIFE. Here's an article for you: https://github.com/raganwald/homoiconic/blob/master/2012/09/...

Also, using really common identifier names (like "log") in outer scopes is a bad idea regardless of how your language's scoping works. Writing `{log} = Math` at the top of the file is just polluting your namespace for no good reason. You shouldn't do it, just like you shouldn't use `from math import *` in Python.

Re: Discourse ditches CoffeeScript

#45

I find this a curious debate to have so early in Discourse's life. There doesn't appear to be a pain point, so it's mostly speculation. If this happens, then that consequence, but if this happens, then that other consequence... I would stick with CoffeeScript until it becomes painful. There is relatively little downside risk. If and when you have great people refusing to contribute code because they hate CoffeeScript…

From what I understand, the developers have noticed that they get patches for the Rail app but not much for the CoffeeScript part, so they think that by switching to JS they'll get more dev interested.

Also it looks like one of the core dev doesn't like CS much, which might have precipitated things a bit [1].

[1] http://meta.discourse.org/t/is-it-better-for-discourse-to-us...

Re: Discourse ditches CoffeeScript

#46

Earlier quoted context omitted.

gah! you're right! I've attempted to update my comment with corrected code, but given my caffeine and sleep deprived state there's a good chance it's just as wrong as my original effort :/

If it takes that much effort to gin up example code I think the point has been made.

Clever or hard to read code is just that. I don't use CoffeeScript but I wouldn't use this example to be mean about it. At the end of the day, it is an acquired taste. My only concern is I don't have the time to invest to make a decision on it and I would suspect others are in the same boat. So, by default we choose a tentative no.

Re: Discourse ditches CoffeeScript

#47
post #3

I think the advantage of this project being open source becomes really clear in situations like this: I'd imagine js2coffee[1] will cover most of their bases, but in the situation that it doesn't , they have a (pretty active) Github community to fall back on for the finicky bits of conversion. [1]: http://js2coffee.org/

It's been a while since I looked at js2coffee, it's nice that they've eventually fixed the lack of transferring comments issue.

Re: Discourse ditches CoffeeScript

#48

If I've understood correctly, the most compelling argument (or at least the most seemingly objective one) is that CoffeeScript conflicts with planned features of ES6+, meaning that there is a risk that large CoffeeScript projects will be locked into the ES5 feature set. Since Discourse is planning on being around long after ES6 becomes widely available, it was a winning argument. http://meta.discourse.org/t/is-it-bet…

Seems like a very narrow mindset. Why would they assume coffeescript won't adapt to ES6? CoffeeScript compiler can change quickly while maintaining backwards compatibility. ES6 standards move at a snails pace. There's other perfectly valid reasons to use pure-JS on a large open source project, but the ES6 thing is a red herring IMHO.

Name a couple of said valid reasons?

Re: Discourse ditches CoffeeScript

#49
post #2

Is it just me or is anyone else finding it weird viewing a thread on Discourse from HN? It's basically the same thing IMO (although obviously this is a Discourse site announcement). I just hope this doesn't become a "thing" as it's just essentially same as linking to a forum post.

I just thought it was a way for the Discourse guys to get people here to look at a 'real' thread in Discourse to get a feel for the system. If it is compelling enough to get someone to register and comment its a double benefit. That said, the annoying ones for me are links to Google+ things, the URL says "google.com" but the content is various.

That's one of the very few things HN should borrow from reddit: use subdomains in the URLs, so we could see (for example) that it's from plus.google.com.
Post reply on HN