beginner

Index

This tutorial is aimed at teaching you modern C++ (by this term I mean ISO C++ 2011 and later standards) as the first programming language. Apart from C++, you will learn lots of principles, terminology, idioms and guidelines that are ubiquituous in the programming world. After learning the first programming language (especially a very voluminous one such as C++) it will be much easier for you to pick up another one. Programming is much more than writing code - code is read 10x more than written[citation needed] and there is also a significant amount of time spent on analyzing any given problem.

Core goals:

  • Understanding concepts that are ubiquitous in the programming world (e.g. objects, conditional instructions, loops, algorithms, function call stack and many more).

  • Teaching you things that go with proper programming: making decisions, solving problems, good/bad habits, programming style...

  • Understanding what differentiates C++ from other programming languages (features, syntax, conventions, ...).

Other notes:

  • Beginning is often the hardest part of programming. If you managed to setup the environment so that you can write code and run it, you have already accomplished a significant step. If not, you can read first chapter (which is theory only) - this should tremendously help you understand most fundamental elements and the process of installation of required tools.

  • Don't copy-paste code samples until you memorize the grammar. It's obvious that at the start you will not remember perfectly where every punctuation goes. Just by rewriting examples you will learn it over time.

  • If at any point you encounter a term that you don't know the meaning of, check the glossary.

  • If you ever have an urge to edit example code and see what happens - do it. You will learn a lot through experience. If you encounter a non-trivial problem - don't put too much effort into it - there are tons of things you might not know at the beginning but will know later. Take notes of these problems and attempt to solve them later when you know more.

  • Don't be turned off by the fact that most of first lessons is just reading. You need to understand many concepts (universal across programming languages) and such lessons give you this knowledge. You could obtain it through coding by trial and error but especially for C++ it would be a very long and frustrating path.

Do I need to learn C before C++?

Absolutely not. In fact, this is one of the biggest mistakes that a C++ teacher can make. Majority of C code is C++ compatible but also uncoventional and bad C++ code. C++ redefines a variety of C patterns and if someone learned C before C++, it might be needed to "unteach" C habits or the person will write unidiomatic C++.

Learning C before C++ is like learning Latin before English. They use the same alphabet but that's basically it. C++ took C's grammar and abstraction concepts from Smalltalk and Simula and combined them in one language with specific philosophy, a slightly different philosophy than C which results is significant differences in various conventions.

What if I can't understand something?

You can always research the topic on your own, but more often than not you can simply move on. Usually the fun part comes when you can mix 2 different features, after learning both separately which did not immediately presented their benefits. Sometimes you just need to gather enough building blocks untill it starts making sense. Some people might need multiple iterations of reading and coding over a single chapter untill they understand everything. Patience is highly valuable in beginners.

Take notes during learning and if you feel like you can provide some feedback (especially on the order of lessons) - do it. TODO link.

Do I need to be good in math to program?

In my opinion, it's enough to understand functions and polynomial equations. By understanding I don't mean knowing how to draw and solve every equation, but to get the concept. Function as a term appears very frequently in programming but it doesn't represent mathematical functions, it's more of a concept of reusable mechanism that accepts certain input and provides certain output. Any math beyond that is not required. We program so that we are not bothered with math, this is the task for computers. Still, any additional knowledge will be beneficial - especially mathematical logic.

Do I need to understand the binary system?

It is not required, but it is an advantage. Except few operations, nothing really depends on understanding binary system - all programming languages abstract binary system unless you want to perform binary-level operations. All lessons relying on binary operations are optional.

Do I need to be good in English?

I don't think my english is particulary hard (I'm not a native speaker by the way) but I encourage you to learn English (before or during the course) if you have problems reading the content. English is the main language of IT industry so even if you somehow learned programming without speaking English, chances of getting a job are significantly lower.

Do I need a powerful computer to program?

No. The essential part of programming is reading and writing code. I hardly doubt your computer is not capable of launching a text editor. If you can view this website, you can program too.