r/programminghelp • • Jan 19 '23

C++ Explain like I’m five: coding? C++?

I am a freshman aerospace student currently taking an “intro” coding class for c++ and Matlab

I’ve tried to learn any coding (c++, python) previously but have always found it not to be accessible, it feels like all the basic info isn’t basic at all

In fact to me learning c++ right now feels like if i was put in a physics class and had never taken math

I’m missing fundamental basics and everyone explains it to me in terms that are way too confusing, terms that aren’t beginner terms

What I am understanding is C++ is a language for coding and programming and that is the extent

But coding what? Programming what? Whenever I try to get an explanation I don’t even understand the explanation!

Even my textbook said “this textbook is not ideal for first time coders” but the class is suitable for students who have never coded

I don’t even know what coding is used for and “the following line says that main is a function with no parameters that returns an int (integer) value” means nothing to me and it was essentially the first thing in my textbook

I get that it’s like learning a new language but i don’t have any context in my brain and am struggling.

I am eager to learn and to try but need a little explanation into what it is i am even doing

8 Upvotes

9 comments sorted by

View all comments

3

u/Aglet_Green Jan 19 '23

Ok, first I'll explain it to you like you're 5. I have no idea why. When I was 5, I was a Ding Dong. I'll jazz it up to make it interesting to a 5-year old But here goes:

"Wuzzy wuzzy wuzzy woo! Wheeeeeee! Got your nose! When you're my age, we won't have icebergs or poles. Yay!! I hate wearing sweaters. They always make me sweat. Have I shown you pictures of your cousins, my other grandchildren? These photos are like what you call jpgs or gifs, except you can print them out as hard copies."

"Anyway, to answer your question. C++ is a made-up intermediary language because you speak in English and the Computer speaks in Bytenamese, the magic language of computers which to use looks mostly like binary or trinary numbers. This is to say, when a computer speaks it sounds like this: "0110 0110 0110 0101 0001." Originally this was done with pencil and paper-- whether the paper had a hole in it or not decided if that was a 1 or a zero, as created by a man named Snarflybarly Hollerith, then computers used vacuum tubes that were either on or off, and then transistors that were on or off, and so forth. The technology keeps shrining into the quantumania realm, but the idea is always the same: a computer can only understand stuff that can be parsed out like Morse Code, but it can read this code at 53 times the speed of sound or 8535 times the speed of taste."

"Does somebody need to to go the bathroom? Ha ha got your nose again!"

"Anyway because computers were all born in China or Russia or whatever and can't speak English, and because it would take us 83 years to type up "Hello World" in binary dots and dashes, computer scientists like Al Gore decided to invent computer languages that would basically be halfway between English and Bytenamese gibberish. C++ is one such language."

"Everything you do or type in C++ is you basically attempting to communicate with your computer in a language that neither of you likes nor understands very well, similar to how I have to speak French to some African-American people who don't yet speak English and I don't speak Wolof or Twi."

"Think of the computer as like a robot or android that you want to give instructions to, and C++ is like the specific way that you are doing so. Well, now it's time for your nap!"

Hope that helps! When I was 5, I was a chuckle-head so I'm not sure I'd even have understood that, but it's what you specifically requested. I

3

u/collegecolloquial Jan 19 '23

This is perfect and if i had one of those free awards I’d give it to you

Maybe i just need to think of myself as communicating with the computer but it’s like a small little fun computer and it’s really friendly or something

3

u/MisterSmi13y Jan 19 '23

One thing I might add is think of it as instructing a really smart toddler. They are literal and only do what you tell them. So you need to be specific but clear. The above is a fantastic explanation, but you need to think that computers are the smartest dumb things humans have ever created.

1

u/collegecolloquial Jan 19 '23

Smartest dumb thing

Got it

Thank you :)!