Three Times An Object

Submitted by Marc on Mon, 02/19/2018 - 18:05
Object Oriented Programming example

When I was in High School, I took trigonometry and failed miserably. It frustrated me because up until that point, math had always been so easy to learn for me. Perhaps it was my dad spending time with me when I was 8 going over algebra, or that I got excited when I learned a new theory in geometry, but I took to math up until that point with little to no issues. Trig seemed like a foreign language to me and the more the class went on, the more lost I became.

Fast forward two years and I took it again at the local junior college. Nope nope nope. Nine years after that, I wanted to finally pursue a dream to go back to school and become an astronomer. That meant loads of math classes. While calculus and differential equations oddly came easy to me, I fretted trig and knew it would be an uphill battle. However, this third time it really clicked. And it dawned on me that it was something about how the instructor taught it this time around that finally allowed me to see the light.

Trig has two main angles (ha, sorry) to it - circles and triangles. The high school and the previous instructor meshed the two focuses by mixing and matching equations, terms, and generally taught things in an odd order. While circles and triangles are obviously interlinked, this instructor broke each section down into individual parts and tackled circles first and then triangles. Obviously there was crossover, but they were able to deal with that at the end of the semester by showing how the two crossed over and interlinked. But, they didn't let this crossover confuse each individual section.

My studies of Object Oriented PHP have been very similar. I tried learning OO PHP many years ago when it first came on the scene and it simply didn't click. And when I look back at that (and subsequent experiences) it was because the courses mixed all of the terms and mashed them all together which became a jumbled mess in my mind. They were trying to teach too much too fast.

Thankfully, last November I attended a class at BADCamp in Berkeley that was solely focused on OO PHP. Like my lightbulb moment with trig, OO finally clicked with the instructor slowly building on each successive part of OO. For example, we didn't go over constructors or extending classes right away, which IIRC, the other classes I had taken previous quickly to move on to other subjects like interfaces or anonymous classes. No, what worked was splitting each of these lessons into their component parts. What has solidified my training with OO has been the excellent Drupalize.me website and their amazing tutorials.

I sometimes think about the Malcom Gladwell idea of 10,000 hours and that if I spend long enough with something, I'll get it eventually. And during that training, I shouldn't get so frustrated. I feel much more comfortable with procedural PHP, JavaScript, and others, but I've been coding in those for years and I know I had similarly frustrating moments with those. So why should OO be any different?