aspose file tools*
The moose likes Cattle Drive and the fly likes Formatting question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » This Site » Cattle Drive
Bookmark "Formatting question" Watch "Formatting question" New topic
Author

Formatting question

Norman Leach
Greenhorn

Joined: Jan 05, 2001
Posts: 17
Ok, here's my question.
I have been in the habit from C++ of denoting the ends of my blocks in the following manner:
if {
blah, blah, blah
}//end if
while {
blah, blah, blah
}//end while
in my assignment 1.1 nit-pick, it was felt i had too many comments stating the obvious that made the whole program harder to read.
Now, I'm going to take them out for the purpose of these assignments but to me, comments like that make it easier to debug the code later when i'm trying to make sure all of my blacks have been properly terminated. Anyone have any feelings/comments on this?
Norman
paul wheaton
Trailboss

Joined: Dec 14, 1998
Posts: 20276
    ∞

My thinking is that if you have to put those comments there in order to make your code readable, your method is way too big.
The more comments you add, the more there is to read to figure out what is going on. The more there is to read, the less readable the code is. So the art is to write your program in such a way that it is easy to figure out without comments. If you need comments, don't over do it.


permaculture Wood Burning Stoves 2.0 - 4-DVD set
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Formatting question
 
Similar Threads
Is there a simple way to do JDK 5 enumerations in Hibernate?
Problem sending a string as Http response
Phone Screens: The Impression
Way to Google
CSS Float - how to "turn off" for subsequent content