Live data from Hacker News

Replace CoffeeScript with ES6

robots.thoughtbot.com

161–170 of 178 posts

Re: Replace CoffeeScript with ES6

#161

CoffeeScript syntax is better and cleaner than the ES6 syntax. It's a fun language, and I've been using it everyday since it came out. On small projects, it's top-notch. But the future of CoffeeScript is bleak because many software designers are beginning to understand the value of type systems, e.g. TypeScript and Flow, for building maintainable Javascript code bases, and this means CoffeeScript is out of the pictur…

Speaking of putting away childish things (like effect-ridden, imperative spaghetti code), PureScript is my new CoffeeScript. http://purescript.org

Have you found a good framework that purescript supports in the vein of Angular or React? I had a look a while back but the support was a bit spotty for me.

Re: Replace CoffeeScript with ES6

#162

Earlier quoted context omitted.

Speaking of putting away childish things (like effect-ridden, imperative spaghetti code), PureScript is my new CoffeeScript. http://purescript.org

Have you found a good framework that purescript supports in the vein of Angular or React? I had a look a while back but the support was a bit spotty for me.

I can't personally recommend any yet, as I'm still warming up to it, myself.

https://github.com/purescript/purescript/wiki/Recommended-Li...

Re: Replace CoffeeScript with ES6

#163
post #110

Earlier quoted context omitted.

As an example that I deal with daily, writing React components in CoffeeScript v.s. Javascript really highlights the elegance of CoffeeScript. Of course you can reduce the JS verbosity with JSX instead... which again is introducing a pre-processor to the mix (one I personally am not a fan of, but w/e). ES6 adds some sweet stuff for sure, but IMO it doesn't make JS a pleasure to work with yet (which seems to be the ar…

"it doesn't make JS a pleasure to work with yet (which seems to be the argument?)" My interpretation of what Retozi is saying is that CS just means that in addition to understanding JS, including ES6, you need to be familiar with all the different ways things can be done in CS. I tend to agree, especially as JS is becoming an improving with each release. What I'd like to see going forward is JS continuing to add sele…

My experience is the exact opposite. I find that CS removes a lot of the JS gotchas, and I'm not clear on the many ways that CS let's you do something, especially in comparison to JS. If anything it protects you a bit, by trying to enforce some of the "good parts".

http://arcturo.github.io/library/coffeescript/07_the_bad_par...

To each his own, but to me CS has been and continues to be a complete and obvious win over JS. 9 times out of 10 the benefit outweighs the annoyance of requiring a preprocessor for me.

Re: Replace CoffeeScript with ES6

#164
post #92

Earlier quoted context omitted.

Ex-Coffeescript ,now Javascript with lot's of Python experience guy here. The "I understand CS code much quicker" argument is a valid one theoretically, but In my opinion, it does not hold up practically that well. CS got one thing wrong that Python got right: There are many ways to do things. When writing CS, I understood MY CS just fine... but it always took me longer to understand the CS of other people. Sometimes…

> There are many ways to do things Hopefully you realize that most Rubyists will strongly disagree and think that's not a "problem".

What's with the specious slam on Ruby out of nowhere?

Don't forget, Python is the community that brought us "There's Only One Way To Do It".

Re: Replace CoffeeScript with ES6

#165
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…

I'm not setting up a straw man. I'm saying that it makes more sense if computers and humans are looking for the same things. Since humans read the indentation, computers should read the indentation too.

The way things are in bracketed languages, humans and computers read different things, and you just have to hope that they always match up. Sometimes they don't, and the human and computer will have a misunderstanding. To make it a real linguistic redundancy, like in Spanish, the compiler should read both and issue a warning if the indentation is incorrect or misleading. As it is, you and the computer are actually speaking different languages.

Re: Replace CoffeeScript with ES6

#166
post #84

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…

It's not just significant indentation. CS parses "f + g" differently from "f +g" (the former is an addition, the latter is a function call with "+g" as the first argument).

Yeah, the unary operators can cause gotchas.

Also, here's a gotcha I've run into where `a(b)` is considered different from `a (b)`

x a(b), c # => x(a(b), c);

x a (b), c # => x(a(b, c));

Re: Replace CoffeeScript with ES6

#167

Earlier quoted context omitted.

I like the indentation + braces redundancy because indentations are for humans, brackets are for the interpreter. Logic blocks are more explicit with brackets I encountered a non-obvious Python bug that was caused by mixed spaces-and-tabs: to my human eyes, the indentation looked fine - the same as previous line, but the interpreter saw a different level of indentation.

> I encountered a non-obvious Python bug that was caused by mixed spaces-and-tabs This is why PEP8 exists and people are supposed to follow it. Additionally, mixed spaces-and-tabs is a bug that causes poor readability - there's plenty of people who have their editors set to have tabstops as 2 or 3 spaces rather than 4, and your code will look wrong in their editors. If you think there's any issues with mixed tabs and…

Just installed SublimeLinter. Thanks!

It puts some icons in the margins, but I can't figure out how to get an explanation of those icons. I see a bunch of !s next to my import statements.

Re: Replace CoffeeScript with ES6

#168

Earlier quoted context omitted.

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?()

If you're accessing objects that deeply, something is breaking the Law of Demeter about locality of reference and looseness of coupling.

It's a syntactic convenience, but it leads to questionable patterns. Do you really want to silently collapse the hierarchy of whatever was null? I'd rather identify it and fail with a specific message or behavior rather than generically.

Re: Replace CoffeeScript with ES6

#169
post #7

I give credit to CoffeeScript with really helping to push the ES specs forward and think it helped introduce more people to JS and grow the ecosystem. Heck, I used it for a year, liked it, and had it change some of my approaches to writing JS. That said, I hope it slowly fades into the background as more people go back to vanilla ES6 or go with something more powerful such as TypeScript (or Flux). With the progress a…

[deleted]

Re: Replace CoffeeScript with ES6

#170

Earlier quoted context omitted.

Speaking of putting away childish things (like effect-ridden, imperative spaghetti code), PureScript is my new CoffeeScript. http://purescript.org

Have you found a good framework that purescript supports in the vein of Angular or React? I had a look a while back but the support was a bit spotty for me.

Maybe https://github.com/paf31/purescript-thermite ...
Post reply on HN