Compiling code when changing only comments

Do you compile your code before passing it to the repository, even when you change only a few comments? I know that comments are usually ignored by compilers, but I often do this out of habit.

+7
comments compilation
source share
8 answers

It is good practice to compile the code every time before committing. Sometimes you accidentally edit something other than comments, and thereby violate the code. Compilation is usually very fast and helps to avoid unnecessary pain. This is why I try to compile every time before commit.

+12
source share

I always compile before committing; the working assembly must always match the working source code . In practice, you do not need to need it if you just change the comments. But how often are comments the only thing you would change?

Remember that in .NET you can add XML comments that the compiler can read to create compilation documentation. Obviously, when changing these types of comments, compilation must be done.

+2
source share

I migrate to git and then push my changes to the svn server that everyone else uses, so I have a script that automatically rebuilds and runs the tests and clicks on svn if everything goes well

+1
source share

I see why someone might not want to go through the compilation cycle if it takes five minutes. But if this happens, you may be able to collect all your changes into a single compilation / commit operation.

+1
source share

Each commitment must create a core line on the integration machine.

+1
source share

eg. in .Net, you can ruin the XML comments and check for an unnecessary compiler warning if you are careless. Therefore, it is recommended to compile your code every time before committing (as well as to run your tests before committing).

+1
source share

And any half of a decent compiler will take almost zero time to recompile the code when only the comments have changed. In the first parser session, it should be noted that no functions have changed or stopped.

+1
source share

From personal experience, an overworked brain tends to fit not only into comments, but also not to notice it. Most likely, it is better to compile it, even if it takes some time. They will save others a headache and protect your authority.

+1
source share

All Articles