Locked lesson.
About this lesson
How to comment code and deal with errors.
Exercise files
Download this lesson’s related exercise files.
Comments and Errors.docx58.7 KB Comments and Errors - Solution.docx
58.9 KB
Quick reference
Comments and Errors
In this video we'll look at comments and errors.
When to use
It's always a good idea to comment your code, whenever there is something significant to comment.
Instructions
Ruby comments are created with #
Everything after # will be a comment.
For multi-line comments:
=begin
everthing between these two tags will be commented out
=end
Hints & tips
- # comments
- =begin
- =end
- Error statements are there to help us!
Lesson notes are only available for subscribers.