Will comments slow down the execution time of my web pages?

This may be a rather strange question in the eyes of some of you here, but I'm really wondering if comments in my code will slow down the execution time of the pages that I am doing. I have several Classes / WebControls that require a lot of comments to make everything clear and quickly readable to other people who have to deal with my code, and now I wonder how ASP.Net deals with my comments. Will comments be removed from my code at compile time or how is this all done?

I have to be more specific: I mean the comments in my code in C #.

+3
source share
4 answers

Serveride comments in C # will do nothing but a slight increase in compiletime.

Comments in javascript, of course, increase the load. But since you usually minimize javascript on production systems and thus highlight comments and spaces, in practice this does not matter.

Since html minification on dynamically generated pages is not so common, html comments slow you down a bit, but they are usually so few that in practice this is not important either.

+3
source

aspx (, javascript ..) , , . JavaScript javascript .

#... , .

+1

. - HTML (<!--), HTML . # .

0

.aspx, , HTML . , HTML (!<--) , .

, , . ( - , , , , .)

ASP.NET . !<%--... --%>, . , , - , , .

2006 : http://weblogs.asp.net/scottgu/archive/2006/07/09/Tip_2F00_Trick_3A00_-Using-Server-Side-Comments-with-ASP.NET-2.0-.aspx

0
source

Source: https://habr.com/ru/post/1773200/


All Articles