Ask HN: Which programming language are the easiest to debug?

3 points by ZenoArrow ↗ HN
I'm curious... what, in your opinion, are the easiest programming language to debug? When you start using a language, the importance of straightforward debugging is huge (in my opinion), but it's a topic that I haven't seen much discussion on.

This question has two sides; 1. Does the language itself promote code that is easy to reason about? 2. Does the language have great debugging tool(s)?

Feel free to share any insights you have about this topic. Real world experience with a language is preferred, but if you've heard good things about debugging in a language you've not used before, please share this too.

Of course this is a subjective topic, so there's no point in pointing out when someone is "wrong". Please bear this in mind.

Thank you.

8 comments

[ 3.1 ms ] story [ 38.1 ms ] thread
I'd say most of the time the higher level the language the easier it would be to debug. For example, I can open a file, write to it and close it in three lines of ruby. Doing this properly in C would take at least 8 lines. Less code is one way of making software easier to debug.
In essence yes, higher level languages are easier to debug. However, higher level languages are a double edged sword in some cases with regards to debugging...

Let's take Clojure for example. That's a high level language by anyone's standards, and the code can be made easy to reason about. However, due to being built on top of the JVM means that when dealing with bugs a knowledge of the JVM (and Java if you're using Java libraries) is beneficial. Now that the high level view doesn't tell you the full picture, you're making the search for the bug quite a bit more involved, as not only do you need to understand the bug at the level which its occurring, you need to fix it at a level abstracted away from the one where the bug can be seen.

But by and large, yes, high level languages tend to be easier to debug due to smaller code bases.

I'd say: whatever language you know the best is the easiest to debug.
But does the language you know best always have the best debugging tools? Not necessarily.
Higher level languages are easy to debug provided the code base is Application code. The more you move closer to the system, the harder it is going to be to debug higher level languages - even java.

Essentially that mimics the whole software development philosophy too: Higher level languages for higher level programs.

Check out how to debug in Ruby with Metaprogramming. Mind blowing. Working on a Kernel now for educational purposes, and it's practically impossible to debug using GDB :-) not literally, but takes 5 minutes to fire up a GDB, which still won't work properly