|Perl Monk, Perl Meditation|
Re: Immutabillity and scope and temporary objectsby Xiong (Hermit)
|on Feb 27, 2010 at 20:51 UTC||Need Help??|
-- Blog post; wankerish:
I see that and start to lose interest in anything that follows. This is a One True rant (in this case, supporting functional programming) and I immediately discount by half anything else the author has got to say.
One True people are slaves to their One True Thing, be it the One True God, the One True Politico-Socioeconomic Model, or the One True Programming Paradigm.
This raises my absolutism flag. Compared to the average postmodern deconstructuralist, I'm a pretty absolute guy; but I still say the solution has to fit the exercise, not the reverse.
There are no absolute rules in programming; there is no One True Paradigm.
That said, there is much merit in splitting work into scopes. I agree that some data is per-request and should be stored in a temporary object. Assuming you're running a persistent environment like mod_perl, then yes, there will be considerable data that never changes and might as well be stored in an immutable object.
But then, I say there may be plenty of data that changes slowly and yet needs to be stored: per-session data, perhaps. A mutable object is reasonable here. Just don't get sucked into the One True trap.