"Kent Boogaart" <ke****@internode.on.net> wrote in message
news:%2******************@tk2msftngp13.phx.gbl...
And it's bad practice to do any substantial work in your constructor. It's
nasty to have constructors throw exceptions too. I would recommend just
*constructing* in your constructor and putting the meaty work into a
separate method.
It is not bad practice!
IMHO when designing anything invariants are your greatest aid to
understanding and bug free code and constructors that don't do all the work
drastically reduce the number of invariants in your class and typically
increase the number of states from 2 (initialized,disposed) to 3
(+uninitialized) [Unfortunately you cannot reduce it to just 1 state as you
can with C++]
Furthermore do you propose that the init method should throw an exception?
In which case what have you gained?