PHP Interview With Matthew Turland Co-Author Of ‘PHP Master:Write Cutting Edge Code’ – Learn How To Write PHP Without Using A Third-party Framework First

Contents At Glance

Purpose Of This Interview

This is the #18th set of PHP Interview to help aspiring PHP developers and PHP fans alike to get inspired by listening from those PHP guys who are already highly involved into the PHP Ocean and being ‘there’ taming the waves and surfing better than ever to make themselves an Awesome PHP Expert both in their own eyes (for self-accomplishment) and for the PHP Community. On the other side, this is an opportunity for new PHPers to get to know their “PHP Elders. I hope you will derive as much fun to read my interviews as I’m having by interviewing those A-List PHP guys.

A Small Intro..

Matthew Turland Author Of PHP Master:Write Cutting Edge Code (Photo credit to Rob Allen)

In this edition I talked with [Matthew Turland @elazar], co-author of the PHP book ‘PHP Master:Write Cutting Edge Code‘. He currently works as a Senior Platform Engineer for Synacor Inc. Matthew was also a former technical editor for php|architect Magazine, contributor to the Zend Framework project and has spoken at conferences like ZendCon and php|tek. On the FOSS side, Turland is the man behind the Phergie project – a PHP-based IRC bot. Some of his presentations on slideshare includes:

  • New SPL Features in PHP 5.3
  • Web Scraping with PHP
  • Open Source Content Management Systems

And Now The Interview…

>> Please tell us a bit about yourself

In my formative years, my father worked in IT support of one form or another and my mother was a medical transcriptionist. As such, I was around computers quite a bit. At age five, I was using an Amiga with no hard drive that loaded its programs from 5 1/4″ floppy disks — you know, the kind that were actually rather floppy.

In my early teens, I started messing around with basic HTML, CSS, and JavaScript. The ability to create web pages and put them on the internet for everyone to see intrigued me. In the latter half of high school, I began taking computer science courses and learning languages like QBASIC and C++. I subsequently worked my way through college in the web development industry and earned a bachelor’s degree in computer science.

The rest, as they say, is history.

>> How you started with PHP

On the job, actually, back in 2002. Immediately beforehand, I spent about 10 months working in a Microsoft shop building a custom CMS for newspapers. We used classic ASP, IIS 5 or 6, SQL Server 2000, Windows Server 2000, etc. I was in school at the time and the team I was on
needed another full-time member, but couldn’t afford to keep me and bring that person. Continuing school and working full-time would have proven difficult, so I changed jobs. My new employer was a LAMP shop and figured that, knowing C++, I should be able to pick up PHP fairly quickly. I remember being amazed at how much PHP supported out of the box; we had to purchase a license for a third-party plugin to process file uploads in ASP back then!

>> Your LAMP stack comprises.. ?

Not sure offhand what specifics my employer would be comfortable with me providing, but for my own personal projects, I tend to go with Ubuntu Server and whatever packages it provides. At the moment, that’s Apache 2.2.22, MySQL 5.5.24, and PHP 5.3.10.

>> The relationship between You and The PHP Community comprises..

I wouldn’t say I have any one defining characteristic. I found the community back around 2005 or 2006 in the #phpc channel on Freenode and realized I’d been missing out on the best part of PHP up to that point. I started talking to the A-Listers of the time, forming friendships with them. I attended my first conference at ZendCon 2007, was a speaker for the first time at ZendCon 2008, and have attended a number of conferences since.

Somewhere in there, I started the Phergie project to build an open-source PHP-based IRC bot to run in #phpc that its patrons could contribute back to. I’ve made some minor contributions to Zend Framework 1, PHPUnit, Phing and a few other well-known PHP projects. I guess you could say I’ve had my hand in a lot of pies.

>> How do you find PHP now as compared to when you first started

It’s come quite a ways as a language. I think in more recent years, there’s been more of a willingness to “borrow” useful features from other languages. While I do love a number of the improvements that have been introduced since I started with PHP, I fear that it’s moving away from what contributed heavily to its initial popularity: a relatively shallow learning curve. The procedural language was fairly easy to pick up, but now we have to worry about classes, autoloading, traits, etc. The language has gained a lot more complexity in its older age and that’s something of a double-edged sword.

>> Based on your experience, what are the good and bad parts of PHP

As previously mentioned, one good - heck, awesome – part about PHP is the community of people behind it. There’s a large willingness to help and a distinct sense of pragmatism. Another good thing about PHP is one that I’ll describe with a quote from [Terry Chay @tychay]: “PHP is a ball of nails… you throw it against the wall and it ****ing sticks.” By that, I believe he meant that while the language certainly isn’t the most aesthetically pleasing, it provides the functionality needed to get the job done.

The bad parts of PHP — well, you can read a bit about those at phpsadness.com, a web site run by a coworker of mine. To this, I will say that all languages have their warts, and PHP may have more than most, but they don’t seem to deter developers from continuing to use it.

>> What would be the Top advice to a PHP beginner

Learn how to write PHP without using a third-party framework first. Once you’ve done that, be sceptical about the need to write your own framework and even more sceptical about the need to open source it. Seriously, we’ve got already got enough frameworks floating around out there to gag a maggot; yours probably won’t be as different as you think it will be. If you really want to distinguish yourself, build a cool app with an existing framework or build a useful library; we don’t have enough people doing those things.

>> To someone who wants to become a better PHP developer..?

One thing all great people should know: they don’t know everything. That said, get involved in the community. Especially if you’re a one-man shop, that’s the best way to continue learning. That aside, phptherightway.com is a good place to start.

>> The best PHP book you’ve read

  • The PHP manual

While it’s become more of a comprehensive reference than a tutorial since I started, it’s the most authoritative and current source on the language next to the source code. The ideal book to read on PHP tends to depend on what subtopic you’re interested in.

If you want a good book to get started, the most highly recommended book I’ve heard of is:

>> A PHP blog or resource you highly recommend

>> The IDE that you use

I’m not much of an IDE person myself. I tend to use vim for most projects. On occasion, when I do Android development, I’ll use Eclipse.

>> How do you debug your PHP code?

Depends on what I’m debugging, but I tend to favour either Xdebug function traces or the good old-fashioned approach of adding debug prompts in the code and running it to see what happens.

>> A PHP framework you use and would recommend

These days, it varies. I dabble and like to experiment.

  • If you’re looking for a micro-framework, I’d probably say Slim or Silex
  • If you’re looking for more of a full-stack framework, I’d probably say Zend Framework 2

>> A unit test framework you recommend using?

PHPUnit, though I’d say consider using something like Phake for mocking.

>> A CMS that you think is worthwhile

While I haven’t used it extensively, I like the direction that [Drupal @drupal] seems to moving in. A lot of work is going into version 8, which seems to be intended to transition Drupal to more of a service-oriented content platform rather than just a simple CMS.

>> An E-Commerce cms you recommend

While [Magento @magento] is relatively full-featured, I found it to be extremely hairy to work with from a developer standpoint. While I haven’t worked with them myself, I’ve heard decent things about [Zen Cart  @zencart] and [CS-Cart @cscart]. If you’re looking for more of a e-commerce framework from which to build your own CMS, the [Sonata project @sonataproject] looks promising.

>> One PHP System/software/library/Project you really appreciate

If I had to pick one, I’d probably say PHPUnit. I use it daily at work and the tests I’ve written with it have saved me from many bugs.

>> One function that you like (or which you tend to use frequently)

  • preg_match

 

Regular expressions are incredibly powerful. If you aren’t already familiar with them, read the PCRE section of the PHP manual. Also check out “Mastering Regular Expressions” from O’Reilly Press by [Jeffrey E.F. Friedl @jfriedl].

>> One PHP person that you admire and what strikes you about him/her

[Matthew Weier O'Phinney @weierophinney], also known as MWOP and Supreme Allied Commander of the Zend Framework project. He’s an incredibly knowledgeable, patient, enthusiastic, and diligent individual and I’m proud to count him among my friends and peers in the PHP community.

>> One PHP Community that you recommend

[The Zend Framework community @zfChannel]. I’ve had it on my radar since before its first stable version and it has some inspiring individuals doing remarkable work.

>> Are you part of any PHP User group? Could you tell a bit about it..

The area I live in doesn’t have enough active PHP developers to comprise a PHP-specific user group. However, I help to organize the Acadiana Open Source Group, a language-agnostic group focused on open source software in general.

>> A PHP Usergroup that you appreciate and would highly recommend

[NOLA PHP @nolaphp], the New Orleans PHP User Group. To my knowledge, they’re the most prominent PHP user group in my home state of Louisiana and I’ve enjoyed the few instances when I was lucky enough to attend their meetings. I was even able to meet Rasmus Lerdorf once there!

>> Which was the worst programming mistake you did?

At my first job, when a user logged in to the administrative area of the CMS we developed, it set a cookie with the user identifier, which was just an integer. Anyone who could figure out the name of the cookie only had to change that value to impersonate any user!

Once we realized this, we changed the code to store that identifier in the user’s session data instead so that it wouldn’t be something they could see or change. That was probably my most profound first-hand experience with security breaches to date.

>> Things that you’ve learned from being part of The PHP Community

Network before you need it. If nothing else, you learn things from these people with along the way. When the time comes to move on from whatever position you’re currently in, they may help you find what you’re looking for. Make friends among them. They’re a remarkable group of people, and they still keep me on my toes today.

>> The best conference you attended would be..

It’s pretty difficult to pick just one. If I had to suggest one conference to attend, it would probably be [php|tek @phptek]. I’ve attended four of them and been a speaker for two. It’s a great conference focused on the community.

>> Can you please share the good, and may be not so good moments, of being part of all the conferences you attended

Seeing friends I may only get to see once or twice a year at conferences if I’m lucky and the ability to make new friends are large reasons for I attend conferences. They make for very memorable times.

That said, a few tips for conference attendees:

  1. Make sure you know how you’re getting from the airport to the hotel ahead of time.
  2. Conference wifi almost always sucks. Just accept it.
  3. The easiest way to make friends at a conference is to bring a power strip or squid. Power outlets are always in short supply.
  4. Speakers: have a backup plan if the projector doesn’t like your laptop.

>> What are the main aspects of conferences that can really help a PHP guy to get better in his progression

Sessions are great, the “hallway track” (i.e. talking to people outside sessions if there isn’t a particular one that interests you) is not something to undervalue, and networking with others can lead to helpful resources when you’re faced with a difficult problem or a new
topic you need to learn about. Seriously, conferences are a great experience and worth the investment.

>> If you could change one thing with PHP, that would be…?

Rate of adoption. I know plenty of people still running PHP 5.2.x despite it effectively being EOL by this point. It’s frustrating not to be able to use a lot of the new bells and whistles that come with 5.3 and 5.4 because you can’t rely on them being present in most
environments.

>> If you had to go back in time, would you still choose PHP? What would you do different?

I still would have chosen PHP. If anything, I think I would have tried to find the community earlier on if I’d known what I was missing.

>> How do you time manage all the stuffs that you do, coupled with your personal life?

I don’t always, at least not very well. I’ve got three small children and a full-time job. Phergie has been in need of some TLC for a while. I just do what I can when I can. It helps if you enjoy writing code or articles as much as you enjoy playing a video game or watching TV.

>> The day you realised “You’ve made it to the A-List PHP arena” ?

I don’t really consider myself an A-Lister, to be honest. There are many people who’ve contributed significantly more than I have. I’m just happy to be able to call some of them friends. If I seem good at what I do, it’s partly because they’ve contributed to my knowledge and partly just because I’ve been doing it for that many years.

>> Why you are successful and why others are not?

If you mean “what did I do to be considered an A-Lister,” I’m not entirely sure. If you find out, let me know. ;)

>> A final word before closing up..

Check out phpmentoring.org – If you’re a knowledgeable PHP developer, offer to be a mentor. If you’re still getting your feet wet, seek out a mentor. I’ve participated in the program myself as a mentor to several people and it’s been a wonderful experience.

Now Do Your Part!

1) Help diffuse this interview to the PHP ecosystem – Share, tweet and spread the word to your audience ==> That would be a FREE way to thank me ;)

2) Make a comment below using the comment form – I’m sure you can at least say 1 word about this interview

{I’m thankful to your response(s)!}

Trackbacks

  1. [...] Interview Posted on October 29, 2012 by codegooroo This post is a bit belated, but 7php interviewed me last month about how I got started with PHP, my work on the PHP Master book, the Phergie project, my advice to [...]

  2. [...] post is a bit belated, but 7php interviewed me last month about how I got started with PHP, my work on the PHP Master book, the Phergie project, my advice to [...]

Speak Your Mind

*