It is good programming practice to provide human readable information about different parts of code - this can be done using comments
Comments are parts of a trading system code that do not get executed when the system is run, and only serve an explanatory purpose. The Tradery language, lke the C++ language from which is derived, supports several types of comments:
// This is a whole
line comment
|
The first type of comment is limited to a single line. Any text after // and up to the end of the line is considered a comment. The comment can appear after on the same line as any statement as seen on the second line.
Another type of comment is delimited by /* or /**, which marks the beginning of the comment and */, which marks the end of the comment. All text between these markers is ignored when running a trading system. These comments can not be nested though - whatever the comment start markers, the comment will end at the first comment end marker.
As noted at the beginning of this chapter, it is a good idea to describe functions names, parameters, and various variables and statements. These comments can save time and avoid mistakes when the code is examined or modified some time after it was first developed, or it is handed over to other developers or users who need to understand what the code does and how it does it.
© 2006-2010 Tradery.com
info@tradery.com