24 tips for web developers
I’ve neglected the development folks lately. Which is ironic, since I’ve spent the last six weeks buried in reverse proxies via nginx, Nutch and writing web spiders in Python.
To make up for it, here’s a list of random learnings I’ve had when I put on my development hat:
- Learn the business case. Make sure you understand the purpose of the application you’re writing. It’ll help you make informed decisions on features and such.
- Fight for simplicity. Once you know the business case, you can work with your client to keep the application simple. So do it.
- A stupid specification doesn’t justify a stupid application. If you know the spec makes no sense, then work with folks to fix it. Don’t write crappy code based on the crappy spec and expect sympathy later on.
- You’re an architect, not a hammer. In the same vein as #3.
- Plan twice, write once. Oh. My. God. Before you write a loop within a loop within a loop, think! There’s probably a better way. Small changes in architecture can make life a hell of a lot easier.
- Plan for scalability. When your client says “Oh, this will never need to handle more than 1000 records” they are lying. Always plan for ginormous scaling. Write your code so that it can someday run on a platform like Amazon EC2, at least.
- Like it or not, you’re writing for human beings. Turning a simple feature into a game of keyboard Twister may seem logical at the time, but remember: You’re a mutant. You can do things with computers that make a normal person sweat through their shirt. Think carefully about who’ll be using your code, and code for them, not you.
- Make your users leave you alone. Expose as many features as possible. Don’t force your client to come back to you, for example, just because they now want the spider you wrote to just grab image links, instead of both image and text links. 3 lines of code and you can get another week of peace.
- Learn at least two languages. Doesn’t matter which two. The mental exercise will make you a far, far better coder.
- Don’t use frameworks like Django or Ruby on Rails until you know the underlying language really well. Otherwise, the level of abstraction those languages create will turn you into a drag-and-drop programmer, and you’ll write godawful code.
- Learn SQL!!!!! Every day, I see sites that could run three or four times faster if the developers could have the database server do more of the work, and the web server do less. At the very least, learn how to use JOIN, stored procedures (if your platform has ‘em), indexes and the slow query log (every database platform has one).
- Don’t use compiled if scripting will do. I know some folks think JAVA is the risen savior. It’s a great platform. But sometimes, a language like Python or PHP can get you a better result with a lot less effort. Be ready to switch when necessary.
- Learn HTML. And CSS. Too bad. Do it anyway.
- Learn how web servers work. It will help you make smart decisions about everything from use of secure certificates to caching.
- Which, by the way, is also important: Learn to use whatever caching modules/commands/features included in your platform of choice. I’ve recently seen three sites that regenerate every line of every page for every visitor. Seriously? You’re updating your site’s Terms and Conditions more than once a day?…
- Do your own QA. Test your code before you fling it over the wall to the production team or the QA team. There are voodoo dolls especially created for developers who break this rule.
- Include error trapping. Don’t show nasty 501 error pages to the whole world. As much as possible, have your application gracefully recover from errors.
- Practice defensive design. Build smart validation into your applications. Anticipate the mistakes a hassled, rushed person might make while using the tools you build for them.
- Turn on the logging. Your software will break. Make sure you have a clear diagnostic trail when it does: Turn on the logging tools built into your web server and your programming language.
- Think about security. Trap for injection attacks. Use good passwords. And for the love of everything, don’t use the root user for database access in production, OK?
- Oh, and ‘password’ is never a suitable password. Ever.
- Google is your friend. I’ve rarely seen a totally unique development challenge. Chances are, someone else has solved it. Look around.
- Google is your enemy. Just because someone else solved a problem doesn’t mean they solved it right. Check their assumptions, and yours, before you cut-and-paste.
- Leave your computer. Stand up. Turn around. Walk out of your office and talk to other people on the team, face to face. Once they recover from the shock, they will be a lot easier to work with.
Other stuff
- An SEO workflow that works
- 19 ways to be a good marketing copywriter
- Dork detection: 10 questions for ‘professional’ developers
- 10 ways to think for yourself

Ian Lurie / @portentint
Portent's Founder & CEO
Portent's Founder & CEO
Ian Lurie is founder and CEO of Portent Inc., an internet marketing agency that has provided internet marketing, including PPC, SEO, social and analytics services, since 1995. more >
Really good post, the more all marketing and online departments work together the easier everyone’s job will be.
Three more possibilities:
25 – Use gzip compression for faster loading (heck use everything Google Conversion Optimiser suggests).
26 – Make use of your 404 Pages. Add links to possible content, drop in a search box, make it easy to get back on track.
27 – Split test. A purple button may seem more attractive, but you won’t know until you try.
Good Tips! Must read for all web developers including freelancers. I particularly liked point no.1 and 3. Because these are common things some web developers generally fail to understand.
Wow, what a Great list! I would only add one more thing… comment your code! Not just for your own sanity, but for others as well. =) Thanks for sharing.
Love it…specially no. 4, I’m not a web developer but I do work with them once in a while…you are an architect, not a hammer.
Nice tips, especially the ones about not letting your client come back to you. I learned this the hard way in the past.
Ste
Something all web developers should read! My favourite, point no. 16, by far. The QA process of a website can be a little trying sometimes.