User "Raindrift" posted a comment on MediaWiki.r93137.
Full URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93137#c20213
Commit summary:
Added a workaround for the lack of RequestContext in 1.17, so this code can be
rolled into production.
This code can be removed in 1.18+, but it'll work either way.
Comment:
I used to write a lot of Perl with deeply-nested map {} sort {} grep {} map {}
@array; things. I thought it was very clever. Then, I realized my code was
hard to read a year later. Lately, I just use intermediate containers since
that's what's happening internally anyway. Along similar lines, I'm pretty shy
about the ternary operator unless what's going on is just blindingly obvious.
I'm not too concerned about having a similar line in there twice. My usual
test is that if I'm duplicating more than 2-3 lines of code, it's time to break
it out. If I used the User object in two places, for example, I'd have stored
it and moved the new UploadStash() outside the block.
My current style is probably influenced by my switch to a modern editor with
block folding, and access to large monitors. I understand that people using
other tools might be more concerned about the use of vertical space. So, if
that's you, apologies.
_______________________________________________
MediaWiki-CodeReview mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview