Do you compile your code before committing it to the repository, even when you only change a few comments? I know comments are typically ignored by compilers, but I find myself doing this often out of habit.
The syntax for code comments differs between coding languages. In many languages, two slashes indicate a single line comment: And to include a multi-line comment for when you want to ‘comment out’ code, the syntax is as follows: The above syntax is used by many languages, such as PHP and JavaScript. However, other languages use different syntax.
Each programming language has a different way of commenting in the source code. PHP and HTML and JavaScript and C# all have slightly different symbols that begin and end code. While there are some language-specific practices, too, there are more shared than not.
Code commenting is the practice of sprinkling short, normally single-line notes throughout your code. These notes are called comments. They explain how your program works, and your intentions behind it. Comments don’t have any effect on your program, but they are invaluable for people reading your code.
That when you need source code comments, that’s an indication that your code is weak in some way. That your naming conventions, logic, or something else isn’t as transparent as it should be. And, to be fair, this argument makes a certain amount of sense.
It's good practice to compile the code every time prior to commit. Sometimes you accidentially edit something except the comments and thus break the code. Compiling is usually very quick and helps avoid needless pain. That's why I try to compile every time prior to commit.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With