|Keep It Simple, Stupid|
Re: Re^3: RFC: Class::Proxy::MethodChainby sauoq (Abbot)
|on Feb 24, 2003 at 22:15 UTC||Need Help??|
That's precisely my point. I'd rather not have to look carefully. Looking carefully should be required by tricky algorithms and obsfucations, not by a series of method calls.
Correct, except for the "some" bit.
I don't see that as a high goal. Typing is easy to begin with, and we can avoid most repetition in it by learning to drive our editors more expertly. Besides, it is much more important that code be easy to read than be easy to write. I agree, of course, that what is easy and what isn't mostly boils down to a matter of personal preference.
I'm not so sure that personal preference alone should govern this case, though. I think this is kludgey at best, and I think I'm being pretty objective about that. You have written a class that does nothing but provide syntactical sugar. It doesn't do so transparently. In some cases it even seems to encourage mixing method calls from two different classes. Also, though unlikely to be a problem in most cases, the code is far from efficient.
My sense of Once And Only Once nearly caused me seizures.
I think this was a false application of that principle. How many times you type a variable name is irrelevant. If you find that your code is performing the same tasks repeatedly, in different places, then the principle applies. In that case, you consolidate the duplicated code and limit the number of pathways thereby reducing the chance for error. Your module actually increases the number of potential pathways through the code. For instance, someone might access a method through your proxy module or directly.
If this is really an attempt to address something that bothers you with Gtk in particular, then maybe you should limit your module to being an auxillary module specifically for use with Gtk. That way, you could get around method name collisions through documentation. The inefficiency issue would probably never matter. And it would encourage the method chaining idiom in the very area you wished to see it. If it really caught on, maybe the Gtk authors would add support for it.
-sauoq "My two cents aren't worth a dime.";