Benefits of Developing With Microsoft AND Open Source

Friday, February 26th, 2010

The Internet seems to be the latest battleground for the computer age-old struggle between Microsoft and open source solutions. For some reason, many web developers like to engage in holy wars over various web site hosting solutions and development platforms, fiercely defending their beloved vendor's suite of products. They battle ...

Did you think your site validated input properly? Think again!

Wednesday, October 21st, 2009

You’ve written a PHP based web app, and you’ve made sure it doesn’t cause errors if the user submits unexpected values via any URLs or forms. But there’s something you quite likely forgot to test: What if the data that’s expected to be a singular value happens to be ...

What is a null object, and when are they useful?

Saturday, September 12th, 2009

If you've written code, you've probably used the value null to indicate some variable is not set. This is perfectly good, but did you know there's more to nulls than just the value null? There is also a null object, which doesn't really have anything to do with the value null, ...

Unit testing 4: Mock objects and testing code which uses the database

Friday, June 26th, 2009

After learning to write tests and some good testing practices, it's now time to look at mock objects. When testing a class which needs an instance of another class to work, you do not want to depend on the other class too much. This is where mock objects come in - ...

Unit testing 3: Writing tests for existing code

Wednesday, June 17th, 2009

Now that you know what unit testing is and how to write and run tests, it's time to look at writing tests in more depth. Today we'll take an example class and write tests for it. We'll also introduce some common testing methodologies.

Unit testing part 2: Writing and running tests

Wednesday, June 10th, 2009

Continuing from the unit test introduction, we will now continue and take a look at how to write tests and ways to run the tests.

Refactoring

Monday, June 8th, 2009

Today I'd like to point out a bunch of good articles about refactoring - the process of improving code without changing the functionality. Sameer Borate has written four posts about the topic in his blog, and I encourage you to check them out: Refactoring: An introduction to PHP programmers Refactoring 1: Conslidate ...

Dealing with different password validation schemes in a single app

Wednesday, May 20th, 2009

If your application is well thought out, you would not want to save any data that isn't valid. So what do you do, when you need different validation schemes, say for passwords, depending on some special case? For example: Your user passwords need to be at least 8 characters long and ...

Doctrine vs. Propel: 2009 update

Saturday, May 16th, 2009

The best PHP ORM libraries, Doctrine and Propel. Last year I compared them to each other, and now it's time to get a fresh look at how they have advanced in about a year - Is Doctrine still the better of the two? This time, I'll also look at the features ...

Validating Zend_Forms using model objects

Thursday, May 7th, 2009

Zend_Forms, models, validation and how they all work together is a tricky topic. There are many opinions and many ways to do it. This time I'll show you what I think could be the answer to validating forms without having to duplicate validation code both in a model class and ...