B
B
Borodean2014-09-23 22:58:29
JavaScript
Borodean, 2014-09-23 22:58:29

How to understand that it is time to complicate the JavaScript code with asynchronous modules (RequireJS, ...)?

At some point, the introduction of a new abstraction complicates the code less than if you continue to write in the old way.
A certain trigger must work for the programmer. Like, I write, I write, before that it was normal, but now I added lines and now it’s enough to complicate and duplicate, I’ll select a piece in the method. From simple to complex. Do not introduce new entities before necessary.
Asynchronous Modules (AMD) such as RequireJS help organize code in Javascript. But when should the trigger work, that it is time to complicate the system with them?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey, 2014-09-23
Protko @Fesor

Yes, as it were ... always possible. If your code can be broken down into modules/components, then this is the time. It's not an abstraction, it's a module system. In production, the assembled version is usually laid out (what kind of r.js or browserify). ES6 is coming with its browser-supported module system out of the box.

K
Konstantin Kitmanov, 2014-09-24
@k12th

If you are using any MV* library, then it's time.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question