var keyword to beautiful loops to elegant operating overloading to substring to named parameters in 2.0, Ruby is one sexy jewel. I think I just invented code-lust. Don’t worry, I will totally remember to edit this out before I publish.
Basically, the standards body came to the realization that typing out
function every two seconds can become burdensome. This is especially the case with callbacks.
Here’s an example…
Isn’t that jaw-dropping-ly gorgeous? It reminds me of the lambda syntax in C# (which I adore). I truly believe that this is a great step in the right direction. Note that Arrows do infer
this as being the scope of their surroundings.
This should have come years ago. It was one of the reasons that I tried using CoffeeScript for a while. Now, it’s so beautiful…
It’s something small, but it has become a necessary convenience in 21st century programming.
Modules and Imports
And exports are just as elegant.
There is really nothing new here. We’ve all taken advantage of Promises or a module that depends on some sort of Promise. Now, we are simply incorporating it into the language. Hopefully, this will encourage the use of promises over the anonymous, asynchronous callback functions that tend to morph into spaghetti code over time.
If you are interested in learning more without reading the spec, this repo gives an overview in a nice markdown file. I love it, because it makes a great reference. It won’t consume too much of your time. If you want to check out the spec, the latest is here.
Come on members. Vote on the final draft! We may have found Nirvana, and I’m not talking about any teen spirit.