Software Engineering

About redirects

The web change constantly and content moves around. This article gives a brief overview of the various different options available to you, to make a redirect. Redirects come in two major flavors - clientside and serverside. Client side Clientside redirects reside within the HTML documents on the server. There are three basic ways of making these: Manual (or user driven) redirects. Meta headers. Javascript redirects. Manual The manual redirects most often used when you really, really wants the users to know, that the page has moved.

MVC for PHP

With the amazing buzz around RubyonRails, everyone seems to be hooked on the Model-View-Controller (or just MVC) paradigm – and do strive to mindlessly implement the ”Ruby way” into other programming languages without too much reflection and thoughts on how to do it. . Even tough most of the efforts I’ve seen so far seem pretty hopeless; I do believe you could actually do something good with MVC and PHP. Let me try to tell you how.

Coding style

I usually edit more code others made, than I create new files, and while most of the code is in PHP, there’s a huge difference in the coding style applied by different developers, and some styles are much more annoying than others. I do respect that people are different and that is probably more efficient to allow for some degree of personal style than to try to enforce a single common style.

Validation: black or white list

When you’re validating data – either client- or serverside – there are basically two strategies you can choose between. You can either blacklist data or white list data. Blacklisting seems to be the most popular way to validate data, but white listing is so much better. Here’s a brief description of the two strategies and why the white listing is better. The black listing strategy is validating you input against a list of characters which are illegal in the input.