DEV Community

Cisco Vlahakis
Cisco Vlahakis

Posted on

Fastest method for multi-line commenting in Ruby

In Javascript, I was used to multi-line commenting like this:

/* */
Enter fullscreen mode Exit fullscreen mode

It was fast, easy, and simple. I tried doing the same thing in Ruby! Alas, that did not work. Although single line commenting is fine:

#
Enter fullscreen mode Exit fullscreen mode

I did not know how to multi-line comment. Lo and behold, it was more complicated than in Javascript:

=begin
This is a 
multi-line comment in Ruby
=end
Enter fullscreen mode Exit fullscreen mode

Fortunately, I learned that simply doing

Cmd + /

was a much faster way to multi-line comment, which incidentally, is the same shortcut used to multi-line comment in JS!

Top comments (1)

Collapse
 
bibimbop123 profile image
Brian Kim

found this post insightful! thanks Cisco!