in reply to Re^4: A different OO approach
in thread A different OO approach
I very much agree with "once and only once", my origins as a programmer were steeped in Asm and C. I realized quickly how it sucked cutting and pasting code (or making changes), then hunting down all the errors I cut and pasted. But on the other hand, I do a lot of CGI and including a dozen odd modules (and there includes) can quickly kill response time. (mod_perl isn't always an option.)
I'm not advocating people not use modules, but for myself, when it is something like this, were it amounts to a a few lines of code, I tend to keep it in a snippet file and cut and paste it into the source. In the simplest form..
And yes I was confusing you with the poster, my bad.
-Lee
"To be civilized is to deny one's nature."
I'm not advocating people not use modules, but for myself, when it is something like this, were it amounts to a a few lines of code, I tend to keep it in a snippet file and cut and paste it into the source. In the simplest form..
seems extreme for a module. On the other hand, if your attributes are more complex it could easily become worthy of using a module.sub add { my ($self,$name,$value) = @_; return if $name !~/^\w+$/; my $pack = ref $self; no strict 'refs'; *{$pack.'::'.$name} = sub : lvalue { $Attrs{+shift}->{$name} }; }
And yes I was confusing you with the poster, my bad.
-Lee
"To be civilized is to deny one's nature."
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^6: A different OO approach
by adrianh (Chancellor) on Dec 15, 2002 at 23:08 UTC | |
by Aristotle (Chancellor) on Dec 16, 2002 at 00:45 UTC |
In Section
Meditations