[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: ANN: MetaTags 1.0

Ben Giddings

9/9/2003 2:00:00 PM

On Monday, September 8, 2003, at 11:59 PM, Dave Thomas wrote:
> Then I could get the effect of literals using:
>
> c = Caml "one hump or two"

Ack. I really don't like this. It is 4 keystrokes away from what
looks like a standard constructor:

c = Caml.new "one hump or two"

The real trouble is that it looks like how constructors are done in
other (IMHO less well designed) languages. So now, instead of
encapsulating everything having to do with a class inside that class,
you also have another (object? kernel?) function that is strongly tied
to that class but is not logically part of it.

I think you can get the other feature you were after using singletons,
in a more standard way.

I just see this being a source of massive confusion, as new users try
to create constructors like "def MyClass(); ... end". It's the same
reason that they always say don't do this in C:

#define begin {
#define end }

int main(int argc, char **argv)
begin
if (argc < 5)
begin
printf("whoa!\n");
end
end

Maybe I'm missing the point of your suggestion Dave, but so far, I'm
not a fan. :)

Ben