Ask Everyone: Where’s your Constructor? April 11, 2008Posted by Brent in computers.
Tags: code, programming, style
1 comment so far
Where do you prefer to put your object’s constructor in relation to the file’s line numbers?
Near the top? Before or after the member object declarations?
I prefer to keep them near the top, preferably after the private member declarations. It’s not a hard or fast rule for me, but I dislike it when the constructor(s) is/off mingling with other methods in the middle of the class.