News for hackers. Stuff that matters.
Re:Local Variables as Accidental Breadcrumbs for Faster Debu... by Freedom2 on Thursday October 10, 2024 @02:11PM (#41801555)
> accidental

Besides a debugger, isn't one of the first things people do (even undergrads) is start logging out variables that may be suspect in the issue? If you have potentially a problematic computation, put it in a variable and log it out - track it and put metrics against it, if necessary. I'm not entirely sure a full article is worth it here.

Re:Local Variables as Accidental Breadcrumbs for Faster Debu... by djmips on Thursday October 10, 2024 @03:00PM (#41802180)
You missed the point of the article.
Re:Local Variables as Accidental Breadcrumbs for Faster Debu... by Terr_ on Thursday October 10, 2024 @03:10PM (#41802328)
What is it that you believe they missed?

People have writing code in a certain way to provide logical "breadcrumbs" for a very long time, and doing it very deliberately. The fact that a tool was created that takes advantage of that isn't an "accident."

Compare to: "Correctly-spelled words as accidental hyperlinks to the dictionary definition."

Re:Local Variables as Accidental Breadcrumbs for Faster Debu... by djmips on Thursday October 10, 2024 @09:20PM (#41805216)
They missed that many programmers sometimes especially experienced ones like to write code that's very clever and packs a lot into one line of code to the detriment of debugging, often by others who may just be trying to reverse engineer what someone who left wrote.
Re:Local Variables as Accidental Breadcrumbs for Faster Debu... by vanschelven on Thursday October 10, 2024 @05:02PM (#41803558)
> If you have potentially a problematic computation, put it in a variable and log it out

My point was: what a "potentially problematic" computation is is not always known in advance. A style which is rich in local variables, when combined with a tool that shows actual values for all local variables when unhandled exceptions occur gives you this "for free". I.e. no need to log anything.