Programming Tutorials Browser Tutorials Articles Struts Tutorials Hibernate Tutorials

  Tutorial: Java: Names

Names should be meaningful and follow conventions

Tutorial Details:

Source code is read by the compiler, which doesn't care about your writing style, and people, who care enormously about the readability of your code. To be readable, the names should be meaningful and they should follow the Java conventions for capitalization and use of the underscore.

Meaningful names
Variables, methods, classes, etc must be given names that mean something to the reader (temperature, velocity, ...). Avoid names like a, b, and c unless they are truly without special meaning.

I worked with someone who claimed he couldn't think of meaningful variable names, so used v1, v2, v3, ... He was quite smart, but his programs were a nightmare to read. Fortunately, he soon moved into management.


 

Rate Tutorial:
http://www.roseindia.net/java/java-tips/principles_and_practices/style/names.shtml

Read Tutorial at: Click here to view the tutorial

Rate Tutorial:
Java: Names

View Tutorial:
Java: Names

Related Tutorials:

Site navigation
 

 

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2006. All rights reserved.