10 Intermediate and Advanced Tips from PHP Masters




PHP Elephpant
Not long ago, we offered you 10 tips for PHP beginners from a panel of certifiable PHP experts. Many of you more experienced PHP devs were kind enough to chime in with tips of your own in the comments.
Well, if you happen to be one of those more seasoned PHP developers, this post is for you. Our expert panel has returned to offer helpful hints and suggestions for those of you who have long since passed the “beginner” milestone and are on your way to becoming true masters of the art and science of PHP.
Feel free to ask questions and leave your own suggestions in the comments — the lovely people we interviewed in this post are quite likely to pop in and reply to you directly.

1. Elizabeth Naramore: Stay Current



Naramore is a SourceForge employee and founded PHPWomen.org. She reminds us all that we’re never done learning.
“Keeping up to date on what’s going on in the PHP world can really help you be a better developer,” she said.
“If you stay in your comfort zone, coding the same way you always have, and don’t keep up with newest releases, changes, and other pertinent news, you are doing a disservice to yourself and your employer. Also, taking time to play with and explore new ways of doing things can help improve your skills. Listen to podcasts, keep up with blogs, take time to learn new skills and experiment.”
And of course, open source isn’t just good for beginners looking to get their feet wet. Naramore notes, “Taking time to contribute to an open source project not only helps you hone your own skills, it helps you help others, and allows you to give back to the community.”

2. Keith Casey: Interact With Others’ Code



Casey founded a software shop and does a lot of work in the unconference circuit. For more seasoned PHP developers, he recommends a rather social program of getting your hands dirty with other developers’ code.
“Explore other projects. It’s a great way to find new ideas and approaches to problems. And sometimes you may be able to submit bug reports or patches. Participate in — and eventually lead — code reviews. It’s humbling to have your code criticized in a group, but it’s powerful and educational to see others’ strategies.”
Casey also backs up Naramore’s advice to keep educating yourself. “Find something you don’t know and learn it,” he said. “Exploring the ins and outs of a supporting tool or related concepts, regardless of the language, will give you new ideas to apply. Or it may help you notice your own bad ideas sooner. Either way, you win.”

3. Eamon Leonard: Give Back



Leonard runs Ireland-based software company echolibre and co-founded CloudSplit, a real-time analytics service for cloud computing. His advice to intermediate and advanced PHP devs is all about community.
“I think if you’re intermediate or advanced, you’ve probably benefited from the experience of others, be it from reading development blogs, going to conferences, etc. I think when you get to the intermediate/advanced stage as a PHP developer, you have a duty to give something back to the community.
“This can be as simple as writing a blog post on how to solve a particular problem, or may be running a workshop at an unconference. This can help an intermediate or advanced developer in many ways, most notably by extending their circle of developer contacts, improving their own development style by conversing with other developers, and perhaps even finding a leadership-type role in the community.”

4. Lorna Jane Mitchell: Ask Questions



“Lornajane,” as Mitchell is more commonly known online, is a PHP consultant, developer, writer and speaker. She advocates a Curious George/Georgia approach to continuing development of your PHP skills.
“Never be afraid to ask questions. There are mailing lists, forums and IRC channels — plus, of course, the real-life user groups — and if you have already looked for an answer and you understand what question to ask, people will always jump in and make suggestions.
“This is how I’ve always kept learning in the years I’ve been using PHP.”

5. Chris Cornutt: Help the Noobs



Cornutt runs PHPDeveloper.org and Joind.in and has been using PHP since 1998.
Of intermediate developers, he says, “These are the folks that have made it past their second or third PHP application and know their way around the language. They’re the ones that should be looking at the beginners and helping them with some of their first steps. The mid-range folks remember more clearly what it was like when they hacked away at a script for hours just to get a basic CRUD interface working.”
“Since it’s the most fresh on their minds, they’re the best to help,” he adds. “As an added bonus, they’ll learn a few things in the process. There’s no other one developer that has the same experience as you, so help them out and keep an open mind.”
He also reminds intermediate and advanced PHP developers that now that they have some legitimate skills under their belts, there’s no excuse for lazy hacks or code Band-Aids. “That’s the lazy developer in them coming out… You’ve come a long way in your development and know how things work (maybe even the PHP internals!), and you should spend the time to really get into a problem and fix it.”
Along with the so-obvious-yet-no-one-does-it-well tip, “Document your code,” Cornutt also tells advanced devs, “There’s another tip I’d highly recommend that can only help you in the long run: unit testing. There are great tools for it in PHP (like PHPUnit and SimpleTest) and it can really make a difference in the stability of your application.”

6. Abraham Williams: Keep It Simple



Williams is a developer and self-styled “hacker advocate.” He tells PHP devs to keep things simple and focus on incremental improvements in a code base rather than reinventing the wheel.
“Don’t try to over engineer. Clean, modular code is important, but it is easy to try too hard and try to abstract too much. For me it works better just to get the code down and progressively make small improvements. Maintain lots of tests.”
He also echoes the sentiments of his peers, saying, “Most importantly be active in your local and digital community.”

7. Demian Turner: Use Better Tools



Turner has been working with web and open source projects since 1996. He runsPHPKitchen.com and was a recent Seedcamp finalist.
For developers who are moving out of the “beginners” level, he recommends using better IDEs, unit tests and static analysis tools to become a better coder.
“Don’t be afraid of using an interactive debugger, available in decent IDEs like PHPstorm and also Netbeans and Eclipse if you have the patience — this is the best way to understand what the code is doing.
“Don’t be afraid of unit tests — not only will you have an easier time maintaining your code base, but often unit tests are the best form of documentation for a codebase and will allow new devs to get up to speed fast. Use some of the available static analysis and IDE tools to help you refactor your code — good code is not subjective!”

8. Stuart Herbert: Maintain Your Code



Herbert has been coding PHP since 1999. He’s also been writing about PHP for several years and has contributed greatly to Gentoo Linux.
One of the tips he says helped him along his way to becoming an expert PHP coder is: “Maintain your own code so that you can learn from your mistakes. Refactor early, refactor often.”
He also agrees with Cornutt that teaching others is a good idea, and he concludes his advice with an admonishment to make sure you follow standards and get up to speed on source control.

9. Maggie Nelson: Monitor Your Code



Nelson is a PHP developer currently employed by Flickr. She recommends a few good tools for code monitoring.
“Use FireBugFirePHP and YSlow add-ons for Firefox. These will help you judge your web app’s front-end and back-end performance.
“Profile your code. Try some in-depth tracking of what your PHP is doing. If you don’t understand something, read documentation and talk to other developers, but don’t leave any questions unanswered. The more you know, well, then the more you know. TryXdebug for starters.”
She also reminds devs to keep an eye on error reports. “Look at your application logs and strive for clean logs. PHP has many levels of error reporting — use them accordingly. Take advantage of what your application tells you, and fix problems as you see them. A clean log means less hairy debugging under emergency conditions.”
Finally, she notes that although you might be happily settling into life as a PHP dev, there’s more to web development than PHP.
“Don’t ignore other languages only because you love PHP. PHP is simply one of the tools for building applications. Try other languages, different data storage options, even a new code editor once in a while. As new needs emerge, new technologies will grow. Be familiar with them.
“Sometimes PHP will be the best tool for the job, but sometimes it won’t be. Learn to recognize the difference.”

10. Michael Maclean: Work With Others



Maclean is a PHP and Python developer based in the Outer Hebrides in Scotland. His advice lines up with what Naramore and Casey advised.
“Don’t work in isolation. Go and have a look at what other people are doing. Read blogs, Twitter, go on IRC, whatever. If there are conferences or user groups in your area, go to them and speak to other people. That way, you can keep up with what’s happening and find out what interesting things other people are doing.”
He also says devs should stay curious and maintain a hacker’s state of mind about all the tools they use. “Don’t just use whatever framework you’re working with — go and poke around inside and see how it works. You might learn something on the way.”

{ 0 comments... read them below or add one }

Post a Comment