Share ⇓

Why should learn C++ as their main programming?


Why should learn C++ as their main programming?

C ranks 4th in popularity according to 2019 https://stackoverflow.com Top Programming Language ranking. Learning C is a wise investment for all programmers.

C is the hardest language for students to master, mostly because they have to think much. Really much. We don’t claim that C# is easy, or Java is easy, but in comparison, yep, they are easy. Many other popular languages provide some cool “features” allowing developers to concentrate on their actual problem, instead of worrying about language-specific quirks (agree, C has so many of them). In Java/C# you have automatic memory management, e.g. “don’t think about the memory at all”. In JavaScript you also have freedom of using var, no int’s, no double’s, no floats and char pointers at all. “Just store the value somewhere and somehow”. The levels of abstraction allowed programmers to solve their problems faster than before and simultaneously, those levels of abstraction allowed programmers to “know less, do more, don’t worry, make money”. For sure, you don’t need to worry about memory management, or types or whatever else packed in a fancy title “performance”. It’s just you and the problem you are trying to solve. Language is just a tool. It must help you, not hurt you and your little feelings. And your job title (senior, right?).

What would become a programming student who will study, for example, JavaScript as their first and only language? Definitely not a programmer. Yep, just an advanced user, or you might say a “StackOverflow copy-paster”. Why so? Let me introduce you Alice, she’s a lawyer, she‘s good with computers, she can install software, setup a network connection, she’s able to distinguish WiFi from Mobile Data, but she doesn’t know programming. She is aware of different operating systems for desktop and mobile. She even uses two operating systems, an OS X installed on her MacBook and a Windows, installed on her office desktop. She kind of knows even that Mac applications couldn’t be installed on Windows. She uses some hard to master software for her job, some lawyer-specific soft, with many menu items, buttons and dialogs.

So, why is it a MUST for students to learn C as their first programming language (and learn it really well). Because, by learning C , students have to:
  1. worry about memory management;
  2. know the difference between compiler, linker and loader;
  3. find out that compilers make some optimizations (compilers code better than you);
  4. learn meta-programming;
  5. distinguish compile time from run-time;
  6. really understand low-level implementation of polymorphism (such as virtual tables and virtual table pointers, or dynamic type identification);
pointer arithmetics, which could be a good base for understanding node-based data structures (f.i., linked lists, trees or graphs);

find out that compiler generates platform-specific code, and discover that there are many other platforms, instead of Windows on x86;

find out that there are ELFs and PEs and other executable file formats, each of which has a bunch of sections you should at least partially be familiar with;

find out that the size of data types is something you have to worry about (sometimes);

implement some function pointers to understand the under the hoods of callbacks;

dive deeper into generic programming;

use and understand iterators, implement containers supporting various categories of iterators;


Our Recent Coment