Using the Correct Ruler

Two puppets each holding a ruler with differing scales

Sometimes, the guys controlling the synapses are asleep at the switch, and things I've always known are momentarily gone. It's one thing when I know that to be the case — knowing what I don't know — such as seeing an actress on the screen and being asked who it is. I knew until I was asked. It's not knowing that I don't know that's the bigger problem...not realizing that I've forgotten, because the switchman hasn't fallen asleep, he's thrown the wrong switch.

I had a relatively large piece of code I was debugging, and much of what I was trying to do was using a new API (not just new to me...new to the public), and I had little idea of what I was doing on so many levels, that it took quite awhile to zero in on the first of my many issues. This first one made me chuckle, though.

strlen() is not the same as sizeof()

It may imply the same thing in English, but it is obvious, when all synapses are firing correctly, that strlen() is the length of a string, while sizeof() is the number of elements in an array, so that sizeof(array[0]) is probably going to return a much different (and unwanted) value than strlen(array[0]) !

Tags: 

Post new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
By submitting this form, you accept the Mollom privacy policy.
Design by Ayen Designs. Underlying Drupal theme by Kiwi Themes.