Live data from Hacker News

Atom Shell is now Electron

blog.atom.io

61–70 of 84 posts

Re: Atom Shell is now Electron

#61

Earlier quoted context omitted.

That'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…

const caps = new Array(26).map((item, index) => String.fromCharCode(65 + index)); It's not wrong. Could maybe be better though.

Longer, harder to reason against...

    const caps = new Array(26).map((item, index) => String.fromCharCode(65 + index));
Shorter, easier to reason against.

    const caps = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.split('');

Re: Atom Shell is now Electron

#62
post #32

Earlier quoted context omitted.

const caps = new Array(26).map((item, index) => String.fromCharCode(65 + index)); It's not wrong. Could maybe be better though.

It 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 --…

It will iterate just fine, there are no values (undefined) for each `0` through `length-1`

    new Array(26).length === 26; //true

Re: Atom Shell is now Electron

#63
post #42
post #9

That's a seriously confusing name. I thought this was a physics story of some kind. Additionally it's also a bad name because it's impossible to google.

I had assumed this was something to do with Acorn Computers [1] whose first models were called Atom [2] and Electron [3]. Frankly I was disappointed I was looking forward to how someone could have combined these pieces of British computing history with some kind of modern shell. [1] http://en.wikipedia.org/wiki/Acorn_Computers [2] http://en.wikipedia.org/wiki/Acorn_Atom [3] http://en.wikipedia.org/wiki/Acorn_Electron

Raspberry Pi [1] is probably the closest thing to an heir apparent...

[1] http://en.wikipedia.org/wiki/Raspberry_Pi

Re: Atom Shell is now Electron

#64

Earlier quoted context omitted.

const caps = new Array(26).map((item, index) => String.fromCharCode(65 + index)); It's not wrong. Could maybe be better though.

Longer, harder to reason against... const caps = new Array(26).map((item, index) => String.fromCharCode(65 + index)); Shorter, easier to reason against. const caps = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.split('');

LGTM

Re: Atom Shell is now Electron

#65

Earlier quoted context omitted.

As others have pointed out, the semantics are pretty hard to deal with. But, it's the style that I think is the really bad part of this snippet. Why would you create an array of empty elements to iterate over just to grab the index? In CoffeeScript, however, the language guides you to this solution: [65..90].map (number) -> String.fromCharCode(number) where you're operating on the elements of your array and you don't…

> Why would you create an array of empty elements to iterate over just to grab the index? Because it's the shortest way to do it in that language. I think something like: [A-Z].reverse or: reverse([A-Z]) might even be better. Do you know of a language with that syntax?

If you want an index, use an index:

    for (1 = 65; i 
It's not like the syntax is that bad. But, iterators are simpler than indexing a collection. Iterators work with data structures like linked lists where you don't really have an index. And, they work when the collection changes while you're iterating it.

Re: Atom Shell is now Electron

#66

Earlier quoted context omitted.

> Why would you create an array of empty elements to iterate over just to grab the index? Because it's the shortest way to do it in that language. I think something like: [A-Z].reverse or: reverse([A-Z]) might even be better. Do you know of a language with that syntax?

If you want an index, use an index: for (1 = 65; i It's not like the syntax is that bad. But, iterators are simpler than indexing a collection. Iterators work with data structures like linked lists where you don't really have an index. And, they work when the collection changes while you're iterating it.

But you can't also output an array without additional lines of code.

Re: Atom Shell is now Electron

#67
Is it me, or does it sound a bit bloated:

> It now includes automatic app updates, Windows installers, crash reporting, notifications, and other useful native app features

* automatic app updates : We have distribution repositories for this. * windows installers: Doesn't window have it's own like app store now (market something?) * notifications: which we already had on all major OSs for years.

Re: Atom Shell is now Electron

#68
post #60
post #59

Earlier quoted context omitted.

> 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 tu…

As 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…

FWIW, that same creator created Jade and Stylus which are pythonic like CoffeeScript. What's wrong with HTML and CSS? I could never take his stance against CoffeeScript seriously.

Re: Atom Shell is now Electron

#69
post #68
post #60

Earlier quoted context omitted.

As 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…

FWIW, that same creator created Jade and Stylus which are pythonic like CoffeeScript. What's wrong with HTML and CSS? I could never take his stance against CoffeeScript seriously.

I can't speak for him. I've had fellow programmers love CoffeeScript for their own personal / client projects - but they conceded that for the real deal - a public open source project should stay in JS. Otherwise, it'd scare off swaths of top tier JS coders from contributing. Atom serves as an example of this practice [1].

The smell CoffeeScript in core gives off to them - while I don't subscribe to this - is that "it's an amateur job, don't bother". You don't write open, core code in an abstracted language. That's so suspect. Personal / internal projects are OK, a few I save CS specifically for those situations.

If you look at the source of Express.js, you can see the javascript has it's own aesthetics to it. You can think of express/connect as serving exemplary of node.js code, for now.

On a topic of the CoffeeScript creator, Jeremy Ashkenas also created Backbone and Underscore. These are pretty much examples of top tier JS in the browser. The projects are known for their annotated source:

- http://underscorejs.org/docs/underscore.html

- http://documentcloud.github.com/backbone/docs/backbone.html

You can't output this kind of code with CoffeeScript. You have to let in sink in and understand the patterns (the way .extend works in underscore and how Backbone builds upon the idea to add it to objects.)

[1] https://discuss.atom.io/t/goodbye-atom-some-feedback/12301/3...

Post reply on HN