Long Names Are Long (2016)
While I certainly think that naming is important, I don&#x27;t quite agree with all the improvements suggested here:<p>&gt; &#x2F;&#x2F; Bad:<p>&gt; List&lt;DateTime&gt; holidayDateList;<p>&gt; Map&lt;Employee, Role&gt; employeeRoleHashMap;<p>&gt; &#x2F;&#x2F; Better:<p>&gt; List&lt;DateTime&gt; holidays;<p>&gt; Map&lt;Employee, Role&gt; employeeRoles;<p>I&#x27;m not sure this is better. Yes, it&#x27;s obvious that both are <i>collections</i>, but it&#x27;s not obvious what you can do with them. Is `holidays` a map of date to information about the holiday? Is `employeeRoles` a set of all possible roles?<p>And once you remember that `employeeRoles` is a map, you&#x27;re still a little lost about how to look into it. Is the key the employee id? Email?<p>Perhaps it could be called employeeToRoleMap? That distinguishes it from employeeIdToRoleMap, or possibleEmployeeRoles.<p>Maybe this is me disagreeing with a later statement by the author:<p>&gt; Some people tend to cram everything they know about something into its name. Remember, the name is an identifier: it points you to where it’s defined. It’s not an exhaustive catalog of everything the reader could want to know about the object. The definition does that. The name just gets them there.<p>I don&#x27;t know if I want to know <i>everything</i>, but I think I lean towards <i>more</i> than the author does. A variable name I changed today was originally called `initial-points`. It designated the set of intermediate points directly from a source to a destination, which would later be offset randomly (example: <a href="https:&#x2F;&#x2F;imgur.com&#x2F;a&#x2F;UxkGPfX" rel="nofollow">https:&#x2F;&#x2F;imgur.com&#x2F;a&#x2F;UxkGPfX</a>).<p>While refactoring related code, I realized that although it was descriptive, it was descriptive _temporally_, rather than describing the identity of the points. I ended up changing it to `points-in-direct-line`. It still feels subpar to me, but at least it&#x27;s clearer: the points exist not because they&#x27;ll be changed later (initial-points), but as a direct line between the source and destination.