Blog about sport, ambitions, movies, cs, and everything I care about. 

The way you learn c++

Lately, I had to move my python code to c++, which I could not really say that I know. I remembered all this int main and using namespace std; but how I would compile all this without the help of IDE I didn’t know. And this is the general problem of c++ and what makes people be intimidated not just to program in this particular language but to program in general: it requires so much effort just to get started so that many decide that programming is not worth it. Indeed, why on Earth I must know what parameters should I have for compilation from the very beginning if just want to print something? And why the program should be so complicated when I want to print something: probably spoiled by python style, it’s hard to believe that I should include a library for that. And what the hell all this * and & mean? As a response on stackoverflow I got this: “but you could either pass the pointer around or dereference the pointer and pass it by reference.” – for a novice it sounds more like a spell than a helpful answer. I guess there is no good excuse for existence of all these questions except that later it pays off with greater efficiency. 

So the way that worked for me was not getting all the answers that I had about c++, its syntax, compilation, design, etc. – but to skip them altogether and just to copy parts of the code from other places (like stackoverflow or github) and place them side by side. It’s not learning by doing or learning by reading – it’s learning by copying. If the code works, you can experiment with it and learn a little bit about the language (like when you realize that ampersand allows you to change an argument). But if it does not then don’t even bother what other people have written for you. 

Comments
c++pythoncodingcs
comments powered by Disqus