I've been getting into Julia a bit for personal projects, since I like it better than Python, so maybe this will be a good excuse to learn how to use debuggers more effectively.
I've been getting into Julia a bit for personal projects, since I like it better than Python, so maybe this will be a good excuse to learn how to use debuggers more effectively.
My experience regarding people around me that don't use them is that they never actually bothered to learn how to use them.
Same applies to other development tools like profilers and static analysers.
I guess I was quite lucky with some of the teachers and professors that crossed my path.
I think part of it is that for the last 5 years , every single language I've used with any kind of professional capacity (JavaScript, Haskell, Erlang, F#, Clojure, Scheme) has had a REPL, so I can quickly play with and reload code, making debuggers a bit less necessary than if I were to do a purely-compiled language.
I definitely would benefit from learning more about performance profilers though. You've given me an idea of reading material for the weekend.
Debuggers aren't exactly self-explanatory so the role of good teachers should not be underestimated
So, yeah, learning the keyboard shortcuts for how to step through something takes effort. However, it is doing basically what I was taught to reason about programming.
Functional idioms throw a lot of this a giant curve ball. Heaven help the person that was used to stepping through a for loop that steps over a map call. Oops. Worse if it is lazy.
That said, they are not competing ways of thinking. Just different ways. If you are having trouble with one, try the other.
(I do note that the difficulty of working in a debugger is ironically one of the major criticisms of macros in lisps.)
Good debuggers:
- Pascal - Delphi - FoxPro /VisualFoxPro (the best of all, IMHO)
Others more common debuggers (Visual Studio, Xcode, IntelliJ, maybe others I don't remember), have issues, like the amazing "feature" of show opaque values, not allow to inspect stuff or requiere extra steps.
But the worse of all? Them are SLOW. Do "step" is slow. Waiting to see if evaluating values? slow.
Python have almost good, but mostly because python allow to see a lot. GDB sucks as is, but python make it look good.
Plus it is not like one needs to single step all the way, there are plenty of ways to control execution flow.
Like 7h ago?
But here, I was talking how other debugger have not the same problems.
But really, what do you use in their place? Do you work in an environment that is "debugger by default" (as opposed to a separate step where you need to "debug" instead of "run")?
I think it's the difference between inspecting local vs global program behavior. A debugger gives a very local view of the program but the most difficult bugs are ones where the local behavior is (or seems) correct but the global behavior is wrong. In that case it can be much more useful to run the program to completion with plenty of logging and then to carefully inspect the record of how the state changed.
I have often thought that programmers posture over their tool independence to signal their excellence. Before the current generation of programmers, many programmers would proclaim how they didn't need to use higher level languages to assist them in programming because assembly language was sufficient given their reasoning powers. Today programmers proclaim they don't need types to insure data invariants as their reasoning powers are sufficient. They proclaim they don't get any value from unit testing because they can maintain correctness across all development phases using their reasoning powers alone. They proclaim they don't need automatic garbage collection because they can insure correct memory usage using their reasoning powers. They have no use for IDEs, debuggers, or profilers because they believe none of these tools could augment their reasoning powers.
Excellent programmers can indeed compensate for poor tooling through their reasoning powers alone. But if history is a guide, people who don't use the best tools, practices and technologies to produce the best work, at some point, wont produce the best work.
If there wasn't gdb/lldb at all, I'm pretty sure Linux/BSD would have a debugger that's far better than any closed source counterpart.
Well, cite, please.
Which isn't to say that live coding and debuggers are bad. However, they are usually much more useful to find out either how something got to where it is, or to augment what you have until it is ready to send for review.
I've also used the Visual Studio debugger for F#, and I think I did gdb with Eclipse a couple years ago when I did C.