September 28, 2011

209 words 1 min read

Shifting to Object Oriented Programming

Just recently, I studied OOP (Object Oriented Programming) based on java, and am facing my first exam on this subject. It has been an exciting journey to shift from procedural programming to object oriented programming. When you can see things as an entity instead of just an array of codes, it makes coding a real joy.

After several months with OOP, when I see my codes behind this blog engine, I realize it was a mess. Code flies everywhere. There are no clear division of which code handle the database connection, which code handle the html representation, everything was mixed. I was not good at commenting on codes either, so everything is sort of tangled.

Finally, here comes the good news. I decided to drop this project and do it from scratch. However, now I will be using OOP as the base architecture of the project. I hope that the usage of OOP (and better code commenting) will leverage the flexibility of the system. One class per file, one class combiner, and one index for clearer presentation of how the system works. Why do I choose OOP? Clue: private $password;

I’ll have my exam soon, and I hope I can get my hands off my keyboard ASAP. Happy blogging!

Comments