Introduction to Primary Data Types
Putta Hemanth Kumar
Software Developer @ Samsung Research Institute || Code and Content || IIEST || DSA || C++ || System Design || 1.5K LinkedIn
Ram, a curious student who wants to learn DSA and started with primary datatypes.
Ram is confused after looking at various datatypes like integer, character, float, double, Boolean etc.
Ram immediately confused and he asked himself that, what are these datatypes and why are these many datatypes? If I have a value can’t I store it in any datatype? Bheem correctly said it's hard to understand programming.
Ram immediately backed off the table and started watching reels until his mom calls him to get various household items from the market.
He has gone to the market with a list written by his mom. He visited different stores to buy different items in the list and finally returned home with all the items.
At home his mom unpacked all the items Ram bought. Here Ram has noticed that, different items were packed differently.
When he bought vegetable oil, the shopkeeper gave it in a bottle.
The vegetables are packed in a paper bag.
Sweets are packed in a box.
While observing so, his father arrived home with a lens box for his latest specs.
领英推荐
Now after noticing everything, Ram is silently wondering....
Why not Oil is not packed in a paper bag?
Why not vegetables are bottled?
Why not his new lens are bought in a tumbler?
Finally in the night around 10pm when Ram went to his bed, he understood that he can relate what happened today to the datatypes he’s trying to understand this morning. Different type of values can only be stored in different datatypes and the reason there are different datatypes in Programming language.
His doubt got clarified with basic household work and he hopes that everything is as easy to understand like he did today and he went to sleep.
Different Datatypes:
Copywriter for health & wellness founders/coaches
1 年The Best Analogy and explanation. ?? This is so casual and so relatable. They way you added real life examples to connect with And images to visualise them are ?? Great work Putta Hemanth Kumar
Student of b-tech (CSE)
1 年Easy and Informative...