Debugging Elixir Code: Tools and Techniques by Michał Buszkiewicz - Elixir Meetup #1

Debugging Elixir Code: Tools and Techniques by Michał Buszkiewicz - Elixir Meetup #1
Elixir Newsletter
Join Elixir newsletter

Subscribe to receive Elixir news to your inbox every two weeks.

Oops! Something went wrong while submitting the form.
Elixir Newsletter
Expand your skills

Download free e-books, watch expert tech talks, and explore open-source projects. Everything you need to grow as a developer - completely free.

Table of contents

At Elixir Meetup #1, Michał Buszkiewicz shared his extensive knowledge on debugging Elixir applications.

He discussed various tools and techniques, emphasizing the importance of a proper debugging mindset and providing practical examples to help developers enhance their troubleshooting skills.

About Michał Buszkiewicz

Michał Buszkiewicz is a co-founder and CTO at Curiosum, a Poland-based software house. With a background in Elixir, Phoenix Framework, and Ruby on Rails, Michał brings a wealth of experience to the table. He is also dedicated to training junior Elixir developers and sharing his expertise through presentations and workshops.

The Importance of a Debugging Mindset

Attitudes Towards Debugging

Michał highlighted the varying attitudes towards debugging among programmers. Some rely heavily on tools like Stack Overflow, while others prefer print debugging or diving deep into code libraries. He stressed the importance of being creative and inquisitive in your debugging approach.

Key Points:

Stack Overflow: Useful but not a complete solution. Print Debugging: Common but limited in scope. Deep Code Analysis: Beneficial for learning but time-consuming.

Tools and Techniques for Debugging Elixir

Elixir and Erlang Tools

Elixir applications can leverage a range of tools from the Erlang ecosystem, including built-in tools like Observer and Debugger, as well as external tools for message and function call tracing.

Key Tools:

Observer: For monitoring system performance and tracing messages. Erlang Debugger: For step-by-step code execution. Redbug and Recon: For message and function call tracing.

Debugging in Phoenix Applications

Phoenix Framework Tools

Michał discussed tools specific to Phoenix Framework, such as the LiveDashboard and Telemetry integration, which are crucial for web application debugging.

Phoenix Tools:

LiveDashboard: Provides real-time insights into your Phoenix application. Telemetry: Integrates with LiveDashboard for monitoring requests and performance.

Advanced Debugging Techniques

Using IEx for Debugging

Michał explained how to use IEx for interactive debugging, including the use of IEx.pry and IEx.break for setting breakpoints and inspecting execution contexts.

IEx Debugging:

IEx.pry: Insert breakpoints in your code. IEx.break: Set breakpoints for functions or modules without recompiling.

Practical Demonstrations

Live Debugging Session

Michał demonstrated a live debugging session, showing how to use the various tools and techniques discussed. He provided examples of setting breakpoints, inspecting variables, and navigating through code.

Demo Highlights:

Setting Up Breakpoints: How to use IEx.pry effectively. Navigating Code: Techniques for stepping through code and inspecting state. Combining Tools: Integrating multiple tools for comprehensive debugging.

Best Practices for Debugging

Effective Debugging Strategies

Michał shared best practices for debugging Elixir applications, emphasizing the importance of clear code, thorough documentation, and leveraging the right tools for the job.

Best Practices:

Clear Code: Write maintainable and readable code. Documentation: Document your code and debugging process. Tool Integration: Use the right tools for efficient debugging.

Conclusion

Michał Buszkiewicz’s presentation at Elixir Meetup #1 provided valuable insights into debugging Elixir applications. By understanding and applying the tools and techniques discussed, developers can improve their debugging efficiency and enhance their overall productivity.

Join the Community

Ready to explore the reliability of Elixir and Erlang?

Register for the next Elixir Meetup at Curiosum Meetups: Registration Join our community of Elixir enthusiasts at Elixir LinkedIn Group Prefer watching the presentation? Here’s the video

Want to power your product with Elixir? We’ve got you covered.

Related posts

Dive deeper into this topic with these related posts

No items found.

You might also like

Discover more content from this category

Phoenix Component guide - reusable building blocks of modern web application

Have you ever thought about making and handling reusable pieces in Phoenix? Or splitting big HTML templates into smaller, easier-to-read parts?

Tidy Up Your Translations with Kanta - Krzysztof Janiec - Elixir Meetup #15

Find out more about an open-source tool developed by Curiosum to streamline translations in Elixir and Phoenix projects. Learn how Kanta simplifies the process of managing multilingual content, making it easier for developers and translators alike.

A Walk-Through of a Full Nerves Application - Rob Raisch - Elixir Meetup #3

Explore the session on developing IoT apps using Nerves and Elixir. He walked the audience through a full Nerves application, showcasing its capabilities and providing insights into building robust, fault-tolerant, and maintainable embedded systems.