4 ms·
From the perspective of debugging, an instance variable is not in the scope of any of the methods on the stack Your debugger is broken. The call stack will hav
by pjc50 12y ago
From the perspective of debugging, an instance variable is not in the scope of any of the methods on the stack
Your debugger is broken. The call stack will have implicit "this" pointers/references in each frame, and the instance variables can be found there.
Now, the rant as a whole has a valid point that mutable state causes confusion in terms of finding the code that mutated it. An argument for immutability or time-reversible debuggers. But OOP at least gives you a chance to keep the mutating methods close together where you can find them.
- deleted 12y ago[deleted]
- sebastianconcpt 12y agoBut when you really want to guarantee that, you just make the instVar immutable and you're good.