Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error on commented-out code

Tags:

javascript

c#

wonderful coders. I'm getting an error on commented-out code. The error is as below:

enter image description here

Previously I had controls with IDs #datepicker1 and #datepicker2, then I decided to no longer need them, so I removed them in code, and removed the Javascript that manipulated them.

The odd thing is that this code works in Debug, but throws the exception when deployed and run from a server.

Thanks

like image 630
JustAPup Avatar asked Jan 20 '16 18:01

JustAPup


People also ask

What does commented out code mean?

Comment-out definition Filters. (programming) To temporarily disable a section of source code by converting it into a comment.

Is commented out code bad?

Leaving commented code in your code base is a bad practice but that is not what you are doing if you work through it all and eliminate it. I suspect the person you are talking to either doesn't understand the process you are using or is being dogmatic. In reality, commented code is harmless.

How do you comment out code?

You can comment out one or more lines of code in any C/C++ editor view. The leading characters // are added to the beginning of each line when commenting one or more lines of code. You can also block comment multiple lines of code using the characters /* */ .

Do comments affect code?

Comments do not affect the performance of any software at all. What comment does is it provides a way for you to understand, in human terms, what is going on within your code.

Do comments affect code performance?

The biggest effect that comments have is to bloat the file size and thereby slow down the download of the script.


1 Answers

That will only comment out the JavaScript, not the ASP.NET tag. I would just use source control and delete the lines.

like image 93
Daniel A. White Avatar answered Oct 11 '22 22:10

Daniel A. White