DEV Community

Calin Baenen
Calin Baenen

Posted on

Why don't we call copy-constructors **reconstruct**ors?

I think it'd be funny if we called copy-constructors (constructors that take a set of data from one object and puts it in another - of the same type) reconstructors, because they are reconstructing the original object.

Top comments (6)

Collapse
 
serkzex profile image
Mujtaba Aldebes

well a joke is a joke,.. buuutttt to be not fun at parties ;)

The word reconstruct refer to it self, ergo rebuild/fix a damage on the object itself without copying it. This proposal would introduce grammar disagreement into the language.

Collapse
 
calinzbaenen profile image
Calin Baenen

Yeah.... buuuuut technically "re" means "again", and even though it's not as simple as root+word=literalTranslation, "reconstruct" literally only means "to construct again", which you are technically doing if you re-construct the object.

But, do you know any root words for "copy" or "duplicate", etc...
Maybe we could just tack that on, instead of "re". \;p

Collapse
 
pgradot profile image
Pierre Gradot • Edited

How would you call move constructors then?

Furthermore, copy constructors don't reconstruct. They construct an object. Aren't you confusing copy constructor and copy assignment operator?

Collapse
 
calinzbaenen profile image
Calin Baenen

Got the same thing on Reddit. Still, move constructors. - They literally love the data.

Collapse
 
jaiprakashv profile image
Jai Prakash Vishwakarma

Good suggestion :)

Collapse
 
ovidiu141 profile image
Ovidiu Miu

Not a bad name..