How to start programming in C++

Now that we've explained what the C++ language is and what it is for, let's learn how to download, install, and configure our programming environment, getting everything ready to actually start programming.

What do you need to program in C++?

Surely you have seen someone programming, either in person, or on TV, in a soap opera or movie. It's usually someone in a dark environment, fast typing a series of indecipherable words and codes on a dark screen, amidst a series of monitors with flashing lights and text rising on the screen.

Calm down, you don't need anything 'cool' or 'super-hacker-evil', nor do you need to be super gifted to program. Just knowing how to turn on your computer, log into our site and read, you'll be able to start programming in C++.

How begin in C++

Basically we will only need two things to start programming in C++:
  1. Text editor
  2. C / C++ Compile

The text editor is the program that you will type in C++ code, such as a notepad, for example.

Compiler is the program that will take this text with the code and turn it into machine language. This is necessary because the hardware only understands the binary language of 0's and 1's.

You can even theoretically type in machine language.

But it's easier to write:
cout << "Progressive C++ course";

Instead of:
011101001 0011001010 001010101 010 0010011 010101001010  011101001 0011001010 001010101 010 0010011 010101001010  011101001 0011001010 001010101 010 0010011 010101001010  011101001 0011001010 001010101 010 0010011 010101001010  011101001 0011001010 001010101 010 0010011 010101001010

Do you agree?

So just type in the C++ code and let the compiler turn this into a language your machine will understand.

IDE: CodeBlocks

We are not going to teach you how to program using an archaic text editor, then going to the command prompt to compile, link and run your programs, as this can scare beginners a bit, giving the impression that programming is complex.

We'll teach you how to program using an IDE (Integrated Development Environment), where you type the code, click a little button, it compiles and runs, showing everything in a very simple and easy way.

We refer to Code :: Blocks.

To do so, go to: http://www.codeblocks.org/ (or type Code Blocks on Google and enter the first link).

Click on Downloads: http://www.codeblocks.org/downloads
Then download binary release.

Note that Codeblocks is multiplatform, meaning you can program on both Windows, Mac and Linux. Go to the area of your operating system.

Let's download and install Code :: Blocks already with the compiler, which in this case is called MingW (must have this word in the download link).

In our case, we are downloading and installing through this link:
codeblocks-17.12mingw-setup.exe

Wait for the download.
Open the executable file (if you have it in Windows as a system administrator).

Press next and choose the full installation option.
Run Code Blocks:
How to download and install Code Blocks

And that's it, your programming environment is already properly assembled and configured.
Talking a little more about Code :: Blocks, it was developed in C++.

It uses the plugin system, so you can download and install it from the outside, to scale up and make your IDE more powerful and flexible, even for programming in many other languages.

It has syntax highlighting, so as you type, your code gets 'colored', highlighting specific keywords, text, and commands you'll learn throughout our course.

It also has auto complete code (you start typing a command, and it already understands which one you want to type and completes automatically if you want it), list of integrated classes and a list of TODO.

It is a lightweight, small program, consumes little RAM and allows a variety of possibilities, such as programming using different types of compilers and different operating systems.

In the next tutorial we will finally get down to earth, typing in the code, compiling and running our first software.

No comments:

Post a Comment