Get the latest tech news

Local Variables as Accidental Breadcrumbs for Faster Debugging


Directly seeing the values for local variables in your stacktrace is invaluable for debugging — in fact it's one of the main reasons Bugsink is so useful. However: what actually gets captured depends on how you write your code: simple functions with local variables are much easier to debug than complex classes or overly-inlined code.

This blog post is a reflection on those thoughts and experiences, focusing on how local variables play a crucial role in effective debugging, and what this might mean for my (or your) coding style. Stacktrace with local variables in Bugsink Despite not knowing much about our hypothetical example (we made it up after all), you can see how this can help you quickly identify the root cause of the error: the starting point here would probably be the “big number” of 0. Trying to capture object properties, all attributes, or even deeper context introduces more complexity and noise, which makes it harder to pinpoint what’s actually relevant.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of faster debugging

faster debugging

Photo of local variables

local variables