B
Brian Candler
So, I wanted to ask all of you, what would your answer be to the question
I'm not sure that's such a good advertisement: it still seems very hackish
to me to do that. Singleton methods on an object, now that's something else:
you can enhance the object, without affecting the entire class String.
I've been trying to maintain someone else's Perl code over the last few
days, and although it was written using OO features, making changes has had
me pulling my hair out. For example, when I want to define another class, I
am *forced* to put it in a separate file, with about a screenful of module
declarations at the top; and then stick $self-> in front of every method
call, and dereference pointers all over the place. Yuk - might as well have
been writing in C.
When people ask me about Ruby, I say Ruby is like Perl without the crap. You
can typically write working code in Ruby which is a quarter of the size of
the equivalent Perl, and much easier to understand and maintain. It's a
rapid application development tool for real applications, rather than just
temporary hacks, and yet it doesn't stop you writing quick hacks either.
Then, if they're a Perl hacker, some them some code. They'll be drooling in
minutes...
Regards,
Brian.
Ruby allows to you enhance the builtin string class with you own methods,
which you can invoke "im a string".own_method
I'm not sure that's such a good advertisement: it still seems very hackish
to me to do that. Singleton methods on an object, now that's something else:
you can enhance the object, without affecting the entire class String.
I've been trying to maintain someone else's Perl code over the last few
days, and although it was written using OO features, making changes has had
me pulling my hair out. For example, when I want to define another class, I
am *forced* to put it in a separate file, with about a screenful of module
declarations at the top; and then stick $self-> in front of every method
call, and dereference pointers all over the place. Yuk - might as well have
been writing in C.
When people ask me about Ruby, I say Ruby is like Perl without the crap. You
can typically write working code in Ruby which is a quarter of the size of
the equivalent Perl, and much easier to understand and maintain. It's a
rapid application development tool for real applications, rather than just
temporary hacks, and yet it doesn't stop you writing quick hacks either.
Then, if they're a Perl hacker, some them some code. They'll be drooling in
minutes...
Regards,
Brian.