Use Full Words for concepts, not codes or abbreviations. This is the fifth in a series of posts on Code Gardening - the practice of making small improvements as you see them while you are working.
Contractions cloud understanding and slow down anyone reading the code. The exception is for extremely well-known abbreviations and contractions such as Xml
and Html
.
Consider this fragment of code:
This code is full of contractions and codes that require deciphering by the reader.
Some of these are relatively easy to work out … rep
must mean repository,
tns
must mean transaction and rslt
might mean result.
But classfctn
is a bit of a mystery. Does that stand for classifiction - a ke word from the method name. And what is a classifiction anyway?
Contrast the code above with this cleaned up version …
No more cryptic codes to decipher - not only is the code much easier to read, we can now see that we’re finding Classifications.
Comments
blog comments powered by Disqus