Learning by helping

Woops, almost forgot to post tonight - it's 7AM who can blame me? Thanks to the wonders of the iPhone WordPress app I can write this short and sweet blurb as I drift asleep in the comfort of my bed.

Today I was reminded of a very valuable life lesson - you get just as much out of helping someone as they get by being helped. I'm sure there are plenty of studies or philosophers out there that can point to how or why being a teacher actually helps you learn a subject better but here's a little anecdote from my life earlier today (er yesterday).

I got a tweet two nights ago saying the site wasn't working for them. I stayed in touch trying to figure out what was wrong. Unfortunately I had to leave the situation to get a precious 3 hrs of sleep before an exam I had to take. But after I woke up I continued to work on this persons case (@thesraid whose twitter handle is escaping me right now).

I looked, couldn't find his name on the database, then looked and couldn't find his oauth id. He told me maybe it was because his name had an apostrophe in it. I thought I had taken care of that problem with my mysql_escape_string calls but I looked at where the problem could lie.

Turns out there was one function (which believe it or not was the crucial function of registering a user) that did not call this. So I added it (also apologies to everyone else that suffered because of my mistake) and thought nice done. Good to go.

Wrong. More problems. Now his page wasn't loading. Looked through the source, and realized he was making it into the database now but when getting his named called to the page it broke the JavaScript because of his apostrophe again. So I called addSlashes and things worked like a charm. After things got fixed he thanked me and told me about how one time an envelope was addressed to him (John O Undefined Character String vs John O'Riordan insert funny name here later when I can remember).

Basically, I could have spent some previous hours preparing for either of my Midterms or sleeping but I knew it would be valuable to help out a user with a mistake I made. Turned out I learned something and got another user successfully registered!

I am a firm believer in help out as much as you can and you wont be disappointed. Glad I won't have to flip flop on that anytime soon.