[svlug] ACCU on Tuesday 'Giving Code a Good Name' Kevlin Henney
walterv at gbbservices.com
Mon Mar 9 09:39:50 PST 2009
Please note that we're meeting on Tuesday this month.
When: Tuesday, March 10, 2009
Topic: Giving Code a Good Name
Speaker: Kevlin Henney
Time: 6:30pm doors open
7:00pm meeting begins
350 Ellis Street (near E. Middlefield Road)
Mountain View, CA 94043
Directions: VCAFE is accessible from the semicircular courtyard
between Symantec buildings <http://tinyurl.com/2dccgc>
More Info: <http://www.accu-usa.org>
It almost goes without saying that identifiers in code -- the names of variables, functions, classes, packages, etc. -- should be meaningful and clear. Almost. The problem with such advice is that it is not really advice. What exactly do we mean by meaningful? And how do we assess clarity without wandering into the territory of the purely subjective?
Although a good start, there is more to good naming than just steering past the Great Vowel shortages of the past, shunning Hungarian Notation and following the conventions of a programming language's standard library (preferably the language you are using...). In many cases programmers end up following a set of habits that keep them out of trouble, but at the same time prevent them from really understanding the nature of the code they're writing and what they're writing it for. Good naming will not simply label your code nicely; it will change the form of the code and the design decisions you make.
If you find yourself placing "I" before interface names, using "Abstract" in abstract class names, suffixing base-class names with "Base", prefixing class templates with "basic_", prepending "get" and "set" on method names, naming variables after their class, naming test cases after methods in the class under test, then you may want to find out what improvements are possible to your code by adopting a more goal-focused, role-based approach to naming.
Kevlin is an independent consultant and trainer based in the UK. He has developed and delivered training courses, consultancy and software across a number of domains ever since getting involved in professional software development in the late 1980s. Kevlin's consulting company is Curbralan Limited, which he founded in 2000. Its url is <http://www.curbralan.com/> . Kevlin is a regular speaker at conferences, a former contributor to the Boost libraries, and a past and present columnist for various treeware and online magazines, including C++ Report, CUJ and Reg Developer. Kevlin is the coauthor, with Frank Buschmann and Doug Schmidt, of A Pattern Language for Distributed Computing and On Patterns and Pattern Languages, volumes 4 and 5 in Wiley's Pattern-Oriented Software Architecture series.
---- Upcoming ACCU talks -----
Wednesday, April 8, 2008
(Topic to be announced)
The ACCU meets monthly. Meetings are always open to the public and are free of charge. To suggest topics and speakers please email Walter Vannini via walterv at gbbservices.com
More information about the svlug