User Program Communication

Commenting in Ruby

Commenting is used to write text within the code that is ignored by the compiler.


Syntax
#single line comment

=begin
Multi line comment
This is all
ignored by the compiler
=end

Notes

Can be used for documentation, code descriptons, resource inclusion, readability, debugging, and any other note that the programmer would like to include.


Example
#This code is written by Anthony

puts "I think I am cool"

 =begin
The code below outputs the string:
'Because I am!'
=end

puts "Because I am!"

Add to Slack

< User Input   |   Read from Text File >

© 2018 SyntaxDB. All Rights Reserved.