Why do people always have black JavaScript? Is it really that bad? --Love to create classroom

Source: Internet
Author: User
Tags script tag

Focus

I really don't understand why some people are always black JavaScript. I like JavaScript, it's not everything, but it's closest to what we expect to "run anywhere"! See details below.


With JavaScript, you can write an app that lets it run in:


    1. on your browser (almost all browsers).

    2. your phone and tablet (e.g. React Native,cordova)

    3. your desktop software (like electron running on Mac, Linux, and Windows).

    4. your server is node.

    5. even in your database (e.g. MONGO db).


With JavaScript, you don't need to download a 4GB-size IDE to create a Hello World program, you don't have to wait 30 seconds to compile and then execute your app, all you need is a text editor.


It is true that JavaScript is flawed, but any other language is far from JavaScript in terms of applicability and flexibility.


I am delighted with the innovations (and outbreaks) of JavaScript tools, frameworks, and libraries. I know it may make the learner feel tired, but these new things are fun, and you don't have to learn all the new things.


I want to say that we can stop creating "language" on top of JavaScript and stop using these new languages in your projects. We already have enough of these languages: TypeScript, ELM, Coffeescript, and many others. I highly recommend that you do not use these new languages in your project.


I will describe why not use them, but first of all, I would like to express that I appreciate these creations, which provide a variety of choices for our development, and, most importantly, I am grateful to those who have created great tools and "languages".


I used to be a firm coffeescript powder. A few years ago I decided to use it in a project, and as the project evolved I quickly realized that it was the worst choice I had ever made, and then I spent six months digging into the project and rewriting the whole project completely in JavaScript.


Here are some reasons why using Coffeescript is a bad choice:


  1. I need an extra build step to "compile" it into JavaScript, not a big problem but sometimes annoying.

  2. It's hard to debug because what you see in the browser is the compiled code, which is different from the content in your coffeescript source file--In most cases it's very readable, but you still need to change your mind.

  3. The biggest problem now is that there is a steep learning curve for any new members who join the team because they have to learn a new language.

  4. Most of the online examples (99%) are written in JavaScript.

  5. The team began to lose part of JavaScript skills. Slowly, the JavaScript code begins to read like a different language, and we hope everything we see is coffeescript.

  6. We can't keep up with the development of JavaScript, such as es6--arrow functions, Deconstruction, and so on.

  7. We can't just run a few lines on the script tag to do some simple testing, and if we're going to do a test, we'll have to use JavaScript first and then "translate" it back to Coffeescript after the test.


Although I did not delve into the use of TypeScript or ELM, I think they should have similar problems.


re:typescript--very cool concept, I understand some of the benefits of using it, but why should we force a dynamic language to "behave" like a static language? C # is racking its brains to behave more dynamically, and now we're twisting our brains to make JavaScript more static. What the hell!!!


Long story short (TL;DR).


    1. Stop black JavaScript and start liking JavaScript.

    2. Don't make other languages on top of JavaScript.

    3. Embrace the dynamic nature of JavaScript.



Why do people always have black JavaScript? Is it really that bad? --Love to create classroom

Related Article

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.