Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compiling code when only the comments change [closed]

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.

like image 793
jbgo Avatar asked May 25 '10 14:05

jbgo


People also ask

What is the syntax for code comments in different languages?

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.

Do all programming languages have the same way of commenting?

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.

What is code commenting?

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.

Should you add comments to your source 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.


1 Answers

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.

like image 121
sharptooth Avatar answered Nov 23 '22 08:11

sharptooth