|There's more than one way to do things|
Re^5: Mutator chaining considered harmfulby eric256 (Parson)
|on Dec 30, 2004 at 19:44 UTC||Need Help??|
You missed one giant and important point. If you are familar with the style then its not more difficult to decipher.
Is no more difficult to read than:
My point all along has been that it is only hard to read if you aren't used to the style. Map, grep and sort used to be nearly impossible for me to read because that wasn't a style I had encountered before. Now I understand and recognize those patterns. If I know that the mutators return the object in order to allow chaining then that code is easy to follow. If I don't know that then a quick check to the POD makes it clear in an instant.
The first requires a lot more effort to decipher than the 2nd.
That is only true for those who arn't used to it, or don't use it. It is not true for everyone, it is not an absolute that one is harder or easier to read. Like I said originaly, method chaining (mutators or otherwise) has always made perfect sense to me, maybe it's the way I think or experiences I've had. Either way, arguments that it's bad because it's hard to decipher, read, trace, etc, are all false because it is just a matter of the readers perception/experience.
Frankly, I' amused you think that's condescending because I think it's condescending to assume that because some people can't read it that it should be considered harmfull by everyone.