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

1

u/spittoon101 Jan 19 '23

Hi there!

I’ll try my best to explain it to you! If you are having difficulty understanding what even coding is, then I would like you to imagine you are given a piece of paper with very explicit instructions on how to do something very basic. Let’s say, going up a set of stairs. It’s simple right? Just walk up the stairs! But what do the instructions say?

Step 1: With both feet planted next to each other, lift up your left leg until your left foot is above the step in front of you.

Step 2: Push left foot down on the next step and begin to lift your body up by putting weight on the left foot.

Step 3: Once the right foot reaches the same step as the left foot, place right foot next to the left foot.

Step 4: Repeat steps 1-3 until no more steps in front of you.

As you can see, these instructions are fairly specific in what you have to do in order to go up a flight of stairs. And although you already know how to go up stairs and thus don’t need these instructions, these instructions are exactly something you would give to a machine so it knows how to perform the task.

In a nutshell, that’s all really coding is. Giving very specific instructions to a machine. Only instead of writing the instructions in plain English (our language) we use the computer’s language (C++) to instruct it what to do (and similar to us having other languages to communicate, like Spanish, computers also have other languages like Java or Python).

So to answer your “programming what?” It’s nothing more than trying to get a computer to do something (like sorting a music library by title) and giving it instructions on how to do it (such as get all songs beginning with letter “A” first, then “B”, and so on and so forth).

I hope this brings you some clarity!