< :the previous in number
^ :the list in numerical order
> :the next in number
P :the previous (in thread)
N :the next artilce (have the same parent)
|<:the top of this thread
>|:the next thread
^ :the parent (reply-to)
_:the child (an article replying to this)
>:the elder article having the same parent
<:the youger article having the same parent
---:split window and show thread lists
| :split window (vertically) and show thread lists
~ :close the thread frame
.:the index
..:the index of indices
On 7/15/06, transfire / gmail.com <transfire / gmail.com> wrote:
> Jan Molic recently contacted me about a slighlty modified version of
> his OrderedHash class that I distribute in Facets, the Dictionary
> class. There are a few variations of this class initself and Jan
> originally provided these via a subclass. I, on the other, thought
> alternate initializers would be better.
>
> Which is the best approach?
>
> Ex.
>
> class AutoOrderHash < OrderedHash
>
> def new(*args)
> super(*args){ |h,k| h[k] = self.class.new }
> end
>
> end
>
> vs.
>
> class OrderHash
>
> def self.auto(*args)
> new(*args){ |h,k| h[k] = self.class.new }
> end
>
> end
>
> Thanks,
> T.
>
I generally find it easier to remember what general kind of thing I
want (i.e. class) than what specific subtype of thing I want
(alternative initializer). For example, the Date class has a whole
load of alternative initializers which I usually have to look up. I
find it easier to wrap those in specific classes.
Using different classes, you have two pieces of information to correlate:
a) class name
b) signature of initializer
Using alternative initializers, you have three:
a) class name
b) method name of alternative initializer
c) alternative initializer signature
Just my tuppence worth.
Regards,
Sean