6 ms·
The thing that turned me away from Atom and its' development is CoffeeScript. As someone who loves idiomatic JS, I still can't get why you'd pick a language tha
by anon3_ 11y ago
The thing that turned me away from Atom and its' development is CoffeeScript. As someone who loves idiomatic JS, I still can't get why you'd pick a language that makes tooling and debugging a nightmare. It's also a kick in the gut to efforts to fix the shortcomings of ECMAScript like ES6 [1].
[1] https://github.com/lukehoban/es6features https://github.com/lukehoban/es6features
- gmac 11y agoYour comment fills me with equal parts irritation and curiosity, just because it's so far from my experience. I use CoffeeScript every day, and I experience not even the mildest of tooling or debugging hiccups. And I find CoffeeScript hits such a sweet spot — some of the best bits of Ruby and Python syntax, with the first class functions and raw speed of JavaScript. Mozilla's source maps implementation is pure JS, so you can take that anywhere (e.g. I use it with JavaScriptCore on iOS). Can you elaborate on these nightmares?
- sesteel 11y agoI second this; though, to be fair, source maps in AtomShell have been flaky at times when selecting breakpoints with CoffeeScript. I have turned my source mapping off and debug the unminified resultant JavaScript.
- thom_nic 11y agoYou actually don't have to touch coffeescript to develop for Atom or Electron. EDIT: here's a demo app with zero CoffeeScript: https://github.com/thom-nic/electron-demo https://github.com/thom-nic/electron-demo
- spinlock 11y agoThat's like saying you won't use Rails because it's written in Ruby and not C. Also, it's nice to work in a language that has the right features and not just all the features. I like CoffeeScript as much for what it doesn't have as for what it does have. I recently saw this piece of code: new Array(26) .map(function (item, index) { return String.fromCharCode(65 + index); }) as a "heads up" for map lovers. That's the kind of code that people write when they're tacking the latest new feature onto someplace that it doesn't belong. This code isn't just semantically wrong, it's stylistically wrong. Having a less schizophrenic language helps jr guys avoid code like the above.
- jsprogrammer 11y agoconst caps = new Array(26).map((item, index) => String.fromCharCode(65 + index)); It's not wrong. Could maybe be better though.
- coke12 11y agoIt is wrong. "new Array(26)" creates an Array with preallocated space for 26 elements (instead of 26 'undefined' elements, as one might expect), and calling .map() on it will return another empty array. The semantics here are particularly difficult to reason about because map is specified to not execute its callback on undefined elements. Someone will probably chime in here with a correction, but the point is this -- JS is NOT a friendly language to deal with.
- fcukhn 11y agoActually this code is very stupid and you're half correct. The standard built in Array methods like map or forEach don't work on implicitly defined undefined values but on explicit one they do. For example: [1,2,3,undefined].forEach(ele => console.log(ele)) > 1 > 2 > 3 > undefined On the other hand: [1,2,3,,].forEach(ele => console.log(ele)) > 1 > 2 > 3 So, take the time you dedicate to hating JavaScript to understand the language instead of bitching here you and that stupid jerk above.
- tracker1 11y agoIt will iterate just fine, there are no values (undefined) for each `0` through `length-1` new Array(26).length === 26; //true
- disusered 11y agoSeems like it doesn't, I recently read about this gotcha so I tested it out in JSBin. Using lodash map works as expected, though. JSBin: http://jsbin.com/vasulumeti/1/edit?js,console http://jsbin.com/vasulumeti/1/edit?js,console StackOverflow: http://stackoverflow.com/a/5501711/211291 http://stackoverflow.com/a/5501711/211291
- anon3_ 11y agoTo all the sibling commenters defending the merits of CoffeeScript: - https://discuss.atom.io/t/why-coffeescript/131 https://discuss.atom.io/t/why-coffeescript/131 - https://meta.discourse.org/t/is-it-better-for-discourse-to-use-javascript-or-coffeescript/3153 https://meta.discourse.org/t/is-it-better-for-discourse-to-u...
- yellowapple 11y agoTranslation: "more people know JavaScript than CoffeeScript, so you shouldn't bother with CoffeeScript" More people are familiar with Notepad than vi. Does that make vi a bad choice?
- mwcampbell 11y ago> More people are familiar with Notepad than vi. Does that make vi a bad choice? That analogy doesn't work, because editors don't have network effects, whereas programming languages do.
- saidajigumi 11y ago> editors don't have network effects The 82 plugins in my current vim setup really, really beg to differ.
- scrollaway 11y agoThere's many reasons why that analogy doesn't work, and "network effect" isn't one. Appropriate tool, appropriate job.
- yellowapple 11y agoI'd argue that Javascript is never the appropriate tool for any job, but to each his/her own :)
- alextgordon 11y agoThat 'idiomatic' JS is but a mere illusion perpetuated by a VM written in C++. We can do this all day.
- duaneb 11y agoIdiomatic JavaScript is terrible to read. I'm not one for metalanguages but I'd be hard pressed to argue against it in this case.
- ripter 11y agoI agree, have an up vote. I wish this community was nice to each other, instead of telling you why your personal choice is wrong and and trying to prove that they are right. It's not about being right or wrong, because there is no right or wrong. Just tools to do the job. Ignore the haters, they will always exist. Just keep build great stuff.
- cristianpascu 11y agoI'm developing an app using Atom/Electron and I'm pretty sure you don't need to use CoffeeScript at all. It's Node.js and a browser.
- picks_at_nits 11y ago> It's also a kick in the gut to efforts to fix the shortcomings of ECMAScript like ES6 [1]. irony alert: Brendan Eich has said publicly that CoffeeScript was the impetus for several of the features that made it into ES-6, like fat arrows. Without CoffeeScript, lots of people wouldn’t have known that they wanted some of the things that are in ES-6. As it is, you don’t need CoffeeScript to develop for Atom. Which is part of the beauty of CoffeeScript. It’s interoperable with what you’re doing today.
- anon3_ 11y agoirony alert: Brendan Eich has said publicly that CoffeeScript was the impetus for several of the features that made it into ES-6, like fat arrows. ES6 is a real specification supported by JavaScript engines. As it is, you don’t need CoffeeScript to develop for Atom. Which is part of the beauty of CoffeeScript. It’s interoperable with what you’re doing today. The core of the Open Source project is in CoffeeScript. Let's say the community had their way, and Atom was rewritten in JS well. There's still a JS/V8/Chrome for a dependency. On an application where we're rendering huge walls of text - we forgo native redraw. Crucial to response time. It's fun and time-saving for core developers to forgo the grueling work of portable, native, fast code. But who pays the cost for the shortcuts?
- BruceM 11y ago> The thing that turned me away from Atom and its' development is CoffeeScript. ... > There's still a JS/V8/Chrome for a dependency. On an application where we're rendering huge walls of text - we forgo native redraw. Crucial to response time. > What makes Atom a viable choice when there already is free, open source, native, cross-platform editors with great plugin ecosystems? I guess maybe CoffeeScript isn't what turned you away?
- anon3_ 11y agoAs a node developer, seeing any official, open source package in CoffeeScript is a red flag. The sibling I made a link to a thread about CS in Atom. The creator of express.js has his take: "Hell I had to rewrite a coffeescript driver this week because I can't have our company relying on things written by people who are unfamiliar with javascript, throwing strings, super awkward apis, lots of indirection, and stepping through the compiled source is a nightmare. It's not like I didn't want to contribute, I even tried for a while, but it's just not worth the hell, it was quicker to just rewrite the thing. Not to say all coffeescript libraries are written poorly, but regardless you're really not gaining much, just losing a lot." [1] If you write an open source application in CoffeeScript, you're not doing the community a favor, you're doing yourself a favor. They pay the penalty. [1] https://discuss.atom.io/t/why-coffeescript/131/8 https://discuss.atom.io/t/why-coffeescript/131/8