TAG | conference
Another talk I’ve atended at PHPUK 2010 was AntiPHPatterns by Stefan Priebsch. While design patterns are core implementation independent solutions to problems that occur over and over again which also serve as a great vocabulary, anti patterns are software patterns that are ineffective or counterproductive. In his presentation Stefan describes some of these anti patterns:
1. Constantitis. Excessive use of global constants is considered to be a code smell. Global constants can be defined anywhere in the code base, there is a risk of name clashes if a constant is already defined, global constants make the code more coupled, testing gets more complicated since constants have to be known beforehand and defined explicitly which might be even more troubling if a constant has to change it’s value for another test. Since class constants are not global it’s OK to use them. Cure for constantitis is not to use global constants and instead use dependency injection.
2. Globalomania. Global variables share the same problems as global constants. Because global variables can be changed it makes them more dangerous than global constants since a change in one part of the codebase can affect the other without anyone noticing. Global variables can be cured by using dependency injection.
3. Singletonitis. Singleton is one of the most popular design patterns. It’s wide success is due to the fact that singletons by implementation are available globally in the entire application. The problem that singleton design pattern tries to solve is to prevent having multiple instances of the same class. This is rarely the problem in most applications and most singletons are being used as global variables instead. Singletons share the same problems as global constants and global variables and therefore should be avoided. Singletonitis has the same cure as constantitis and globalomania.
4. God classes. According to object oriented best practices classes should do one thing only and do it well. Classes should be refined and granular. One of the ways to think about this is to ask yourself what are the responsibilities of this class. In an ideal case you will be able to describe it in one sentence without any “and’s”. When classes start having too many responsibilities they become god classes. Usually the whole application relies on one of the god classes which makes the application tight coupled and therefore more difficult to maintain. To cure god classes minimize class responsibilities so that objects know everything about themselves and little about others.
I’m pleased to say that I will be attending the PHP UK conference 2010 in London. Last year I attended PHPNW 2009 which was great and I hope PHP London to be even better. It will be certainly interesting to listen to famous PHP speakers such as Stefan Priebsch, Fabien Potencier author of Symfony. The conference schedule has been announced and these are the talks that I’m going to attend:
- The lost art of simplicity
- AntiPHPatterns
- PHP 5.3 in practice
- PHPillow & CouchDB & PHP
- ‘In search of…’ – integrating site search systems
- PHP on the D-BUS
The keynote talk about lost art of simplicity sounds very promising. Also very eager to see Fabien’s presentation on how PHP 5.3 can be used in practice.
This is my summary of PHPNW09 conference that I was lucky to attend. This was my first real conference and I was blown away. Talks that I enjoyed most are the keynote about the uncertainty principle, Lorna’s talk about the Joel Test and Rob Alen’s talk about project management. It was also very interesting to hear about the state of the PHP project and it’s internal development teams. Did you know that PHP has only about 100 active developers of whom only ~10 are core developers?
The event itself was perfectly organised. I don’t have a single complaint. Timings were perfect and don’t get me started about the food. It was delicious!
I also had an epic opportunity to see how Microsoft fails to demo their flowchart software which was highly amusing. Though I feel highly thankful to these guys because they were the major sponsors of the event not to mention their help on PHP windows builds.
In the evening we were invited to a SUN sponsored bar where I had an opportunity to meet and chat with really interesting people. Met a PHP star Derick Rethans, had a really great conversation with the event’s organizer Jeremy Coates and even met people from my own homeland.
All in all this was a great experience and I’m definitely coming back next year. There are also other conferences coming up in Barcelona and London which I hope to attend.
