Don’t reinvent the wheel, don’t believe in magic (C++ programming language, Stroustrup)

I decided that I would read regularly classic programming books. I need to learn and if I need to learn, why do I not learn from the greatest programmers of all time? I want to know him better and I want to master myself with their knowledges. Actually, the idea of the classic programming books comes from this site (and likely I will use the other ideas too, soon or later).

My first choice is the C++ Programming Language: Special Edition, I learnt C++ at the university but I never read the book. It is pretty long, 800 pages or so (without appendices), I started to read it yesterday and it will take at least months. I always surprised how complex the C++ is and I want to enjoy the beauty of the complexity and the benefit of the new knowledges.

I hope you, gentle reader, like these random quizes and riddles as much as I do. Now it is the best way to express what I’ve learnt today, because C++ is so mysterious.

Image

Quiz one: In which chapter of the book “C++ programming language” is the image, that is similar to my sketchy drawing?

Quiz two: Read the question and select the correct answer.

Why there is no virtual constructor in C++?

  1. The constructor can not be virtual because at the time, when constructor is invoked, the virtual table would not be available in the memory.
  2. The constructor of the derived class overrides the constructor of the base class, so a normal constructor behaves itself like virtual functions.
  3. “Virtual” allows us to call a function knowing only an interface, and not the exact type of the object. And how do you want to construct a class without its exact type?

That’s enough for today, I go to practice the pronunciation of Stroustrup’s name (and I hope the Strov-stroop is an acceptable approximation).

Advertisements

About vrichard86

I'm Richard and I'm an enthusiastic coder. I want to be better and I think a professional journal is a great self improvement tool. Welcome to my blog, to my hq, to my home on the web!
This entry was posted in C++ and tagged , , , . Bookmark the permalink.