Executing a PHP Code Review
Today, we had our first code review with our current development team. For those of you not in the software industry, a code review can best be defined by someone else...like wikipedia!
We have done code reviews in the past, but they were very informal and their effectiveness could be debated. There were a few problems with them, mainly:
- We weren't entire sure how to do one properly
- They degraded to an attack on the developer, not the code
- They weren't integrated as part of the process
- We didn't have enough people looking at the code
Now I am not saying we solved all of these problems, but we started moving in the right direction. At TEK-X, I had gone to a session by Arne Blankerts and Sebastian Bergmann about code reviews that was extremely helpful. I always felt like code reviews are for large teams, but Sebastian and Arne gave me some tips about how to implement them in our small team. It seems for us, the more formal code review process where people have defined roles would not work so well. What we did instead was to have our developers use the projector in our office to "present" their code. Our roles were loosely defined as a presenter, a note taker, and two developers to critique the code.
This approach worked really well! We closed our office door, put most of our computers to sleep, and concentrated on the task at hand. Fewer distractions led to more focus and a better session. We were able to make it through a good bit of code, finding all sorts of stuff that could be improved.
One of the major mistakes we had made in the past was letting the criticism get off the code and onto the coder. To try to curb that a bit, we all had a chat beforehand to set forth some guidelines. As the senior developer, I led with the idea that when we are critical of a piece of code, we're talking just about the code and not about the developer. The whole purpose of doing these code reviews is to make everyone better at development, not to call anyone out or to make someone feel bad. I feel like it takes a certain amount of maturity for developers to take criticism of their code and not take it personally, and my guys didn't disappoint. Us senior developers also made a conscience effort to be cordial when doing our criticism and I think it paid off. Everyone participated and still liked each other in the end
After the session was over, I asked the guys what they thought and they loved the feedback. They definitely wanted to do code reviews more often, so we decided that every Tuesday afternoon we would reserve for code reviews. I think this will help us stick with it and make it part of our process.
If you have never done a code review in your team, I'd suggest giving them a try. It is a great way to give feedback to your developers, and you may learn something while you are at it.
tekx Day Final
The last day of tekx and guess who has the first session today....me and my "Lean Mean PHP Machine!" I have presented at quite a few conferences over the years, but never anything as big as tekx and never at a PHP conference. There were people in the audience who I have the utmost respect for. I feel like tekx took a chance on me, being a new speaker. The room was (WTF!) STANDING ROOM ONLY! You would think the pressure would be on but honestly, I wasn’t nervous a bit.
It went better than I expected. There was a lot of good discussion during my slides, which I love. Lots of presenters don’t like to be interrupted, but I always like to see my talks as discussions rather than lectures. Some good questions and points were raised, and I guess you could say I spouted off a few good lines that got tweeted and re-tweeted a bunch (I swear I didn’t plan any of them).
Stuff like that cracks me up. I hope everyone enjoyed it cause I sure enjoyed giving it.
I got good feedback after the talk and everyone seemed to enjoy it. I thanked Cal Evans, Keith Casey and Marco Tabini for giving me the opportunity to give a talk and believing that I could do it. That means a whole lot to me...thanks guys!
The next session I went to was Lorna Jane Mitchell’s talk about open sourcing your career. She talked about how her efforts in the open source community outside of her job had benefited her career path. She started out doing the things that I have been doing over the past few years. Going to conferences, connecting in with projects, contributing where she could, meeting people. I already feel like that is making a difference in my career, and I actually really like all of that stuff to, so it was a good talk.
The last talk of the day was a panel session of the state of the PHP Community. I only got to stay for about half of it because I had to pack, but there was a bunch of good info there for people trying to start user groups. One of the things I am going to take from this conference is that I need to make a better effort to encourage the PHPers in Raleigh to unite a little better. I have plans...bwahahah!
So that’s it for tekx! The conference was great, and catching up with people is always a good thing. I learned a lot and am a bit recharged. Thanks to all the sponsors and organizers for a great conference. Hope I see you guys next year!
tekx Day 3
Day 3 of tekx started with a presentation of developer trends by Matthew Schmidt from DZone. I had met Matthew on the second night here at the Adobe party and we discovered that we were both from the Raleigh area. Always great to meet new PHPers from the Triangle. His magazine is like a digg for developers, so his talk was about what trends he saw over the past year. The most interesting thing that I heard was that users who are migrating to Chrome are doing so at Firefox’s expense and not IE’s. I guess we are all looking for a better, less resource intensive browser. I too have decided to give Chrome the ol’ college try, so we’ll see how that goes.
The rest of the days talks went like this:
- I checked out Matthew Turland’s talk on the new SPL Features in PHP 5.3. Turns out, PHP is getting all grown up with real live data structures like linked lists and heaps. Neato for the Computer Science geek that dwells within me.
- Next was Nate Abele and Joël Perras’s talk about Lithium. Joël and I talked a bit about Lithium earlier in the conference, and it sounded neat. They skated the line of sarcasm with lines like “All Frameworks Suck” a little too much, and I honestly think their message got lost. I still wanna check it out, but the presentation would not have sold me on it had it not been for talking with Joël offline.
- Next was Measuring Your Code, again with Nate Abele. It was a pretty interesting talk about gathering metrics about your code, but it wasn’t a whole lot of new info for me.
After these sessions, I was feeling kinda drained so I spent the rest of the afternoon in the Hack Track hacking on Zend Framework. Today and tomorrow are bug hunt days, so I figured I would give a shot at fixing some bugs. In actuality, the network was so darn slow that I didn’t get a chance to actually fix anything, but I did download and install lithium and got a project stood up with it and Mongo DB very quickly.
During the Hack Track, I had some good conversation with a bunch of folks about PHP, community, contributing to open source, and all sorts of stuff. There are some really awesome people that come to these conferences and they are always willing to help out. Good times.
Dinner was on our own, so I made the trek to PF Changs, which is becoming a tradition any time I go to a conference. After dinner, Microsoft sponsored a gaming night where “Jason and the Thundercats” made our world debut on the Rock Band stage. “American Woman” never sounded so sweet.
I didn’t stay at the part long as I wanted to rehearse and tweak my slides for my presentation that I had to give the next day. I had to go downstairs because the internet in my room sucked, which led to me catching up with some more folks and having more good conversation over a beer. I freakin love this conference...
tekx Day 2 Sessions
Day 2 of tekx was actually the first real conference day full of sessions. The day started out with a bang from Josh Holmes who delivered a keynote that rang true in so many ways. His talk was about the importance of keeping our programming and our problems simple. I am as guilty as any developer of over-engineering a problem and it has slowed me down quite a few times. An excellent example that sticks out to me was when he talked about how the initial idea of twitter was so simple, most of us developers would have been like "it's not worth us working on it because that is a way too simple problem to solve". He's right too. When I first saw twitter, I was like "I could do that". But the point is, I didn't because I was too concerned with the complex problems. Anyway, it was a great keynote. I even tweeted during that keynote that I was going to make all my developers watch it.
I went to a few other interesting talks as well.
- I started with Rob Allen's talk on Zend_Form which really was a refresher course to me. I did catch a few new hints, mainly using a translator to do custom error messages in Zend_Form.
- I followed that up with a talk about Graph theory which was incredibly relevant to the state of social media. It was also a good bit of stuff I hadn't heard about since I was in college, so it was good to get back into that.
- I spent a dual session hanging out with Keith Casey and writing some Flex. I used Flex a few years ago but never had a use for it, but it seems to have grown up a bit since I used it last. The talk got me thinking about ways I can apply it to some of my projects.
- Next up was Eli White's talk on code and release management. I had one of those moments that you have at these conferences like "thank god I'm doing this right". It was good to hear that we hadn't screwed anything up too bad...yet.
- The last talk of the day was Matthew Weier O'Phinney about NoSQL. Matthew always does a good talk that is really informative, and this was no different. I'm definitely going to look into Mongo DB, which is a NoSQL database, when we get back.
The day ended with a few of us going out to Gino's Pizza for dinner. It was pretty good, but Giordano's was better IMO. When we got back, I was so exhausted that I went to bed early. Long day of learning.
Come see me at TEK-X!
I have the great honor of speaking at TEK-X this year, which is an awesome PHP conference in Chicago from May 18 - 21.
My topic is "Lean Mean PHP Machine", where I will be talking about how Garrison and I do what we do with very little budget, high demand, high stress...but also high efficiency and quality. You know what that means right? It's gonna be flippin sweet
But only if you guys show up!
Conferences are a great way to network with new people and revisit old friends, so I am really looking forward to it. It's worth every penny of the conference fee to hang out with the "Who's who" of the PHP community (that definitely doesn't include me, but it does include folks like Rob Allen, Matthew Weiere O'Phinney, Cal Evans, Keith Casey, Eli White and many more...all regulars in my Google Reader).
Come on out to TEK-X and please find me and introduce yourself. I always enjoy meeting new folks... See you in Chicago!
Open Source in Higher Ed – Give a Penny, Take a Penny
I love open source software. The sharing, the collaboration, the community around it. For those that know me, you know that is right down my alley. Working in higher education at NC State, there are many services that I know would not be possible without our access to open source software. Our campus homepage uses jQuery, we are a huge PHP shop, and MySQL provides database services for a lot of apps on campus. But open source is more about consuming, it's about contributing back.
I know you have all seen those little "Give a penny, take a penny" trays at convenience stores. There are a few pennies in there, and if you need one, you take it. But there is also an inference that if you have an extra penny, you should throw it in for someone else. Open source software is not really any different. I can't count how many open source solutions I have implemented, and without those solutions, I would have wasted valuable time and energy recreating something that was already done. Why not provide the code that I write for some other poor soul out there trying to solve the same problem? In my mind, that is just common decency, especially when my time is paid for by the tax payers of the State of North Carolina. If you work in public service and DON'T share your code, I may just call you selfish.
People really and truly appreciate the sharing of your code. As a perfect example, we have open sourced the code we created for the http://twitter.ncsu.edu site, making it free to download, implement, change, whatever. A few weeks after we released the code, I probably had messages from 5-7 other Universities who had downloaded the code and had plans to implement their own twitter site. Today, I got a message from one of those people that I had been helping over the past few months stating that they got their site up and going! Check out http://twitter.vanderbilt.edu! Then I also got this nice tweet from them:
I'm not saying that Vanderbilt couldn't have created this on their own. I'm sure they could have, but I'm sure they have better things to do than "re-invent the wheel". Now Vanderbilt's faculty, staff and students can benefit from the same code as NC State's, and that is a very powerful and meaningful thing.
Call this a plea. Call it a "call to action". But the fact is, if we are creating software at a public institution, we should be open sourcing it, no matter how big or small the codebase is. If you are creating software, realize the difference you can make for other developers by making your work freely available. Not only will it make you feel better, but it will probably make your code better because you won't want other people to see how you hacked some junk together.
The next time you download WordPress, or Drupal, or jQuery, or Linux, or Firefox, ask yourself what you have given back to the open source community.
Strategies for upgrading webapps?
Calling all software developers! Garrison and I need some help...
Here is the scenario. We have to maintain a bunch of production web applications, most of which use Zend Framework. When we have created a new version of the application, we need to deploy it to production in as simple of a way as possible. We have automated the file version of this by using Phing to export the tag out of SVN, copy old config files, set write permissions in the correct place, etc. However, the database manipulation has happened manually and we are looking for strategies on how to automate this.
We came up with an idea to write a custom migration library which will execute php and sql files, but it seems like a problem that has to be solved better by someone else. Anyone have any tips? Anecdotes? Strategies? Anything to help us get going in the right direction would be much appreciated. I'd even buy someone a beer or two









This week, I will be attending the 
