I am a JavaScript developer and have most of the time faced a problem of arranging the code in a modular fashion so that it does not grow too big. I am aware of JQuery modules but I am not comfortable because as the project grows there is a huge chunk of code that populated the entire file. So is there any JS framework or some kind of solution for this so that I can easily modularize the code and is more readable and good for robust front end application. Please suggest me some frameworks or any other idea which would help in better structure of the code and also lets me build a robust apps.
6 Answers
I would suggest you to try the AMD style for javascript modularisation. You can use requirejs as module loader/dependency injection system and some MVC framework (backbone?) for complex application management. After understanding the basic concept you'll be amazed about how tidier javascript can be ;)
3 Comments
Backbone.js is an architectural app that helps to structure code. It can be used with other popular libraries such as jQuery or Zepto
Comments
The short answer is to look into a library that has a concept of modules at its core, like YUI.
1 Comment
I recommend terrificjs.
TerrificJS is a neat, clever piece of code that allows you to modularize your jQuery code by solely relying on the OOCSS naming conventions.