Is debugging JavaScript as easy as debugging a C ++ / C # / Java application?

Is debugging JavaScript as easy as debugging a C ++ / C # / Java application (given the best IDE available), or is the current tools much more limited and less user-friendly, making debugging a headache?

+2


source to share


7 replies


With add-ons in FireFox ( FireBug , GreaseMonkey , to name a few) along with IDE support like Visual Studio, it's pretty easy to debug javascript. Is it "lightweight" like Java, C #, etc. I think it really depends on the programmer from the programmer. I know many programmers who think programming and debugging JavaScript is the scariest thing in the world, even though they have all the tools available to them. It's not that hard for me, but I started programming JavaScript when there were no tools to debug it. Like many things, this is all a matter of perspective.



+3


source


The Firebug plugin makes JavaScript debugging quite easy - I would say at least on par with debugging a C # application.



+3


source


The key point that the answers have missed so far is that unlike C ++ / C # / Java, you get much less compilation help.

Consequently, a Javascript debugging session will often involve a significant amount of time, encountering a bunch of errors that will be quickly and easily picked up by others before anything is run at all.

So the answer is clear no, its more difficult to debug javascript than other languages ​​listed.

+2


source


Visual Studio 2008 has pretty good JavaScript debugging support ... breakpoints work and you can loop through variables to see their values, etc. This is the best way to debug JS that I know of.

+1


source


I find it pretty painless with Firebug . It comes with a full blown debugger. However, I find dynamic languages ​​harder to debug if they make heavy use of closures and functional abstractions.

+1


source


Firebug takes JS out of the Stone Age, but isn't as elegant as .NET debugging. PC development tools can leverage 10 years of additional evolution ...

+1


source


No, JavaScript is a terribly messy language. You should use a tool like Firebug or JSLint to help you debug or you can never find your problem in a large application.

Here are some of the reasons why JavaScript is so problem prone:

  • Undeclared variables within a function are constrained by default by default.
  • JavaScript allows sloppy line breaks and attempts to insert semicolons where it thinks they are missing at compile time. This can damage your code.
  • JavaScript has type matching issues when using the "==" equality comparison. You should use the "===" comparison type or the "! ==" inequality comparison type to work around these problems.
  • There are many more problems with JavaScript that no well-written language would have. I recommend reading the Good Details book to avoid many pitfalls and write programs that are beautiful, efficient, and maintainable.

http://jslint.com/

0


source







All Articles