Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "string vs. int"
-
Should I be excited or concerned?
Newbie dev(babydev) who just learned string vs int and the word "boolean", is SUPER into data parsing, extrapolation and recursion... without knowing what any of those terms.
2 ½ hrs later. still nothing... assuming he was confused, I set up a 'quick' call...near 3 hrs later I think he got that it was only meant so I could see if/where he didnt understand... not dive into building extensive data arch... hopefully.
So, we need some basic af PHP forms for some public-provided input into a mySQL db. I figured I'd have him look up mySQL variables/fields, teach him a bit about proper db/field setup and give him something to practice on his currently untouched linux container I just set up so he could have a static ipv4 and cli on our new block (yea... he's spoiled, but has no clue).
I asked him to list some traits of X that he thinks could be relevant. Then to essentially briefly explain the logic to deciding/returning the values/how to store in the db... essentially basic conditionals and for loops... which is also quite new to him.
I love databases; I know I'm not in the majority... I assumed he'd get a couple traits in his mind and exhaust himself breaking them down. I was wrong. He was/likely is in his sleep now, over complicating something that was just meant as a basic af.
Fyi, the company is currently weighted towards more autistics (him and myself included) than neurotypicals.
I know I was(still am) extremely abnormal, especially when it comes to things like data.
So, should I be concerned/have him focus elsewhere for a bit?... I dont want to have him burnout before he even gets to installing mySQL44 -
A coworker wants to save telphone numbers as Strings in a database I don't get why he doesn't want to use Ints. I think it is stupid because it uses more space and you need to change the type if you want to use it to call someone. He says it is better this way because you can put there "+" and "-" for better readability.12
-
I've been getting a lot of mixed input on this lately and I'm curious to gauge the public opinion on it.
For key identifiers in key/value pairs (eg. days of the week, high/med/low, etc), is it preferable with semantic string naming wherever possible, or are int enums usually preferred for being more clean and robust?
I suppose it's a case of "it depends". I tend to use stringed keys myself since they are more readable but I do think it's a hassle with asserting case insensitivity and how the keys can be accessed as properties - "sometimes, probably".
People often comment on it when they see it, and it turns into this weird mutual "why strings?" vs. "why ints?".2