CSS and include files can be practical ways to change many portions of a site’s content at once. Furthermore, CSS allows the format of a document to further separate from its content. However, both of these can be unnecessary certain types of manual editing. Before using tons of include files and getting mired in a mess of CSS manipulation, consider the following options:
1. How many pages will this affect? As the number of pages increases, both CSS and include files become more important. Likewise, as the number of pages decreases, it becomes much easier to just make the change directly into the pages, or with a “global find/replace” type function available through most IDE’s and text editors.
2. Will the content really be the same on all the affected pages? If there are multiple variations to different subsets of pages, then include files and CSS immediately become more complicated. Managing different classes of tables, as well as which table is on which page, becomes increasingly complicated through the use of different folders. I recommend that these differences be demarcated with separate sets of CSS/include files per folder, so that a single giant CSS is not downloaded for each page. Also, large and convoluted include files can be avoided through the use of multiple simpler includes per each different folder. Clearly, as the size of a site increases, it must increasingly self-organize in order to be maintainable.
3. How often will this component change? Include files are useful when a component that changes frequently must have that change reflected on many pages. If the same section’s content will not change often per all the different pages, it is probably not necessary to use an include file. Likewise, while CSS separates out formatting, if there are formatting elements not expected to change, then time can be saved by avoiding a complex CSS implementation.
As always, some analysis and design in advance as to the frequency and types of changes to be made to a site can have a dramatic impact on its maintainability. As a site may require redesign to accommodate an increase in revenue, this may be a good time to consider re-architecting the site for CSS and the use of include’s versus manual edits.
Note: Not every file needs to be in perfect harmony with the gods of Computer Science in order to be profitable to a business. Expecting frequent changes is a common junior mistake at work — a better strategy is to query about the cost of maintenance up-front. CSS and includes cost more to build, so it is up to management as to whether the budget supports these changes. The site maintainer must understand that if they are providing reliable estimates on time for manual edits vs. CSS, and if the client is comfortable paying for these edits for whatever reason vs. going to CSS and include files, then it is an acceptable outcome of the business.
Posted in Computers & Internet, Functions | Tags: computers, consulting, html, internet, technology













