Once upon a time, while still in high school, I ran a BBS called OPOOP. This was a very mysterious name, and it meant “Organized Programmers against Object-Oriented Programming”. This was in the days when every program written in C++ suddenly became half a megabyte bigger than the C equivalent; and in those days, half a megabyte was a lot.
The best programs were written in assembler. Every line and every function handcrafted and fine-tuned. If you ever wrote a program bigger than 40 kilobytes, you were awesome!
A lot of things has happened since then. Computers got a few hundred times faster, a thousand times more memory to play with, and deadlines that require rapid application development.
I have since then become an avid enthusiast of object-oriented programming, finally seeing the light. I spend my time thinking about class design, reflection, composition and abstraction. Multiple inheritance is nothing I rack my brain over anymore; that concept is so 90′s.
It was with some shock and fascination that PHP forced me to improve my class design today. I had constructed a rudimentary persistence layer for writing and reading objects from a database. But because PHP’s inability to correctly identify inherited classes in static methods – PHP seems to lack virtual static methods – I was forced to improve my design and build on composition instead of inheritance.
The added effect was that I now could use POPO’s instead. POPO, for the uninitiated, is a twist on the Java POJO, meaning Plain Old Php/Java Objects. It means that the data objects don’t inherit from an abstract parent class, which – if they don’t – is Good Design.
And suddenly I realized that I had gone full circle. If I ever write a book about my software experiences, it will be called “Mats Gefvert: From OPOOP to POPO”.
I can’t wait to read it!