Being a relatively new full time code monkey, there are some things I don’t readily think about. Take number data types for example. In the past, I’ve disregarded the fact that numbers can be treated as an integer, float or string. Sometimes I’d throw quotes around them, sometimes I wouldn’t; never thinking much of anything as I did (or didn’t do) so.
Now that I do think about these things, I get kinda sad about my past inattention. I’m not even sure if it’s that big of a deal. The fact is, however, that I’m trying to make coding more than just the thing that pays the bills I’m trying to make it my craft. And, as with most crafts, it’s all about the details. What moves a person from good to great, is nitpicking at things that day-to-day’ers ignore – even if being ignorant of those things has little or no affect on what your trying to accomplish. At least I think that’s true (I change my mind a lot.)
I stopped being lackadaisical about this how-to-define-a-number concept when I was thinking about POST data, and how you would classify it as an integer or string when passed through a form. The answer is, YOU can’t. Form input is always a string. Period. You’d have to do some other things if you want to determine what it’s type is.
I’m not really sure why this prompted me to start thinking more seriously about data types and numbers at THIS particular moment, and I’m not sure that it matters. The fact is, I’m moving in the right direction – from a passionate worker bee, to a passionate craftsman. At least I think I am.