Clarity vs. code reuse/generality

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Tue Jul 7 21:30:07 EDT 2009


En Tue, 07 Jul 2009 09:51:10 -0300, Jean-Michel Pichavant  
<jeanmichel at sequans.com> escribió:
> I've never used sense in that way before, nor I've seen used by others  
> until now. However Kj is right, and my dictionary seems wrong  
> (wordreference.com). I've searched through others dictionaries and find  
> out this is actually applicable to functions. My bad.

Using a common word with its common meaning is important too in order to  
understand the code. It's hard enough for students to grasp the algorithm  
itself, why make it artificially harder by using strange variable names.

Some years ago I had to endure using an in-house framework with names like  
bring_XXX and fix_XXX instead of the usual names get_XXX and set_XXX (that  
was C++, emulating properties; I'm not sure of the actual verbs used,  
perhaps "obtain" and "establish", but certainly not get/set/put). Add some  
undecipherable comments in spanglish, profuse usage of macros that alter  
the lexical appearance of the language, and even reading code was a  
torture.

-- 
Gabriel Genellina




More information about the Python-list mailing list