|
From: Will D. <wi...@wj...> - 2005-09-29 02:46:54
|
I'm all for aesthetics. But I disagree that msot objects are created "nameless". In Tk, every widget has an explicit name. And in my applications there are often quite a few singleton objects defined with well-known names. I agree that there's a need to be able to create nameless objects; and for some classes, nameless objects might be all you need. But there's also a substantial need to created named objects, and oo:: needs to support it. (As it does in the current proposal.) I'd argue that because of Tk there's also a need for unique names based on a pattern of some kind...but it's begin to appear that I've already lost that argument. Oh, well. WIll On Sep 28, 2005, at 5:47 AM, Kristoffer Lawson wrote: > > On 28 Sep 2005, at 12:27, Donal K. Fellows wrote: > > > >> Kristoffer Lawson wrote: >> >> >> >>> I think this could be a case of pure aesthetics. I don't like =20 >>> the idea of giving "" to do that. It just looks ugly. In fact, I =20= >>> find that naming objects myself is the rare case. When passed =20 >>> around they get put in variables anyway, so why not do it right =20 >>> from the start and not bother about naming. >>> >>> >>> >> >> The last time I did an OO system (last conference) I had it so that >> objects were always created "nameless" (i.e., with automatic =20 >> names) and >> it was up to the constructor to rename them if it wanted to. The idea >> was that it's usually particular classes of objects that need to be >> named, and often enough the names are really constrained by external >> factors. Making people name everything is a good way of =20 >> encouraging the >> creation of subtle and annoying bugs (hands up if you've ever =20 >> created a >> photo image called "open" and wondered why your program stopped =20 >> working? >> :-/ ) >> >> > > This sounds like a reasonable approach. There is rarely need to =20 > give specific names to objects and, as you put it, it can cause =20 > more problems than it's worth. I think we'd be quite fine with only =20= > providing auto-naming. > > > >> "Looks ugly" is an argument about the =E6sthetics of code, and that's >> entirely relevant; writing code is hard enough without it also =20 >> being an >> experience in being dragged through ugliness. :-) >> >> > > Agreed :-) > > / http://www.fishpool.com/~setok/ > > > ------------------------------------------------------------- will -at- wjduquette.com | Catch our weblog, http://foothills.wjduquette.com | The View from the Foothills |