|
Re: A Question of Style: msg#00167lang.smalltalk.squeak.beginners
On Fri, 30 Mar 2007 18:22:22 +0200, Tim Johnson wrote: Hi, I've seen the suggestions in other responses to this and I don't like them. Calling "everything" a setter/getter seems to be J-zeitgeist but, what you have here is a collection of prices, indexed by a symbolic key, rooted at instances of Vendor. Translated to Smalltalk language this is a variant of #at:put: Vendor>>priceAt: aSymbol put: newPrice Even more Smalltalk-ish, you'd have aVendor pricebook at: aSymbol put: newPrice People with an education in Smalltalk will immediately understand what's happening when seeing a piece of your code which sends #priceAt:put:, even in the absence of class comments :) /Klaus Does this follow traditional patterns? I'll admit I have read the first
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: A Question of Style, Blake |
|---|---|
| Next by Date: | Re: Re: A Question of Style, Ralph Johnson |
| Previous by Thread: | Re: A Question of Style, Blake |
| Next by Thread: | Re: Re: A Question of Style, Ralph Johnson |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |