2

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

1
  • You ask silly questions. Just start learning Javascript by reading a tutorial and quit being a chicken! Commented Aug 27, 2009 at 14:35

7 Answers 7

3

With Addons in FireFox (FireBug, GreaseMonkey to name a few) along with support from IDEs like Visual Studio, it makes it pretty easy to debug javascript. Is it as "easy" as Java, C#, etc. I think that is really depends from programmer to programmer. I know a lot of programmers who think programming and debugging JavaScript is the most terrible thing in the world, eventhough they have all the tools available to them. To me, it doesn't seem so difficult, but I started programming JavaScript when there were no tools to help debug it. Like many things it's all a matter of perspective.

Sign up to request clarification or add additional context in comments.

2 Comments

Firebug is an AMAZING add-on for Firefox for web/javascript development. No installation is complete without it, IMHO.
even though 'sufficient' javascript dev tools exist, everybody admits that they are not the same caliber as native PC development tools.
3

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

Comments

2

A key point that the answers so far have missed is that unlike C++/C#/Java you get far less help at "Compile" time.

Hence a Javascript debugging session will often involve a considerable amount of time discovering a set of bugs that would be picked up very quickly and easily by the others before anything has run at all.

So the answer is a clear no, its harder to debug javascript than the other languages listed.

Comments

1

In Visual Studio 2008, there's pretty good support for debugging JavaScript... breakpoints work, and you can hover over variables to see their values, etc. It's the best way to debug JS that I'm aware of.

1 Comment

For IE only.. .
1

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

Comments

1

Firebug brings JS out of the stone age but isn't as elegant as debugging .NET. PC development tools leverage maybe 10 years extra evolution...

Comments

0

No, JavaScript is horribly sloppy language. You have to use a tool such as Firebug or JSLint to help you debug or you may never find your problem in a large application.

Here is some of why JavaScript is so problem prone:

  • Undeclared variables inside a function are global scoped by default.
  • JavaScript allows sloppy line breaks and attempts to insert semicolons where it thinks they are missing at compile time. This can wreck your code.
  • JavaScript has problems with type comparison when using equality comparison "==". You have to use "===" type of equality comparison or "!==" type of inequality comparison to get around those problems.
  • JavaScript has many more problems that any well written language would not have. I recommend reading the book The Good Parts to avoid many traps and write programs that beautiful, efficient, and maintainable.

http://jslint.com/

1 Comment

+1. A good list of compile time issues. -1 "horribly sloppy", an opinion not shared by all and not relevant., IMO C++ is also "horribly sloppy". Personally I think Javascript is an excellent language as long as you place it in the perspective that it is a "script" language. I wouldn't want to write an entire LOB app in it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.