From a3b913fa060ed76d18ac2d4f3abd1a617eee01a0 Mon Sep 17 00:00:00 2001 From: toakes59 <31904863+toakes59@users.noreply.github.com> Date: Sun, 24 Mar 2019 02:32:03 -0400 Subject: [PATCH] Added Line and Block comments (#28922) Added how to use Line and Block comments with an example showing it. --- .../english/cplusplus/clean-code-guidelines/index.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/guide/english/cplusplus/clean-code-guidelines/index.md b/guide/english/cplusplus/clean-code-guidelines/index.md index 987b4b0680..71e8ed0d26 100644 --- a/guide/english/cplusplus/clean-code-guidelines/index.md +++ b/guide/english/cplusplus/clean-code-guidelines/index.md @@ -16,6 +16,17 @@ Make sure you create good variable names, for example, if you are creating a gam Also, PLEASE, use comments, I'm not even kidding, just try to read some old projects you did without comments... now imagine being someone else who didn't even code it. +Comments can be created with either //, line comment, or /* */, block comment. // will comment out anything that follows it on that line, and /* */ will make anything between * * a comments. + +```cpp +#include +using namespace std; + +// This is a line comment +/* This is all contained in +a block comment*/ +``` + ## Global variables Global variables can be easy to use, and with little code it might look like a great solution. But, when the code gets larger and larger, it becomes harder to know when they are being used.