Good naming is the key to good design. Here is the best discussion of naming (in programming) that I have ever come across. It comes from a 1996 book called Smalltalk With Style. The authors have generously made their book
freely available.
It takes a while to download, so here are the good bits (20 images). I'm a fan of Guideline 11: "Use predicate clauses or adjectives for Boolean objects or states". For example, motorRunning is a great name for a boolean field.
Nice recommendation.
ReplyDeletethanks
Michele
You're welcome, Michele!
ReplyDeleteBeck and Cunningham say "searching for just the right words is a valuable use of time while designing". Amen!
ReplyDeleteAnother good guide: http://journal.stuffwithstuff.com/2009/06/05/naming-things-in-code/
ReplyDeleteThanks John! I'll check it out.
ReplyDeleteI also like the "Naming Classes" chapter starting on p.178 of the Hacknot book. You can download the free PDF version here
http://www.lulu.com/content/517813
Thanks, David—Hacknot looks interesting
ReplyDelete