[Cosmo-dev] Commit 5847

Bobby Rullo br at osafoundation.org
Fri Oct 5 16:58:47 PDT 2007


+1, +1, +1

Descriptive variable names are A Good Thing (tm)


On Oct 5, 2007, at 3:24 PM, Travis Vachon wrote:

> Hi folks
>
> We found a serious regression (bug 10978) today that was introduced  
> in commit 5847. I'd like to take this opportunity to make a few  
> requests regarding code style:
>
> 1) Please try to avoid refactoring longer descriptive variable  
> names into terse, difficult to read variable names. Code is more  
> often read than written and terse variable names make reading code  
> much harder. In addition, since there is a significant dearth of  
> good re-factoring tools for Javascript the method I (and others)  
> use most often is good old emacs incremental search. Variables like  
> "ev" and "reg" make this process much more tedious and sometimes  
> downright impossible. This particular commit included one change  
> from ev -> item which was an improvement, but also a change from  
> eventRegistry -> reg, a significant decrease in readability and  
> regex-ability.
>
> 2) As much as possible, please avoid combining re-factoring and  
> functionality changes in one commit. Doing this obfuscates the  
> actual changes, and this particular bug was a textbook example of  
> why this is a bad idea.
>
> 3) In bug fix releases I think it would be a good policy to avoid  
> any and all re-factoring unless it is necessary for a bug fix. This  
> will help us avoid silly mistakes like the one that caused this bug.
>
> I've checked in a fix for 10978 in 5874. This bug was hidden a  
> little because "ev" also happened to be a variable in global scope,  
> so I've also included a change that will help avoid this in the  
> future.
>
> Thank you!
>
> -Travis
> _______________________________________________
> cosmo-dev mailing list
> cosmo-dev at lists.osafoundation.org
> http://lists.osafoundation.org/mailman/listinfo/cosmo-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osafoundation.org/pipermail/cosmo-dev/attachments/20071005/d37976e0/attachment.htm


More information about the cosmo-dev mailing list