Table of Contents
Does commented out code affect performance?
As to compiled languages, the answer is no. Comments don’t affect the resulting machine code in any way.
Does commented code affect performance HTML?
3 Answers. It will still increase your page size, but shouldn’t be a problem. Having 10000 lines of commented-out HTML is going to be a problem though, but keeping your comments small, should not increase the page size by too much.
Is it bad to comment your code?
Commenting code is on the generally-recognized list of code smells. But unlike most of the others on the list, comments are not always bad. Generally speaking, you should strive to minimize comments and let the code speak for itself, but it is just as important to include comments when the code cannot.
Does commented code affect performance Python?
Having comments will slow down the startup time, as the scripts will get parsed into an executable form. However, in most cases comments don’t slow down runtime. Additionally in python, you can compile the . py files into .
Does commenting slow down code?
4 Answers. Commenting will not affect the script execution time in normal case. But the number of lines you write in your code affect the parser to read and buffer it considerably.
Are code comments necessary?
It’s completely okay to use comments — it’s even encouraged. Code comments often make everyone’s life easier, including your future-self. Sure, you need to name your classes, methods, variables, and so on mindfully but, there’s only so much context good names can capture.
Does whitespace slow down code?
The extra time you spend pressing the space bar is orders of magnitude more costly than the cost at run time (and neither matter at all). The much more significant cost will come from any any decreased readability that results from leaving out spaces, which can make code harder (for humans) to parse. In a word, no!
Does commented code affect performance Java?
2 Answers. No, not in Java. Comments are removed when you compile your code. Further explaining, it depends on the type of programming language you are using. For compiled programs, only the executable files are used by the computer during running the program instead of the source files.
Does commented code affect performance PHP?
The only way it is slower, is that the interpreter has to read more bytes. But as for execution speed, it has no influence, because they are just ignored by the interpreter. So basically, it does not matter if you add comments.
Does commented code affect performance C#?
4 Answers. No performance degradation at all. Comments are not parsed by the compiler, they are usually removed in the lexical analysis.
Do comments have an effect on performance?
If so, does that mean that comments have an affect on performance… A very, very, very minimal one, on the initial parsing stage. But comments are very easy to scan past, nothing to worry about. If you’re really worried about it, though, you can minify your script with tools like jsmin or the Closure Compiler (even with just simple optimizations).
Why is commented code bad?
Commented code is bad because when other people read the code – especially when you are stressed trying to fix a bug when the original author is away on vacation – is that it is very confusing to read the code, especially if the error is from a wrongly placed // at the start of the line…
Do comments affect the speed of a script?
The biggest effect that comments have is to bloat the file size and thereby slow down the download of the script. Hence why all professional sites use a minimizer for a productive version to cut the js down to as small as it gets. It may have some effect. Very minimalistic effect, though (even IE6 handles comments correctly ! to be confirmed…
What is an example of a comment being left in code?
The usual example is that someone changed a line of code and left the old line there as a comment, apparently to confuse people who read the code later on. Of course, that’s a bad thing.