| Is Your Site's Code Bringing Down Your ROI? |
|
|
|
| Web CMS | |
| Written by Joe Lucas | |
| Tuesday, 04 March 2008 | |
It's a well known fact that good site design is crucial to site performance. What’s not as easily understood, however, is exactly what constitutes 'good site design.' In my job as a Sales Engineer at ClickTracks, one thing I encounter almost on daily basis are web sites that have been poorly built from the ground up. What I mean by this is that in addition to ignoring the 'basic' good site design rules - unique page titles, smart navigation, CSS, etc. - these sites are also missing strong coding techniques.
Choose your platform correctly
Object-Oriented Design is your Friend
If object-oriented design isn't available, you can make the best of the situation by taking advantage of file includes and a template-based design. Taking this approach is a viable workaround if an object-oriented approach isn't in the cards for your site. Let’s take a look at how includes and templates can improve the ease of maintaining your site. Consider the following example written in PHP
<?
$html=”Some Page content Here”;
include “/footer.php”; That seemed simple enough. I’ve got a common header file and a common footer file. So, if I needed to make any updates to my footer or header I can easily do it in one file and have the changes propagate live throughout the site. But should we stop there? No way! Maybe we can do something similar with a common navigation include to make updates to the navigation much more efficient, as well. Let's check out the code for that:
<?
$html=”Some Page content Here”;
include “/footer.php”; One additional line of code is all it takes to make that happen—excellent! The code above should be fairly easy to maintain while still allowing a good degree of customization.
This is probably the easiest way of building a large site in PHP, but it’s not without its own limitations—think about things like unique page titles. In order to give each page a unique title, we either need to give up the header include and hard code the header information into each page (the least appealing and most time-consuming option) or we could make the code more complex in order to facilitate a dynamic page title. So what's the answer? By deploying an object-oriented approach to the site, we can overcome these obstacles while still maintaining a template-like design. Let’s revisit this example using an object oriented approach.
<? Example of page.php:
<? In the above code snippets, we’ve succeeded in doing two things: First, we've shortened the code that initializes each page, which means a lower overall file size and a faster load. Then, we've also created a central access point for updates. Now, no matter what needs to be done to the overall page layout on your site, you only have one place to go to make changes and push them live. You can pass in custom content, or in the above example, just a page ID which could be used to grab content from a database and put into the page. We’ve also then succeeded in being able to have a template design for easy maintenance, as well as preserving a unique aspect of each page. Optimizing your Code
Is this all there is to know about improving site performance? Certainly not—it's just the tip of the proverbial iceberg. This is what it comes down to: Building a web site correctly from the ground up will impact every decision you will make for the lifetime of that site. Making the right choices early on will save money and improve the overall financial performance of the site. And after all, isn't that one of the goals you're after? Comments (0)
![]() Write comment
|
|
| < Prev | Next > |
|---|





It's a well known fact that good site design is crucial to site performance. What’s not as easily understood, however, is exactly what constitutes 'good site design.' In my job as a Sales Engineer at ClickTracks, one thing I encounter almost on daily basis are web sites that have been poorly built from the ground up. What I mean by this is that in addition to ignoring the 'basic' good site design rules - unique page titles, smart navigation, CSS, etc. - these sites are also missing strong coding techniques.

