samedi 5 novembre 2016

How should I go about a long JavaScript file using the module pattern?

I am learning design pattern in JavaScript, and I'm going to use the module pattern. I'm puzzled with two things.

1 - If I would create a plugin, then I can use the module pattern, and have private and public methods/variables. But if I have a full JavaScript file, I don't need private and public methods, since one part of the program has nothing to do with another part. So what's the point of private and public methods?

2 - Since the JavaScript file is really long, should I have nested module's? How should I go about a full file of JavaScript?

Aucun commentaire:

Enregistrer un commentaire