How PHP ruined my life as a software developer
I started building my first website when I was 10. It was plain HTML, simple things, called “Droloweb, the most hilarious website on the web”, and had a Ulimit (now closed) free domain name (paid by pop-up ads, basically). I was verbally spamming my friends about it until my parents decided to take me out for dinner after the first 1000 views. Not visits, not uniques, just plain old views. It took me about 6 months to get there, and two-thirds of these views might have been me refreshing the page. But who cares? This gave me the love of building things online.
So when I reached age 15, I started using PhpBB, a PHP Bulletin Board (Wow, that’s what PhpBB means! And it was version 2.0.6 at the time) because I wanted a forum about computers. No particular idea in mind, and there were hundreds of them already out there (Just in French. Thousands in English). It’s not hard to start a forum, you can now do it in a few clicks. So I did it.
But then what ? What do you do with nothing on a forum, and nobody to read that big void?
You build content.
And content doesn’t show up by asking your friends to post on a forum. Well, quality content at least, because we had a great time posting random things from the 2000′s. So I decided to start a website that would use the user sessions of PhpBB to avoid having two different accounts (one for the site, one for the forum)… So I had to learn PHP. Luckily I had some pretty geeky highschool friends who helped as motivators and sources of content. Since then, the site evolved (here is a version which shows that I did not know anything about “TL;DR”) , finally got renamed to Aidoweb and is now a fully homemade PHP framework that has no trace of PhpBB. Great, right ? Yes, on my resume. Helped me find my current job. But at what expense?
I hate Java. I hate C. I hate C++. I hate ALL compiled languages.
This is what I got for being lazy. PHP makes life easy (No, I am not saying that you should quit your job if you are doing PHP – no offense note), and I stayed lazy while learning it.
Everything just works on the spot. Your variable wasn’t declared? I’m happy with it. Was the wrong type? I’m happy with it (see code snippet below). Your code is completely inefficient and eats tons of memory ? Well, who cares? The site was too small to have a visible impact anyways. Well, until it was not anymore, but at that point the damage was done already, and when I reached graduate school in a computer science major, I did not really understand what I was doing there.
So I arrived in my MsCS, having avoided as much as I could all the compiled languages courses in France (I had a french degree in Networking and telecoms, so it was easier to go towards Cisco stuff) and got prepared to take classes called something like “CS 6210 - Advanced Operating Systems”.
Well, that must be some Linux thingy, right? (I am a systems administrator now, so it sounded sexy). Well it was not: welcome to the world of low-level C, moving pointers around and knowing exactly what’s where in memory. My PHP brain blew up pretty much instantly, asking where the web-stuff was and why I had errors all over the place about undeclared variables or modules not found when the compiler should obviously know what I’m talking about.
/* This is typically what's wrong in PHP. I learned not to care because PHP doesn't care, it will do the job. This should blow up in your face saying that you can't do math on a text. What would your kids grades look like in 4th grade if he was coding like this? */ <?php echo "I'm your father" + Luke + 2 + $nothingtosee ?> => This displays 2. And that's wrong. A text, plus a random "Luke" linked to nothing, plus a number, plus an undeclared variable, can somebody tell me how this can add up? Python yells when this happens. Or even for a simple type mismatch. And most of the other languages do.
I am glad that the faculty was amazing and saved me from drowning, but giving me the love of C was an impossible task. And that’s set for life.
We need good basics to grow: Un-learning is a hard thing
The human brain is lazy and will “cache” what it knows (this must be the sysadmin in me speaking). Basically, once you have learned something, your brain will pull from what you have learned to tackle any problem and if you’ve learned it wrong, you will continue to do it wrong until you make a huge effort to think out of your boundaries and forget what you know.
So I am not saying that PHP should not be the first language one uses to learn how to code, but this has to be done carefully. I am sure PHP evolved a lot since I last touched it seriously (it was still PHP4!), and maybe all that has changed already, but my experience as an autodidact kid was a really good way to put me on the path of computers, but I learned by browsing forums when I had issues, and did not buy any books.
Take your learning process seriously
I have been blaming a lot of things on PHP in this article, but PHP was just the “easiest” way for me to enter the coding world. I should have bought books, taken classes, be serious about it. I was not. So now, I am trying to learn Python the right way (and the hard way), from scratch, like I did not know anything about programming.
I ended up interviewing for a web-developer internship at Google, and it was my first interview ever. They called me because my website was getting big and had hundreds of thousands of visitors. I was in Dublin, interviewing in videoconference with an engineer in Paris and one in Jerusalem. That was an amazing experience, but I did not get the job. Why ? Because when I started answering their coding questions in PHP, they stopped me immediately and asked me to choose between C++ and Java. I chose Java. I failed.
So if I have one advice on how to learn something: Make sure that you have great teachers and study materials. The outcome will be life changing. I did not know anything about systems administration and networking before starting my degree, and I now have a great job as a systems administrator. Because I learned it the right way.
No offense note: PHP is a powerful language when it is well used, and big websites like Facebook started on that or are still using it. Great frameworks like Symfony or CakePHP help a lot too, and I am absolutely in love with WordPress which is PHP-based. If you are a PHP developer, do not throw rotten tomatoes on this blog (it would splash your monitor only). This is my experience, I still feel more like a PHP dev than anything else, but I just want to make sure that everything I learn now is learnt the right way.