ariya.io About Talks Articles

Details vs Knowledge

2 min read

Normally we tend to admire those who can spot the small details that others will not even bother to notice. But sometimes it can be a different situation:

A: So to prevent the copy, here I define a copy constructor but I place it in the private section of the class.

B: (after carefully analyzing the implementation line by line) But you don’t implement this copy constructor at all. It’s in your class declaration but I can’t find it in your .cpp file.

A: No need to do that. I don’t want to implement it. I just want

to ensure that it won’t be called because it’s private.

B: (again reading the implementation code) Is there a reason why you won’t implement it?

A: (already slightly upset) No specific reason. You can implement an empty construct for that copy constructor in the .cpp file, if you want.

B: Then you’d better write that empty construct. What’s so difficult about it? It’s better to do that rather than taking the easy way out not to implement the copy constructor.

A: (decides that it is useless to argue) OK.

A ends up being annoyed for the whole day. Not only he wastes his time with this unnecessary hyped drama, he is accused of taking “the easy way out”.

This case could also possibly explains why some untrained eyes file a compliant because you did optimize part X of the program but simply skipped part Y. The same eyes did not watch you as you spent few sleepless nights with the profiler.

♡ this article? Explore more articles and follow me Twitter.

Share this on Twitter Facebook