Hacker News new | ask | show | jobs
by gizmo 1112 days ago
In C++ projects you see the verbose version a lot, because it's much faster to set a breakpoint on a statement than on a conditional expression. It's really annoying to repeatedly stop debugging, add the redundant return statements, and sit through a recompile cycle just because `return expr` looks nicer than `if (expr) return true else return false`.
1 comments

Alternatively, you could use a debugger that supports conditional breakpoints.
Cond breakpoints require the code breaking each time and evaluate the statement which makes it runs like snail.