in reply to Re^5: Moose: I want builder method to run every time I call an attribute (rehash)
in thread Moose: I want builder method to run every time I call an attribute
This is golden.
My first thought when I saw the question was, "Has Moose made use forget how to write a method? It generally starts with some variation on, 'sub methodname { my $self = shift; ... }'."
A famous aphorism of David Wheeler goes: "All problems in computer science can be solved by another level of indirection"; this is often deliberately mis-quoted with "abstraction layer" substituted for "level of indirection". Kevlin Henney's corollary to this is, "...except for the problem of too many layers of indirection."
Humorous Internet memorandum RFC 1925 insists that:
- (6) It is easier to move a problem around (for example, by moving the problem to a different part of the overall network architecture) than it is to solve it.
- (6a) (corollary). It is always possible to add another level of indirection.
(From http://en.wikipedia.org/wiki/Indirection.)
All these layers of abstraction can become a shell game. Eventually someone's got to actually write some code. Spaghetti code can be written without ever using goto. ;)
Dave
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^7: Moose: I want builder method to run every time I call an attribute (rehash)
by BrowserUk (Patriarch) on Sep 27, 2013 at 06:34 UTC |