Changes

Jump to: navigation, search

Commenting Ruby Code

1 byte added, 21:04, 30 November 2007
no edit summary
Commenting code is a little like going to the dentist. We don't really want to have to do it but deep down we know it is a good thing to do. No matter how well written and self-explanatory your Ruby script it is still good practice to add comments. There a number of reasons for doing this. Firstly, it is possible that someone else may one day have to modify or fix bugs in your code. Good comments will help those who are new to your code to understand what it does. Secondly, now matter how well you understand your Ruby scripts now, I can assure you that in 6 months time you will look at the code and wonder how it all fits together (trust me, I've been programming for a long time and sometimes return to something I developed years ago and cannot believe I even wrote it!).
Comments are also useful for blocking out lines of code that you no longer wish to run (typically something that is done when trying to debug problems in complex scriptsprograms).
== What is Exactly is Commenting ==

Navigation menu