The Greatest Challenge in Software Development

... is choosing the right names.

Local variables need names. Instance variables need names. Methods need names, too, as do classes, columns, delegates, events, files, forms, parameters, projects, products, services, styles, tables, and of course – namespaces. Namespaces are nothing but a name! So many names, and so few words to use.

I was thinking about the amount of mental effort I expend in basic programming activities – like picking control structures (foreach versus do-while), or data structures (stacks versus lists), versus the amount of effort I expend to name all the abstractions in the simplest piece of software. Loops and structures are easy – naming requires a great deal of time and thought.

After all these years of thinking about names, I still struggle to pick the perfect name. Naming is a skill I need to improve - because names are important. I can use all the right patterns, have 100% test coverage, exceed every performance requirement, and still feel like I've failed if the names produce a piece of software that looks amorphous carbon:

Bad names kill good software by making the software un-maintainable.

Here are some interesting reads on naming:

I'd like to find more. Know of any others good ones?

posted on Sunday, December 09, 2007 11:38 PM by scott

Comments

Sunday, December 09, 2007 10:17 PM by Christopher Steen

# Link Listing - December 9, 2007

ASP.NET Asp.Net Control For Google Charts [Via: Luke Foust ] Sharepoint Forms based apps with Infopath...
Sunday, December 09, 2007 10:17 PM by Christopher Steen

# Link Listing - December 9, 2007

Link Listing - December 9, 2007
Monday, December 10, 2007 7:26 AM by Jason Haley

# Interesting Finds: December 10, 2007

Monday, December 10, 2007 11:12 AM by Sahil Malik

# re: The Greatest Challenge in Software Development

Whoaa .. where's the fun in that? Names should be cryptic and misleading. That is half the fun!!
Monday, December 10, 2007 3:48 PM by Vear

# re: The Greatest Challenge in Software Development

I use this one.

Design Guidelines for Class Library Developers - http://msdn2.microsoft.com/en-us/library/czefa0ke(vs.71).aspx

Monday, December 10, 2007 10:09 PM by Tarun

# re: The Greatest Challenge in Software Development

I also use Design Guidelines for Class Library Developers.

1. Accroding to me i dont beleive in prefixes like strName or ClsEmployee or objAccount.

I have found that the more closer your identifier names will be to the real world application the more accessible they are.

I would use 'Employee' as class name
and depending on context e.g if i am creating a new employee i would create an object named newEmployee unlike objEmployee.

2. For control naming i prefer suffixes like instead of txtFirstName i write FirstNameText
since for me its easy to remember that a form has a first name field, rest intellisence will take care.

3. Your memory and intellisence can sync better with real names.

4. I hate when people prefix their database objects like tblEmployee or vwWeeklyReport.
i prefer real names or suffixes for help e.g. Employee is better table name
and WeeklyReportView is a better view name. even if you use tools like SQL prompt or SQL Server 2008.

Hope it helps.





Tuesday, December 11, 2007 8:26 AM by Milan Negovan

# re: The Greatest Challenge in Software Development

Naming a kid is even harder. :) This reminds me of an old *** Van *** episode where the kid's middle name turned out to be "Rosebud" which was an acronym for "Robert Oscar Sam Edward Benjamin Ulysses David". This was done to please all the various relatives.
Tuesday, December 11, 2007 4:05 PM by Nick

# re: The Greatest Challenge in Software Development

I struggle with the same issue. I've been known to spend as much as 10-15 minutes thinking of names for important classes. No matter how well-structured the code may actually be, things just don't feel right unless the names are good.
Friday, December 14, 2007 5:44 AM by Kostas

# re: The Greatest Challenge in Software Development

I think everyone should follow the advice given here:

http://mindprod.com/jgloss/unmainnaming.html

Just kidding, but very fun to read anyway
Friday, December 14, 2007 7:05 AM by John

# re: The Greatest Challenge in Software Development

Sorry for the drunken post (I'm drunk).

I've been thinking about this "names" thing. It's the bane of my existence too. I agonise over what to call things.

I just wanted to swing by and tell you that the other day I had a meeting with a customer, and they explained to me that they deleted all the data from Sheet1, then imported data from Blah, then run Query1, then Query17, then Query6667 ("Oh, let me tell you, on that day I just felt like including the number of the beast"), and then deleted the data from Sheet2, and then...

Seriously... that's what happened. Had to have the process explained to me, and this guy had never taken names seriously in his life. The thing that sucked was... I knew exactly what the process was. Didn't make *any* difference to me at all that Sheet1 as TheDataBeforeAggregation and that Sheet2 was TheDataAfterAggreationWithBlah or that Query1 was GetAllTheDataFromWhereeverAndPutItInThePreAggreationTable and that Query17 was AggreateAllTheDataInThePreAggreationTableAndBlah and that...

I told you I'm drunk, huh?

Anyway... I'm starting to lean toward x, y, and z. Stop me if I'm wrong.
Friday, December 14, 2007 7:35 AM by Dooer

# re: The Greatest Challenge in Software Development

Lisp
Change the name or it will disapear
Saturday, December 15, 2007 7:58 AM by JAlexoid

# re: The Greatest Challenge in Software Development

The Greatest Challenge in Software Development.
Is in fact how to remove CODING from software development. Naming conventions is NOT in any way a challenge.
We already practically removed it from the user level, now time to remove it completely from application development level, next is software development and last is systems/OS development.
Saturday, December 15, 2007 11:46 AM by scott

# re: The Greatest Challenge in Software Development

JJ5: no apologies nessecary.

I always liked i, j, k myself.
Monday, December 17, 2007 7:31 PM by gOODiDEA

# [导入]Interesting Finds: 2007.12.11

Other: 中国的web2.0:很好,很强大 ABriefIntroductiontoREST Becomingacredibledeveloper TheGrea...