CoffeeScript is dead. Long live CoffeeScript!

Source: Internet
Author: User

CoffeeScript is dead. Long live CoffeeScript!

As you may have heard, JavaScript is going to release a new version-ES6 this year. The name comes from the sixth important version that follows the ECMAScript encoding standard: ECMA-262. This long-awaited release will include some new features that will be of great benefit to the vast majority of JavaScript developers.

Some fascinating buzzwords ...... Class, string interpolation, generator function, arrow function, iterator, and for/of loop. These are significant advances, but you may also know that many or more of these features have been in the form of CoffeeScript for a while, it is "a small language compiled into JavaScript ".

I have been using CoffeeScript encoding for some years. When building a complex application, a developer must be able to see the code and quickly understand what the code is. CoffeeScript makes it more efficient for me to do this work than to use JavaScript. I love CoffeeScript, love it for productivity improvements due to the syntax of the introduction, and love its freedom from visual disorder.

ES6 has added many new things. However, for example, an American coffee that has been washed with water is far from me. As a fan of CoffeeScript, I'm glad to hear some of my favorite New Features of CoffeeScript, such as Arrow functions, are now added to JavaScript. However, they do not use the same flexibility for implementation, and there are other embarrassing issues in it.

CoffeeScript allows you to do this:

Solipsism = true if mind? And not world?

Very elegant, isn't it? In ES6, you still have to deal with malformed things like this:

If (typeof mind! = "Undefined" & mind! = Null) & (typeof world = "undefined" | world = null) {solipsism = true ;}

This is not complete yet. In string interpolation, the use of the reverse marker ') is just a normal weird, parentheses and curly braces are required at any time. Even on Sunday.

Many developers who try CoffeeScript for the first time complain about its space-sensitive features. To be honest, this guy also pitted me several times at the beginning. But I found that these problems are easy to avoid, and more importantly than these small problems: My code can always stay away from semicolons, Parentheses, · this · keyword pollution, like Toyota Prius at the AI Gore conference.

Many new features in ES6 are obviously inspired by CoffeeScript. So why can't we embrace these changes? The current form of JavaScript is a textbook-style software designed by the Committee, filled with conflicting comments and strong disagreements among the members. A few years ago, ES4, the predecessor of ES6 development, had to be abandoned due to the different opinions and arguments on the architecture. In this board model, this software can be released only when everyone is tired of argument. The Committee) People reluctantly compromised, threw themselves up, and ordered a pizza to celebrate their achievements.

CoffeeScript will not be compromised. It is a somewhat utopia vision of what JavaScript can be. This narrow focus is probably the reason why CoffeeScript has gained such a reputation for polarization. Developers can either put their hands off or sneer at it. If you can accept it for its superficial value, CoffeeScript has accomplished its mission well.

This is a departure from the "standard", just like the first bright-colored iMac, which was a refreshing departure from the pale-brown PCs in 1990s. At the beginning, people complained: "I don't have a software drive ". Of course, only after a month or so will everyone suddenly realize that they don't need a soft drive. Oh, it's like the Android phone or iPhone with a smooth glass mirror in your pocket? I remember Microsoft's Steve Ballmer once declared that the iPhone was just a toy and "impossible" to have a market-because it didn't have all the keyboards that 'form' smartphones should have. Standards are good only when they are pure enough in their own direction.

Remember that it is crucial unless you are using assembly language programming or machine language itself, but any programming language is an abstraction. We discuss how many abstractions are appropriate and what role should be played in our work is related to actual standards. This is basically determined by the individual. For each developer and each team, there is no right or wrong answer.

For our team, this problem is mainly centered on a collaborative environment and our desire to pull the horse. This so-called technical activity focuses on the work of many developers. We can say with confidence that we have an ongoing discussion. Many comments, right ?) Our team is striving to strike a balance between adhering to established standards while leaving room for developers to create and choose tools to work for them.

I think CoffeeScript may continue with JavaScript and drive JavaScript innovation. After all, this is not a true or false proposition. Even if CoffeeScript disappears one day, I think Metaprogramming Language, a Metaprogramming Language like CoffeeScript, will be of great value, it allows programmers to imagine and understand their code in a new way. This helps improve everyone's artistic hierarchy.

Be a sociable person. Come and share it!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.