Software Engineering discussion
      Code Complete
      >
    The Power of Variable Names
    
  
  
					date newest »
						  
						newest »
				
		 newest »
						  
						newest »
				
        message 1:
      by
      
[deleted user]
      
        
          (new)
        
    
    
      Mar 22, 2011 04:38PM
    
    
      everythingYouCouldPossiblyWantToKnowAboutNamingVariablesAndThenSome.
    
  
          reply
          |
      
      flag
    
   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.
      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.
     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.
      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.


