Does having a lot of white space between chunks of code and empty lines in code slow down the performance of the application?
I have a tendency to space apart my code quite a bit, and I am wondering if it affects it negatively. Also, I have a lot of commented code that I commented out when I made changes, although I keep it around in case I ever have to go back to the old way. What are some other tips that could speed up performance?
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.
The biggest effect that comments have is to bloat the file size and thereby slow down the download of the script.
What are the negatives of HTML comments? worsens the UX - even not visible, the HTML comments are part of the DOM tree and increase the number of DOM elements. This, in turn, affects the quickness and responsiveness, also leads to slower CSS selectors and DOM manipulation.
Since comments have no impact on the runtime results, they are sometimes neglected when the source code is updated.
No performance degradation at all. Comments are not parsed by the compiler, they are usually removed in the lexical analysis.
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