On Naming
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.
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.
6 Comments:
Nice recommendation.
thanks
Michele
By sys.out, at 4/24/2009 2:24 a.m.
You're welcome, Michele!
By Jonathan, at 4/24/2009 5:51 p.m.
Beck and Cunningham say "searching for just the right words is a valuable use of time while designing". Amen!
By Jonathan, at 4/25/2009 1:17 p.m.
Another good guide: http://journal.stuffwithstuff.com/2009/06/05/naming-things-in-code/
By Jonathan, at 6/06/2009 5:07 p.m.
Thanks John! I'll check it out.
I 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
By David Gelbart, at 6/07/2009 11:23 a.m.
Thanks, David—Hacknot looks interesting
By Jonathan, at 6/07/2009 1:13 p.m.
Post a Comment
<< Home