I Know It’s Like Training Wheels, But….

I know this is just a simple trick that marks me as a beginner, but I like to add a comment at the end of a block to indicate what block of code is ending.

Java:

          }  // if button displayed
      }catch (NoSuchElementException e){
          buttonState = "not present";
      }  // try/catch
		
      return buttonState;
   }  // check button
}  //class

Ruby:

    end # until
  end # wait for browser

end # class end

Sure, an IDE will show me, sometimes faintly, what block a bracket closes, but I prefer this clearer indication which is easier to see.

2 Responses to “I Know It’s Like Training Wheels, But….”

  1. Isarian Says:

    I started doing this in college, and any time I do any coding (which isn’t frequently, mind) I always do this, and it saves me so much pain.

  2. The Director Says:

    Then it’s official, then. We shall call this The Wisconsin Way.


wordpress visitors