Live data from Hacker News

Replace CoffeeScript with ES6

robots.thoughtbot.com

141–150 of 178 posts

Re: Replace CoffeeScript with ES6

#141
I had fun with CoffeeScript but my projects definitely had its frustrations. CS allowed me to write some pretty damn ambiguous code.

Also when working with external libraries and dependencies, I found myself resorting to trial and error figuring out the correct syntax because nearly all documentation is written in JS and not CS.

Re: Replace CoffeeScript with ES6

#142
post #100

Earlier quoted context omitted.

I sure hope you're wrong. The unnecessary clutter of plain JS is just painful to look at. I can't remember how many times I've looked over a 40 line block of JS searching for a missing. When there are many )} )}; } ; } ; } -- it is just downright frustrating to be be wasting any time on what is effectively irrelevant syntax. With CS, it's indent and be done with it. It's like SASS vs. SCSS. Or Haml vs. ERB. I can't,…

> "With CS, it's indent and be done with it" As others have said, it's all fun and games until two people edit the same source file, one of whom has the dangerously incorrect opinion that tabs are better than spaces :-) I use a lot of semantic whitespace languages (CS, Haskell, Python), and it's a tradeoff: you gain in terms of redundancy, true, but there's an additional human overhead of making sure everyone's got t…

I see no reason why anyone should care that CSS is valid SCSS and HTML is valid ERb.

Re: Replace CoffeeScript with ES6

#143

Earlier quoted context omitted.

> Python's lambda semantics are limited due to the syntatic limitations created by Python's significant identation. (nitpick: you seem to consistently use "identation" in place of "indentation".) I'm pretty sure that plenty of proposals consistent with Python's significant indentation have been proposed; python's lambda syntax is limited due to the BDFL not being convinced of the utility of more capable lambdas over…

> nitpick: you seem to consistently use "identation" in place of "indentation". Consequence of English not being my first language, and "indentation" being way too similar in it. I just can't spot the change. I've seen a couple of proposals, yes they'd work, but they seem to be always ugly. But the problem is not that significant indentation makes it hard to create lambdas (Haskell's ones, for example are fine), but…

> And no, computers don't deal fine with it.

Sure they do.

> To minimise some Python code you need almost an entire Python parser.

I don't think source-to-source transformations requiring a parser for the source is an indication that it is problematic for computers to handle something. I mean, to execute the source code you need a parser, too, and no one says that needing a parser for execution is a sign that computers don't handle a language well.

> Assembling Python code from small pieces (something that is really important for Javascript) is a frightening problem.

Sure, assembling by cut-and-paste is a problem with significant indentation, especially when using media (like the web) which do not respect indentation well.

OTOH, using significant amount of cut-and-paste coding (rather than reuse by library code) is a sign of a problem with the language, development process, and/or execution environment, anyway, so I don't see it as a particular problem that a language structure isn't friendly to copy-paste coding.

Re: Replace CoffeeScript with ES6

#144
post #96

Earlier quoted context omitted.

Significant indentation is a good thing. Haskell and Python do it too. It's much easier to read indentation than it is to match up pairs of brackets in your head. In other languages, if the indentation doesn't match the brackets, you'll naturally read the indentation first and get the wrong impression of what the code does. In those languages, the indentation is supposed to match the brackets anyway. Why be redundant…

Significant indentation is enough for me to avoid Python. It just doesn't have enough to offer vs. the available alternatives without significant indentation. It's much easier to read indentation than unindented/badly indented pairs of brackets, but you're setting up a strawman - it's not either or - and then you tear down the strawman yourself by pointing out we match the indentation anyway. My code generally is pro…

An easy solution to the tab problem is to use spaces instead. A good text editor will even let you use the tab key to insert a set number of spaces.

Re: Replace CoffeeScript with ES6

#145

Folks, this was always part of the plan ;) CoffeeScript is a fun little experiment in what's possible when you take JavaScript semantics and try to boil down the user interface to a minimalist surface. But JavaScript will always keep on rolling onwards — and to the extent that future versions of JavaScript take any minor inspiration or reference or overlap with things that CoffeeScript already does, the more the bett…

Thank you jashkenas-sama, please keep the good works with coffee (and underscore, backbone, etc.). We Rubyists and Pythonians are all (well, at least I am) eternally grateful to you for having delivered us from the evils of brackets, parenthesis, if !condition, and that thing were we had to firstArg = [].prototype.slice(arguments, 1) in every function where we needed splats.

Re: Replace CoffeeScript with ES6

#146
post #89

Earlier quoted context omitted.

How much of this beauty will be fixed in ES6? http://wtfjs.com

Some of those problems are with the DOM and browsers, not JavaScript.

True, there are numerous issues with each and every aspect of client-side web development: http://wtfhtmlcss.com

Re: Replace CoffeeScript with ES6

#147

Earlier quoted context omitted.

...two people edit the same source file, one of whom has the dangerously incorrect opinion that tabs are better than spaces Commit hooks will help you: http://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks The bigger your team, the more you need them.

For open source projects, that's less of an option, but regardless, an individual's opinions about tabs and spaces are moot when working on a multi-dev project. You follow the project's conventions, or your changes don't get merged.

Yes it is frustrating that git doesn't automatically transfer hooks to cloned repos. I guess I understand the standard explanation of "git clone" never running arbitrary code on one's machine (although in a sense that is git's purpose), but it does reduce the use of client-side hooks in open projects.

Re: Replace CoffeeScript with ES6

#148
post #89
post #56

Earlier quoted context omitted.

And the beauty of using ES6 is when the browsers you need to support handle, you just remove the transpiling step.

How much of this beauty will be fixed in ES6? http://wtfjs.com

Bad code leads to inconsistent behavior. Who would have thought.

Re: Replace CoffeeScript with ES6

#150
post #2

Why not both? This makes a good argument for ES6, but CoffeeScript's fundamental changes to syntax are just preferred by some.

Some reasons why I will stick with CS: * Optional braces and parenthesis. Results in visually cleaner and more compact code, especially when dealing with large objects. * Requiring backticks to do string interpolation seems like an ugly hack. * CS uses dots to slice and splice ranges: host?.split(".")[-1..][0] == "dns" BTW, notice in the example above two additional CS features that don't exist in ES6: * The existent…

> The existential operator `?` soaks up null/undefined references.

This seemingly minor feature is so huge for me. Accessing deep objects?.is?.a?.horrible?.pain?.sometimes?()

Post reply on HN