lundi 6 juillet 2020

Should I organize a JavaScript web app in a single file or in several files?

Is it better to insert a whole web app in a single .js (JavaScript) file, or is it better to split it in several files?

I come from programming languages like Java, where code is organized in classes, and a single class having thousands of lines of code would usually be a Blob antipattern.

I would like to ask if in JavaScript, similarly to Java, it is good practice to divide the web app in several .js files, and in particular if each .js file should consist of a single class.

Aucun commentaire:

Enregistrer un commentaire