-
OOP question
hello,
Is it bad form to have a class's constructor function call one of its methods (to handle some of the initialization). It seems to work ok, and i've never seen any documentation saying not to do it. Any thoughts?
thanks!
-
Senior Member
I don't consider it bad form.
-
glad to hear that. its definitely convenient, it just seemed dangerous using an object's methods before its completely instatiated.
-
Senior Member
Since you created the object, you know what those methods do, and what instance variables and methods they rely on. It's your responsibility to use only those methods which are safe to use. My two cents.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|