This is what I always thought about, so here it goes.
When I wrote the code, I was taught to highlight lines, comment on them, etc., to improve readability (I believe most of us). Obviously, I don’t see any problem in this, but it seemed to me that if all these whitespace and commented sections are ignored by the compiler / interpreter or something else, how much does this affect its performance?
Admittedly, I don’t know much about how the compiler works - only basic concepts. Nevertheless, I have a fair idea that in order to be able to "ignore spaces", you will first need to identify it (at least), and this will take work and, therefore, time.
So then I thought: what about spaces or comments at extreme levels? Say, millions or billions of their sections?
I assume that the question I ask is this: at what point (i.e., the extreme level) are sections of the code ignored that affect the ability of the compiler / interpreter to promptly output the result and, therefore, affect the user's work?
Thank.
source
share