Re: Constructors?
Byron Foster <[email protected]> Thu, 07 Oct 2004 03:03:48 -0700
| Newsgroups | gmane.comp.lang.nice.general |
|---|---|
| Message-ID | <[email protected]> |
Daniel Bonniot wrote: >> There seems to be some discussion surrounding this issue. After >> reading the discussions I think I understand the design decisions >> better. Certainly given the fact that one cannot access member >> variables from within a constructor I guess it wouldn't make much >> since not to call the automatic constructor, or some chain of >> constructors that end with an automatic constructor. Otherwise, >> nothing in the instance changes. I wonder if the Nice constructor >> approach aids in better compilation and object creation performance, >> or if it is strictly language motivated? > > The movitation is to make sure that instances are valid before they > start being used (which is not the case in Java). > > You should find the log of an irc discussion interesting: > http://confer09.condor-edv.com/nice@freenode/2004-09-18.html > It starts at 14:47 (right column), at about the middle of the page. That's interesting, I've also read the discussion about Constructor Syntax in the Wiki. While Java seems to have some holes in its constructor approach, I think C# has fixed these holes, or are there also problems with C#? It's probably the case I've got too much Java/C++ on my brain, so I'm slow to embrace the new approach. I'm so use to accessing instance variables in constructors that it's habit now. I would hate to see in the initializer conditional logic based on the way an instance is being constructed. However, I don't know if the would really be a problem in practice. I think I'll go take a look at past java code I've written and examine the non trivial constructors I've written and investigate the application of a Nice solution. ------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl