From: Gavin Sinclair Date: 2002-08-08T20:45:37+09:00 Subject: Re: Named paramters again > On Thu, 08 Aug 2002 12:19:10 +0200, Gavin Sinclair wrote: > >> Sorry if I'm being closed-minded, but why is "insertElement" >> preferable to "insert", and why is "f:arg1 arg2" preferable to >> "f(arg1, arg2)"? > > insertElement:at: is self-documenting; that is, just by looking at the > method name I can more or less know what the method does and what kind > of argument it takes. In Objective-C, this is a big pro when it comes > to dealing with complex libraries such as WebObjects or Enterprise > Objects, because you don't have to constantly browse the documentation > just to understand what a piece of code does. I was a WebObjects > developer for 2 years and I *know* that Objective-C's method-naming > notation is "A Good Thing". The downside is that you can end up with > rather long method names. Hmm... interesting. I wouldn't mind playing with some of this good stuff. > Where does "f:arg1 arg2" come from? This is not what I proposed. > If you want named parameters with a syntax like f(arg1, arg2) you > end up with Python's solution or something like it, and I don't > find it particularly attractive. I was simplifying by removing the element names. Translating from your example to my synopsis: "element" -> arg1; at:5 -> arg2. Doesn't matter anymore; we understand each other. > Actually, what I'm proposing is *not* the introducion of named > parameters, but rather a different method naming convention having the > side effect of emulating named parameters (maybe my English is betraying > me here, please forgive me :-) No, you're quite clear. It's your computer language background that betrays you, just like mine betrays me. Viva la BASIC! (kidding) > -- > ste Gavin