On 26 April 2010 12:02, Ovid <[email protected]> wrote:
> ----- Original Message ----
>> From: Dermot <[email protected]>
>
>
>> Why wouldn't you, as you write, use the the fastest access methods
>> available? Surely you'd want to develop habits that will a) provide
>> better performance and b) as mentioned below avoid the thorny
>> side-effects of req->params(). This isn't a matter of premature
>> optimisation but simply establishing good practise.
> Because if you are working with, say, 10 people on a team, and you will have
> everyone merrily doing direct hash accesses, sooner or later, someone's going
> to fuck it up and something will break in a spectacular > fashion.
I take your point even though I am not in a team.
> This is a very common trap that many developers (even experienced ones) get
> caught up in. Let's make *everything* faster and our app is faster. A month
> of optimisation could easily result in no benefits because what developers
> think is slow rarely matches what *is* slow unless the developers have
> carefully profiled their application.
>
> The problem, as has been pointed out, is that ENCAPSULATION is so terribly,
> terribly important -- and almost always more important that
> micro-optimisation -- that throwing away the known, constant benefits of
> encapsulation for unknown, occasional benefits of micro-optimisation would be
> a very, very bad idea for the community in general. It might be OK for you,
> but it's not OK for me. Without encapsulation, it's much harder to trust the
> correctness of my app.
I don't want to break encapsulation and that was the point of the
question. Toby mentioned req->params->{} and that will be the method
I'll stick with. I simply want to try and use the methods that will
provide the most dividends and for that to become habitual.
Thanx,
Dp.
_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/