The tag has no wiki summary.

learn more… | top users | synonyms

-6
votes
4answers
246 views

Why must a constructor's call to the superconstructor be the first call?

It is an error if you do anything in a constructor before calling the superconstructor. I remember that I had problems because of that. Yet, I do not see how this saves us from errors. It could save ...
2
votes
1answer
141 views

How to initialize all your references?

I have recently taken a project with another developer, and he has a certain way of initializing his references. class Player { private: Console &console; Armor &armor1, ...
28
votes
3answers
2k views

Is a “start”, “run” or “execute” method a good practice?

I'm currently working on a code base that has many classes that implement a Start method. This seems like two-phase construction to me, which I had always considered a bad practice. I can't tell the ...
2
votes
6answers
221 views

Should all classes have a default constructor as part of good coding convention

From the texts I have read so far, the conventions talk about organizing constructors, starting with the default, if any. I am wondering, should all classes have a default constructor anyway. This ...