Sep 29 2006

My Rackathon Donation

The OSU Open Source Lab has been good for open source. In my time there I learned about what makes open source tick, and that it’s not some mysterious cloud of elitist developers, but rather a group of people just like you and me who work hard everyday to keep things going and end up doing extraordinary things. Kind of reminds me of where I work now:)

So it wasn’t hard to join the Rackathon and donate some bucks to help support all of the projects they host. It’s the least I can do. If you enjoy the projects they host, send some money their way and help support them.

Every little bit counts.


Sep 1 2006

Testing Habits Are Your Friend

As I’ve gone farther down the road I’ve learned the value of testing. My first introduction to unit testing was through JUnit in a Java project I worked on last year. Now, there has been a recent push for testing in PHP web apps that used to be homegrown in the worst ways and need to extend past the typical “what, it works, shutup” approach to PHP testing.

Not testing is not healthy. Sooner or later you’ll be wrong, which will make you a huge jackass. And nobody likes being that guy. I know I have been on occasion. It sucks, and it can make people second guess you, which sucks even more down the road.

So cover your ass by making a paradigm shift when it comes to your development habits and approach:

  • Create tests that you know would work if you wrote your scripts right — as best you can, don’t go for 100% coverage, just get something up there to mimic the typical “yeah okay it works at least, but not quite” once-overs you do
  • Assume what you’ve written is wrong
  • Run your tests, and see if they work

I’ve been convinced that this approach to programming is much healthier (thanks Shaver) because it forces people to think before writing the bulk of their code — possibly alleviating problems before they happen. Duh, right? Everybody knows that, right? Well, not everybody does it, and there’s a big difference.

I think that ideally, everybody would create tests for just about everything possible, but I do have some reservations when it comes to that.

For one, sometimes you just don’t have time. This is a terrible excuse, and I guess it depends somewhat on the scope and sensitivity of your project. But, if your project is planned right you should have the time and resources to get in a fair amount of code coverage without jeopardizing your timeline. And, arguably, if you’re already used to a test-oriented approach to development things might actually be faster.

Another thing I’ve tried to identify is when I’m overdoing it (this is more of a fear). So, okay, you want to test your code as much as you can, but there’s a line I wouldn’t want to cross. It’s the line between having a complete and working end product and having an incomplete product with complete and exhaustive tests. In that case, I’d vote to let some of the testing slide, but not all the way, in favor of a more complete product.

The long tail of development can pick up the slack for more exhaustive tests and bug fixes that you ideally would only fix once — write a test for the bug, fix the bug, done. Most of it would probably be doable during alpha or beta releases — it’s what they are for. I’d argue that it’s also more productive during that time because you might have a better knowledge of your app and be in a better position to spot unforeseen problems and write proper tests.

I’ll be honest; for me it’s been a bit of a learning experience. A welcome one, for sure, but frustrating at times because you’re always going to run into “oh shit, my bad” situations when you’re trying to change mindsets and unlearn bad habits. In PHP, I think this is probably a bigger issue than in other languages because it already lacks a bit of structure by nature. There’s also the programmer laziness hurdle to overcome. It’s a big one.

There are some decent PHP testing tools out there that sometimes gather dust — especially in PHP. But, if PHP is going to break more into enterprise development, I think they will gain in popularity. Here are some PHP testing links for you:

So — PHP developers, it’s time to stop being lazy and take a serious look at this stuff. If you get an irritated feeling because I said that, it’s because you’re wrong and you’ve just gotten used to being wrong.

Comfortable and easy doesn’t get you anywhere in the long run.


May 19 2006

Open Source Undefined

Most persons do not see the sun. At least they have a very superficial seeing. The sun illuminates only the eye of the man, but shines into the eye and heart of the child.
- Nature, Emerson

Open source can be any number of things, depending on who you’re asking. To the hacker it’s about teamwork, comradery, IRC, CVS or SVN and great flamewars. To the CEO it’s risky, and often times very dependent on highly-skilled staff who may or may not be here tomorrow. To Wall Street it’s a non-commodity with high risk and low returns. To mom and dad it’s a mysterious concept you’ve asked about many times but never quite understood. To my cats, it’s what makes me sit at the glowing rectangles for hours on end.

To all of us, though, it’s the future. Most of us agree on that much.

In my time here at OSU in Central Web Services and the Open Source Lab I’ve spent a lot of time thinking about open source, because I’ve been in the middle of it. Working with the Mozilla community has also taught me a lot about the masses and community development. I learned over the past three years that it’s less about the masses and more about individuals who care a great deal about where we’re all going.

So the #1 question people ask me is, “What is open source?” To be honest, I’ve stopped worrying about defining open source. Instead I’ve tried to appreciate it.

Does it really matter what open source is? If it’s an ideal, a business model, communication style, natural progression, another step in our evolution — I’ve stopped caring about trying to outline it and present it in a bulleted list.

To me it’s just chaos, and it’s wondrous. I’m so caught up in it. It’s intoxicating and pulls me in some undefined direction. Like riding in an airplane with an unknown destination. You don’t know the pilots or where you’re going but you’re still excited about the possibilities. Like stepping forward onto a stage, lights blinding, and having an act but still not being entirely sure about how the show is going to turn out.

Or maybe it’s an emotion. You can’t quantify sadness or jubilation. How do you explain the color yellow to a 5-year-old? You can’t. How do you explain happiness to a rock? You can’t.

So I’m done trying to draw blueprints for the stage, or profiling the pilots and passengers. I’ve given up and put down the pen.

Because no matter how many times I fill a whiteboard or flowchart, I leave the audience thirsty. They are given a little sip of an idea — ephemeral and slight as something like the American Dream. It’s something we all whisper about and pull for but can’t really define. It’s something driving us that seems so strong and powerful yet at times, in its tiny fissures and failures, it all seems so fragile and brittle.

It is what it is — whitewash pitted with valleys and riddled with amazing plateaus. It’s us reflected in code which is scary and unpredictable but it’s alright if we remember we’re in it together.

It’s life, and you can’t define life — you just live it.

Something doesn’t have to be intricately defined to have meaning.