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
Replace CoffeeScript with ES6
161–170 of 178 posts
Re: Replace CoffeeScript with ES6
#162Earlier 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.
https://github.com/purescript/purescript/wiki/Recommended-Li...
Re: Replace CoffeeScript with ES6
#163Earlier 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…
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
#164Earlier 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".
Don't forget, Python is the community that brought us "There's Only One Way To Do It".
Re: Replace CoffeeScript with ES6
#165Earlier 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…
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
#166Earlier 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).
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
#167Earlier 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…
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
#168Earlier 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?()
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
#169I 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…
Re: Replace CoffeeScript with ES6
#170Earlier 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.