3 ms·
Also, when trying to reproduce an issue, adding logs can often be more helpful than using a debugger: With the debugger, you can only see the application state
by lytefm 4y ago
Also, when trying to reproduce an issue, adding logs can often be more helpful than using a debugger:
With the debugger, you can only see the application state at one specific point at the time.
With added print statements, you get a nice history of the application state.
If I already know where exactly something is going wrong: sure, I'll could a breakpoint there, if needed - often it's not.
If I don't know where exactly the problem is, I'll add print statements.
- DougBTX 4y ago> With the debugger, you can only see the application state at one specific point at the time. Really depends on the debugger. Some tools support “time travel” debugging, which essentially stores a structured log of memory state over time.
- Qem 4y agoThe Smalltalks are nearly unmatched on this. Pharo is a great representative of this tradition.
- igouy 4y ago"One aspect which has not yet been focused upon is that in modern Smalltalks (forget about the block-fiddling in ST-80) exceptions are proceedable. This means, that the exception handler may decide to repair some malfunction and continue execution after the point where the original exception was raised." https://wiki.c2.com/?SmalltalkAndExceptions https://wiki.c2.com/?SmalltalkAndExceptions
- Qem 4y agoSo it falls short of full fledged past time travel. It's more like you could stop the flow of time, fix whatever went wrong, and then restore time flow, as if nothing had happened. Short of what OP wanted, but still very useful. It avoids "Groundhog Day" debugging.
- igouy 4y ago> Short of what OP wanted… (That wasn't what I wanted to post; I should have waited.) More like stop the flow of time, fix whatever went wrong, fix why it went wrong, go back before it happened, and then restore time flow, as if nothing had happened (so more restart before than resume after). I don't know if that's what the OP wanted or not, I'll leave you to explain. https://news.ycombinator.com/item?id=28361693 https://news.ycombinator.com/item?id=28361693 https://news.ycombinator.com/item?id=28361845 https://news.ycombinator.com/item?id=28361845
- farnerup 4y agoThis is also possible in common lisp.