On 22 Jun 2008, at 18:56, Aristotle Pagaltzis wrote:

* Jonathan Rockway <[EMAIL PROTECTED]> [2008-06-22 15:35]:
* On Fri, Jun 20 2008, Aristotle Pagaltzis wrote:
That’s even uglier. Imagine there isn’t just `hello` but half
a dozen other methods all sharing the same setup. So the setup
code is one or two screens down the source file. Now when you
look at `hello` you have absolutely no indication whatsoever
that there might be other code running before it.

I guess. But this is Perl, there's never any indication of
anything. There's no indication that my function is receiving
arguments of a particular type.

Except, y’know, the code in the method body that’s *right there*.

There's no indication that my function throws exceptions.

I hope you’re not using exceptions for standard control flow.

There's no indication that "use Foo" has side effects.

Yes, and that causes no end of intermittent trouble. Ovid had
some recent posts on use.perl about getting bitten hard.

Even in Catalyst, there is a ton of implicit behavior. There is
no indication that begin/end/auto applies to my action (at
least until the action runs).

Except, method modifiers are explicit, not implicit – just
defined at a distance, the way you wrote it. In contrast, if you
use Catalyst you know that there may always be begin/end/auto
actions.

I mean, if you have to write out your intent to modify a method
anyway, why not also put that next to the code that will actually
be affected?

I recommend Schwern’s recent “Skimmable Code” talk.

Note well, I’m not arguing against method modifiers in general.

Regards,

FWIW I also think that the method modifiers makes it harder to skim the code, since most of the time you find the end action then look up the chain to see what is happening (at least I do) - method modifiers make this a much harder thing to find.

-ash


_______________________________________________
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/

Reply via email to