Debugging Elixir code: The definitive guide

Click for: original source

Every application contains bugs, and even if it doesn’t, it will. And even if you’re not a notorious bug producer and your code quality is generally good, the conditions programmers work in are often suboptimal - you will often find yourself pulling your hair out over code written years ago by someone no longer involved in your project. By MichaƂ Buszkiewicz.

In this article, you will find out what approaches and tools are efficient in debugging Elixir applications - often contrary to popular beliefs within the community:

  • Debugging is an art
  • Being naive: IO.inspect/2
  • Being professional: IEx
  • Pry
  • Break
  • Debugging pipelines
  • Debugging Phoenix apps: Battling timeouts
  • Erlang debugging: Real debugger, clumsy usage
  • Visual Studio Code & ElixirLS

Elixir isn’t the easiest language to debug, and there are several tools you can use - it’s good to spend some time trying out them all to ensure you’ll choose the right tool for a particular job in the future. Very good article!

[Read More]

Tags app-development elixir web-development functional-programming