These comments work from where they start, up to the end of the line. They are started using two forward slash characters.
// this is a single line comment
// and example of comments
// where to draw
// the size
// lets centre it
a = 5 // comments can appear after a statement
Using '/*' and '*/' to start and end these comments, they will span multiple lines. You can also insert them into the middle of a statement.
/* This is a
num = /* and can appear inside a statement */ 0
They are useful as an alternative to writing multiple-single line comments.
If you start a multi-line comment with two stars, '/**', then it will be a documentation comment.
* A simple Sprite class,
* to help show off the useful-ness
* of documentation comments.
* Increments the location by the values given.
def move( x, y )
// do something
They are useful for being a more formal version of a multi-line comment, and are typically used above variables, methods and classes.
Comments in Quby are 'counted' or 'nested'. This means you can place a comment inside of a comment. For example:
* A nested comment
* another nested comment
* with more nesting
This is useful as it allows you to comment out large blocks of code, without having to worry about any comments getting caught inside it, and messing this up.