Wednesday, November 28, 2012
What Should a Beginning PHP Developer Learn?
I've been a software developer for a long time. A good part of that time has been spent using PHP and its associated technologies to build web applications (and a few console ones too). I started with PHP in its infancy and kind of organically grew with it, learning new technologies and methodologies as they came up. For me, it wasn't so much about keeping up as it was about just doing new projects and picking up what I needed as I needed it.
But I've been getting email from junior web developers who are surveying the PHP landscape with wide eyes and wondering where the heck they should begin. PHP is a near fully object oriented language now so that seems like the logical place to start. But there's also an amazing amount of code already written, and still being written, in the old functional style so maybe they should start there. It all can be a rather confusing mess of code for someone just breaking in to the field. So this is my attempt to add some clarity to that first look. It's my attempt to give you a starting place from which you can grow as a developer.
So here it goes:
1. Learn OOP first - While I won't get into the whole 'OOP version functional' programming debate, I do believe that, like it or not, OOP will remain the dominate way to develop quality software for the forseeable future. Not only that but almost all of the new programing paradigms are being built on top of OO concepts and it's going to get increasingly difficult (impossible?) for you to get even an entry level job without at least a basic fimilarity with object oriented concepts.
2. Be comfortable with functional - Compared to well ordered and contained OO code, functional code can look like complete chaos. But the fact remains that there is still a lot of code being written and maintained in the functional style. You will probably be called upon to either extend or maintain such code during your career so you might as well get comfortable walking between the two worlds now. And, while I know it's almost impossible for the OO diehards out there to believe, there will even be times when you will choose to write new functional code over OO code. Learn it, get comfortable with it.
3. Learn at least one major framework - MVC programming is the way of the future. Make sure you understand it well. There are multiple MVC frameworks out there for PHP but, for the most part, they function similarly enough where if you learn one you can quickly and easily pick up the others as you need. Some might suggest you learn Zend, I don't. While Zend is a perfectly fine framework in itself, I've always found it much like throwing a 200 ton gorilla at a 50 pound problem. Most of your projects won't require Zend. They will require something like CakePHP, Symfony, or Code Igniter. These are easier to learn than Zend and will serve you better in your day to day job.
4. Learn another language - PHP is a fine language. But it's important that you learn how other languages do things differently than PHP. Take some time to learn Python or ASP.NET, or Ruby. Take note of how each of these languages differ from PHP and what you like or don't like about them or PHP in those regards. You'd be surprised how many times I've been stuck on understanding something PHP is doing and looking at hour Python does it clarifies it for me. Trust me, this is going to be an asset in your toolbox.
5. Learn a source control system - You'd be shocked how many web developers I talk to that don't even have a basic idea about how source control works. This will come back and kill you in the job market. Technical managers will string you up, your coworkers will despise you, and you will quickly get the label of 'clueless. incompetent, newbie' if you ignore this. It doesn't matter what system you learn, just learn one and make sure you understand it intimately.
And that's it! Those five things will get you started on your professional PHP journey and will serve you well as you develop your career. Sure, there are probably a million other things I could add to this list but those five seem to be the ones I see lacking in new developers the most. Learn them and they will serve you well.
What are your 'must learn' tips for new PHP developers?