Best Practices in Development

Over the last few days I've been working on a relatively large change to my image linking logic. This change involved some reorganization on the server side, adding name-spacing, changing the url structure, and placing 301 redirects to all 1200+ of my photos. I made this update both in hopes of keeping some relative SEO content on the photos linked in my blog and because I wasn't happy with the original implementation (especially the data storage). This post isn't about the update, though. I wanted to talk a bit about some of the principles I used on this and other projects I work on.

Incremental Changes

This update was a rather large one to my engine. I needed to change more than just a few image links - I upgraded my entire image storage system to a relational setup. Eventually this will turn into a dedicated photography site (photos.jacobemerick.com, mayhaps). Trying to change everything and push it live at once would have been asking for disaster.

Instead I broke down this change into five steps. Each step could be tested ...

read more »

Beginner Web Developer Mistakes

With my introduction into web development coming from a static html/css direction, I've had to overcome several bad coding habits over the years. Most of these started with poor assumptions about the way websites worked. It took a crash course in php programming and a few hard bumps before realizing how wrong my first websites really were. Here are a few of those assumptions and how I built on them to increase my programming skills.

Each URL relates to a unique file on a web server

If you're only used to working with static html files than this assumption is largely true. Every different URL that a user visits on a web page is in reference to a different file on the server. Without any type of scripting, the file is merely a chunck of html and can only be changed by a webmaster physically manipulating the document. My first dynamic website used php include commands to pull a fixed header and footer for all of my pages, allowing me to make global site changes from a single file. When I finally started to learn more about php variables ...

read more »

Website Overhaul

It may be no surprise to any of my long-term visitors, but I've decided to perform a deep overhaul of my website. Based partly on my recent introduction to model-view-control frameworks and partly on research into web caching and optimization, I've spent a good chunk of time analyzing my current and future website functions in the hopes of streamlining the backend code and optimizing the frontend. There are several goals that I have in mind for this overhaul, most of which will stretch my current programming skills.

Model-View-Controller Setup

The idea behind this sort of programming is breaking everything up into separate, reusable objects. All requests to the website are directed to a primary router, which interprets the request and pulls a controller to handle the page. A controller is a set of instructions based on the page type (example: home page, blog post pages, etc) that sets variables for the final page. The controller may talk to a model, which is the 'logic' for the site (usually a database object), and pull additional ...

read more »

Dynamic Template Methods

Ever since I started working on websites during the summer of 2006 I made sure to keep dynamic and static information separate on my projects. Certain things in the website's content should remain the same, or similar, on separate pages: header, footer, navigation, etc. (I'll refer to these similar pieces as 'static' and the content that is unique to each page as 'dynamic'). However, when you work on a website with multiple pages, it becomes difficult to update the static information the same on all pages. This is where a templating system comes in handy.

A templating system allows the developer to separate the content to ease updating. When I first started with websites, I used Dreamweaver templates for this, which is a classic example of a templating system. You create a document in Dreamweaver with the header, footer, and any other information you want to remain the same across all the pages on your site and save it as a template. You can create new pages based on the template and Dreamweaver will 'lock' the template structure and only ...

read more »

Modular Website Setup

After making several iterations of my personal site, I've finally found a php backend solution that has made me happy. While I have no doubt that I'll find a new system or methodology within the year that will warrent a complete redesign, my current setup is surprisingly simple and fun to play with.

As php is my primary coding language, I make it a personal goal to never use third party plug-ins. I often utilize jQuery or posted Javascript plug-ins in my work, mostly because working with Javascript and forcing it to work in every available browser can be excrutiating. I have never used Ignitor or Wordpress for a project and do not see the need for it in my near future. So, when I create new sites and applications, I might find myself copying some of my old code for a particular function, but often try to make it cleaner or more efficient during the development process.

When I tackled my personal site this time around, I tried to sketch out the data flow before coding. Not only did I want a central file to handle all web page requests ...

read more »