Open Source Solutions for Small Business Problems

Open Source Book coverHi! You've found a page that was previously published on OpenSourceSmall.biz, a web site associated with the book John wrote called Open Source Solutions for Small Business Problems. This book is available for purchase at Amazon (affiliate link), but we've rolled all the web site content into John's business site.

Don't hesitate to drop us a line if you need anything!

Quality Code: How do you judge?

We're hiring programmers, over at Freelock. I've been going through lots code samples to try to identify how experienced and competent a particular developer is. I also do this on a regular basis to evaluate how solid a particular open source project is.

I've seen a lot of code in various languages. As a technical writer, I used to write documentation for programmers teaching them how to use a particular interface or system. I've been involved with traditional software development projects at large software companies and startups. And I've done my share of actual programming of web applications.

I'm finding there are several indicators I look for when evaluating code, specifically for PHP, our language of choice. I'll go in more depth on each of these qualities in future posts, but for now just thought I'd capture them while they're fresh in my mind. So when I review code of a web application, here are some qualities I'm looking for:

  • Secure. Does the application trust users to provide good data? Does it protect its internals to prevent all the various types of exploits out there? Does it protect data from malicious users?
  • Fast. This could mean many things, but I'm looking for efficiency across layers. Is there a database call inside a loop that gets called a couple hundred times? That's a huge speed killer. I look for code that has an appropriate level of abstraction to the size of the problem--and makes sensible choices about how much data to load for each request.
  • Powerful. This one is stolen from Paul Graham. Does the code use object-orientation and inheritance in a powerful way? I like seeing utility methods on base classes, which can then be leveraged to make very short, easy-to-understand final classes. Are the methods attached to the appropriate level of the class hierarchy? How short can you make the main logic of the application?
  • Clear. Going hand-in-hand with power, clarity is about making it apparent what each chunk of code is for, and how to go about changing it to make it work the way you want. Clear code is maintainable, well-documented, easy to customize.
  • Customizeable. Was the program designed in a way that's easy to override, easy to customize, easy to run in other environments? Can it be managed effectively, and work broken up into different units?
  • Reliable. Does each function or method cover all possible scenarios? Is there proper error-handling in the code? When an end user hits upon some combination of things that the programmer never anticipated, does the program die ungracefully, or provide useful feedback?

Very few programmers hit all of these. My biggest weak area is the reliability one--after reviewing other people's code, I find a lot less exception handling in my code. We've all got something to learn. But reviewing other people's code can help you spot weaknesses in your own, and develop a much stronger sense of how to do it right.

[Edit: Adding links to more detailed posts as I publish them]

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <h1> <h2> <h3> <h4> <h5> <p> <br> <img>
  • Lines and paragraphs break automatically.
  • Twitter-style @usersnames are linked to their Twitter account pages.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.

Freelock Blog Posts

Customer Feedback

I had the privilege of working with John and Freelock in launching a new Little League website. The process was flawless and the end product was magnificent exceeding our expectations.

John knows his stuff! He had a wonderful ability to bring the perfect solution to our community based organization. Being volunteer run, we needed some special considerations in the way our website works, John understood this and delivered solutions that were perfect for us.

We now have a cool website that also has the ability to grow with us into the future.

I highly recommend John Locke and Freelock Computing.

Brian Boone
Pacific Little League

About Freelock

We are located in the Fremont neighborhood of Seattle, WA. 3800 Woodland Park Ave. N. Seattle, WA 98103  USA [P] 206.577.0540 Contact Us | Site Map Get Updates ©1995-2011 Freelock Computing