Immutable Objects in PHP
When I first learned to program, I made many objects that were mutable. I made lots of getters and lots of setters. I could create objects using a constructor and mutate and morph the heck out of that object in all kinds of ways. Unfortunately, this led to many problems. My code was harder to test, it was harder to reason about, and my classes became chock full of checks to ensure that it was in a consistent state anytime anything changed. Of course, my classes had to be backed by unit tests and this often resulted in a combinatorial explosion. This how I look when I try to imagine all of the possibilities and how to test them.
Building the Perfect Ubuntu 10.04 LAMP Server
This post will detail the series of steps that are required to set-up and configure a LAMP server using Ubuntu 10.04 LTS. The server will have all of the normal features that everyone has come to expect.
Specifically, it will have the following features:
- Locales will be set properly.
- MySQL will be secured.
- MySQL Query Caching will be configured.
- Iptables will be configured (optional).
- Alternative PHP Cache (APC) will be installed and configured.
- Web directory permissions will be set.
- Virtual hosts will be created.