6 ms·
This is a rather simplistic argument... With Ruby I find it hard to avoid using a debugger. With Elixir I never need a debugger.
by amorphid 8y ago
This is a rather simplistic argument... With Ruby I find it hard to avoid using a debugger. With Elixir I never need a debugger.
- rhizome31 8y agoAs someone who resort to IEx.pry daily I'm curious if you have any tip to share about your workflow so that you don't need a debugger. To you use typespecs and Dializer? (I haven't looked into those yet.) My experience is that a good share of bugs is avoided thanks to immutability, but I still get nil-related issues now and again.
- _d8fd 8y agoFor me it's mostly about gow people use metaprogramming. In Ruby, if I'm trying to find the source of a dynamically generated method in a dynamically generated class, that usually requires me to run add a debug statement, run the program, and see what's being passed. Even if I have a stacktrace, I often find it difficult to understand what the code is doing without running it. I find Elixir code easier to read, and grepping my way through the code base is often enough. And to be fair, a debugger is often less than useful in macros involving AST & when dealing with a process that got a random message from who knows where.