-- Andreas Möller <[email protected]> wrote
(on Tuesday, 13 November 2012, 04:16 PM +0100):
> > It aggregates listeners and triggers events; it could have been named
> > either way, to be honest. "EventManager" is cumbersome as a variable
> > name, but perfectly fine as a class name.
> 
> I bet there are variables with names that are much longer
> eventManager. With auto-completion, length of class properties or
> variable names shouldn't be an issue.
> 
> A car aggregates passengers as well, but it's still called a car, not
> passengers.
> 
> > Honestly, I've never heard anybody else complain about it.
> 
> This doesn't invalidate my complaint, though.
> 
> > At this
> > point, I'm not about to change all occurrences of it, either. 
> 
> As this naming scheme is consistent throughout the project, I guess it
> doesn't make sense to complain concerning other managers, either?

We often abbreviate ServiceManager to $services (or, in the case of
plugin managers, "$helpers", "$plugins", "$controllers"). If we were to
make the change for the event manager, I'd expect we'd have to rename
them everywhere. This is a pretty substantial refactor for basically
zero gain (it's an implementation detail only), and a whole lot of risk
(miss one location, and an entire test suite or component may no longer
work).

The variable names need only have a semantic meaning; they don't need to
always be completely, explicitly, literally named. Short semantic names
are a reasonable shortcut for readability of the code.

-- 
Matthew Weier O'Phinney
Project Lead            | [email protected]
Zend Framework          | http://framework.zend.com/
PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc

--
List: [email protected]
Info: http://framework.zend.com/archives
Unsubscribe: [email protected]


Reply via email to