Why is it that JavaScript development is crazy

Source: Internet
Author: User

Network Development Fun! Javascript is ... It's a daunting one.

All the other things in web development are very well matched, but to Javascript, you feel like you're missing a chunk of the basics, and you don't understand it.

The truth is, yes, you did miss a few pieces of jigsaw.

However, the status quo of front-end development is actually very crazy.

You're not the only one who's mad.

Pull the chair and sit down. It's time to write a Javascript application.

The first step is to build and run the local environment. is with Gulp, or Grunt, are not good ... Or use the NPM script!

Webpack or browserify? (sorry) or require.js? Do you want to upgrade to ES6? Is it too much to add Babel in preprocessing?

Behavior-driven development or regular unit testing? What kind of assertion framework should I use? If you can run tests from the command line is a good thing, why not try Phantomjs?

Angular or React? Where's Ember? How's Backbone?

Some React documents write: "Redux is a predictable state container for JavaScript applications. "Great! You must have one."

Why is it so crazy to build Javascript apps?!

Let the author help you figure out why it all seems so crazy. First look at an example, and then look at the beautiful picture.

The following is React's "Hello, world!" Application.

Main.js

var React = require (' React ');

var reactdom = require (' react-dom ');

Reactdom.render (

  

Hello, world!.

,

document.getElementById (' example ')

);

It's not over yet.

$ NPM Install--save react react-dom babelify babel-preset-react

$ browserify-t [babelify--presets [react]] Main.js-o bundle.js

In fact, there are a few steps missing, such as the installation of browserify, and what to do after the completion of this, in order to let it run on the Web page, because only these can not generate a useful page.

Once this is done, you will get a file called Bundle.js, which is the new React Hello World app, containing 19374 lines of code. Next, you only need to install browserify, babelify, and react-dom, and then measure thousands of unknown code.

That's basically it ...

Now use basic Javascript to write a Hello World app.

This is the whole content. 18 lines of code. You can copy and paste them into a file called index.html, and double-click to load it into your browser. All right.

If you say to yourself now, "but wait a minute, React can do more than the little thing you just wrote, you can't write javascript!." This (most) is true, and you will soon find out why everything is so crazy.

Now you can see the picture I mentioned.

  

The Javascript web app you're creating will basically appear somewhere in the middle of the bell-shaped curve. In the middle, if you start with the React full stack, your app has been a huge violation of design standards from the start.

That's why everything is crazy. You think most of the tools you have to use are to solve problems that are not present, or that will never happen.

Look at this picture again:

  

The status of Javascript development is flawless and confusing, as everyone is unaware that their application has violated design standards by default.

How do you start building a Javascript application? Should you use a tool like React or Angular? What if you don't have to do it? Is there any need for testing? Do you want to use JavaScript to generate tags? Before you start to build the default large technology stack, These are the questions that you should answer. When you start developing your Javascript app, the key is to pick a point on the bell curve as the ultimate level of complexity for your app.

Frankly speaking, it takes experience to achieve this. However, there are many Javascript applications that can draw from the starting point: Jquery plus client templates, and a very simple construction tool to connect and reduce production files (assuming your background framework does not yet have this feature).

If you know how to properly construct a Javascript application, you will gradually understand how, when and why to use frameworks, NPM, require, webpack or ES6, when to write tests, when to test locally, when to test in a browser, and other problems and troubles that may arise.

Why is it that JavaScript development is crazy

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.