Link to home
Start Free TrialLog in
Avatar of dbnewbie
dbnewbie

asked on

Optimize Code By Commenting Out Blank Lines?

Someone told me that commenting out blank lines in VB.NET code improves efficiency because the compiler does not have to evaluate the blank lines. For example:

MessageBox.Show("Hello world!")
'
'
'
MessageBox.Show("I commented out the blank lines.")

This sounds ridiculous to me. Blank lines in code should be ignored by the compiler -- whether or not it is commented out. Am I right?

Is there (or was there ever) a language where commenting out blank lines made a difference?
Avatar of Ramesh Srinivas
Ramesh Srinivas
Flag of United Kingdom of Great Britain and Northern Ireland image

Hi,

It may do with compilers from other languages, but it certainly isnt the case with .net.

regards,

KS
ASKER CERTIFIED SOLUTION
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dbnewbie
dbnewbie

ASKER

I used ILDASM and noticed no difference. Thanks.