Software Engineering discussion

17 views
Code Complete > The Power of Variable Names

Comments Showing 1-3 of 3 (3 new)    post a comment »
dateUp arrow    newest »

message 1: by [deleted user] (new)

everythingYouCouldPossiblyWantToKnowAboutNamingVariablesAndThenSome.


message 2: by Aleksander (new)

Aleksander Shtuk | 84 comments What I really like about this book the most is every chapter having a checklist at the end. I can improve my coding habits just by going through the checklist and making certain that I didn’t miss applying some good ideas that I found in this book to my code. This chapter covers the area that requires a great improvement from me. I understand the benefits of using good variable names, but I noticed that short expressions created using short variable names are easier to read than long expressions created with good variable names, especially if a short expression reminds of well known equation. Sometimes it’s other way around. Sometimes it’s not a variable naming problem at all and there is a totally different solution. It’s not always easy to say which way is better unless somebody else reads a code and replies with honest opinion or code review is a part of the development process.


message 3: by Erik (new)

Erik | 165 comments I don't like using i, j, and k are loop index names. I think it's important to recognize them as others will use them.

The same is true about the "standard prefixes". I can think of 4+ different "standard prefixes" for class member data. It's good to know about what you might encounter (and to be able to recognize it).

In practice, I think being consistant is as important as any standard naming convention.


back to top