When I say "binaries", I'm not referring to a binary file, but rather a programmer who is familiar with, and uses base 2 in practice. I've come to know quite a few excellent programmers, but found that they all share one fault (in my opinion) – they live and breathe in base 10.

This is understandable, after all, we are developing in high level languages which already do quite a bit of work for us, why not let them deal with extra space requirements needed by base 10.

Simply put, it's easier all the way down the stack (front-end of application down to the CPU itself) for the PC to work with base 2. So, why not lean that direction yourself.

One of the biggest culprits that I find is database field lengths.

I see a lot of:

CREATE TABLE mytable (
  id INT AUTO_INCREMENT,
  name VARCHAR(30),
  address VARCHAR(75)
)

While those are nice "round" numbers in our eyes, I'd have to imagine that the database engine would be just a bit happier to see:

CREATE TABLE mytable (
  id INT AUTO_INCREMENT,
  name VARCHAR(32),
  address VARCHAR(64)
)

A browser might prefer:

<input type="text" name="myfield" maxlength="64" />

Instead of

<input type="text" name="myfield" maxlength="50" />

 

Of course, these things have to line up with your business logic, but they only serve as examples of possible ways you can improve your code.

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *