jump to navigation

Ask Everyone: Where’s your Constructor? April 11, 2008

Posted by Brent in computers.
Tags: , ,
trackback

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.

Comments»

1. Derek - April 11, 2008

Always at the top. It really doesn’t make much sense to put it elsewhere.

Of course, if this is not production code (still in development), then it can go anywhere it pleases. ;-)