a stack of black rocks precariously balanced

Sweet Thursday Web Development

Some Simple Programming Rules

April 7th, 2009

I’ve been web programming for about 4 years now. Primarily I’m a PHP programmer (self-taught) with some Javasript thrown in here and there and Actionscript only when I absolutely have to. Programming is a strange animal. I tell my wife often that I really love my job, because I do, but to listen to me sitting at my computer on some days I’m sure an outsider would think that this is only something I do because I have to. The frustration comes regularly, though not as often as when I first started programming, but it does still come. I sometimes feel like my real job is fixing two kinds of problems: ones that others create and ones that I create.

Over the years I have formulated some rules for myself that have become invaluable to me when the problems arise. The browser might crash, the screen may go blank, the code snippet I’ve written is not doing what it is supposed to, I’m getting error messages that tell me any number of things I’ve done wrong. What to do? How does one approach a problem? Here are my rules for dealing with problem code in a very particular order:

  1. Your code is wrong. This is always the first thing you should keep in mind. Don’t ever initially fall into the trap of thinking something must be wrong with the machine processing your perfect code. This will kill you and waste many of your hours.
  2. If you are absolutely positive that your code is correct: Your code is wrong. Yes, that’s right. Even when you are sure your code is correct . . . it’s not. Trust me. Again, once you come to the conclusion that your code is fine and it must be the damn computer’s fault you have need to abandon all hope. Trust me.
  3. If you have progressed through rules 1 and 2 and know for sure it must be the computer’s fault remember this: Your code is wrong. Seriously. It is. It is bad code and you wrote it and you’re responsible for it and it’s all your fault.
  4. Your code is wrong. It is, I’m telling you it is and it is. Don’t forget this. I know you’re the next Einstein or the next Bill Gates or the next Trinity, but I’m telling you: YOUR . . . CODE . . . IS . . . WRONG.
  5. So now you’ve made it to rule 5. If you haven’t solved the problem by now, you’re pretty frustrated. You’ve probably left your desk several times, cursed enough to warrant several confessions. You’ve looked for typos, logical errors, syntax errors, you’ve searched the internet, got sidetracked in some forum discussing barbecued pizza and you have every right to consider that the problem may not be yours, that it might actually be something that is not your fault, that some evil programmer who could program you into oblivion has made a mistake and you have discovered it. Nope. Your code is wrong. Mark it down. Carve it into your desk. Build a website around it. For the sake of simplicity and ultimately your sanity always remember: your code is wrong. Trust me. It is.

Parting is Such Sweet Relief

April 7th, 2009

Bye IE 6 — may we never meet again

Bring Down IE 6
Remember the boyfriend or girlfriend that you had who became more of burden to spend time with than a pleasure? Maybe it happened subtly, maybe you realized it in a fit of clarity staring out at the stars or into a bowl of cereal, but finally you knew without question that it was time to get out, to escape, to flee quickly and not to look back. Remember the feeling? Ahhhh . . . relief, as I recall, like a dozen bags of concrete suddenly fell off your shoulders and you were free.

I’m there. I just created two new websites from comps with some really great design and features, requiring transparent pngs and some nice jQuery affects. Transparent pngs on IE 6 are no problem, you say . . . there are workarounds for that (I know, I know, I’ve used them too) . . . unless you need to use them for background images on <a> tags. Try it. You’ll see. Then there’s just the weird things that happen for no apparent reason: tags not acting like they should, adding code when every other browser doesn’t need it.

Yes, yes, I can fix the problems (most of the time), I’ve figured it out, I’ve spent my hours doing it and I’m good at it, but you have to work at it. I don’t mean the kind of work you enjoy because you love it. I love programming, I love getting that great design from the photoshop file on to the web or adding cool effects or working really hard to find the elegant code that makes the database come alive on the page or uses CSS in an unexpected and creative way . . . but then I have to cringe when I look at my site in IE 6. This is broken, that doesn’t work and I buckle down and fix it. I’m worn out. I don’t want to do it anymore. I want to have all the fun I can have building sites and not worrying about IE 6.

So it’s over IE6. I don’t even want to be friends anymore. I hope I never see you again. Don’t try to come back. Don’t call. Don’t write. Did we have any good times? I can’t seem to recall.

Hellooooo Firefox, I’m Glen . . . I believe we’ve met before.

Wordpress Rocks!

April 5th, 2009

I’ve been installing Wordpress on a number of sites in the last couple of months. I am so impressed with how Wordpress is set up. The admin area is very intuitive. Themes are very easy to set up, install and create. I’ve also found it very easy to take the existing design of a site and incorporate into Wordpress for a blog (my site being one of them).

The other thing I love about Wordpress is that it is not just a blog. It can very easily be used as a Content Management System (CMS) without any blog capabilities. And again, I find the admin area far more intuitive than solutions like Mambo or Joomla.

Since there is such a large and dedicated community for Wordpress, plugins are plentiful and of high quality. All in all this a great program and good solution for many web applications.