Project organisation
If we want to facilitate the easy removal of code from our website/application, we need to think about the way we organise the files that make up our project. Typically, when building websites, particularly web applications, it's useful to think in terms of modules or components; definable sections of the user interface. These modules might be defined primarily by visual areas or perhaps due to the files that generate them. Either way, taking the time to consider the organisation of these modules is well worth the time investment.
Ordinarily, it's a common practice to split the files in a project by technology type.
Consider this basic folder structure:
my-project/ - html/ - js/ - css/
In each of these folders you might name related files. For example:
my-project/ - html/ - v2ShoppingCart.html - js/ - v2ShoppingCart.js - css/ - v2ShoppingCart.css
The rub though is that beyond a certain point, even giving the files related names, it's difficult...