3 ms·
I agree with the need/value of side-effect/pure annotations. From a debugging perspective though, there are 2 alternative solutions: Aspect Oriented Programming
by eldude 11y ago
I agree with the need/value of side-effect/pure annotations. From a debugging perspective though, there are 2 alternative solutions: Aspect Oriented Programming (i.e., mutation observations) and Immutable data types (e.g., Object freezing) to cause an exception on mutation.
Depending on the language, you can replace the value with a watcher or proxy and add a break point to know if it was mutated between those lines. Alternatively, you could freeze the object or property or make it immutable between those lines to cause an exception to be thrown. Both will require triggering the case in question live so annotations still superior, especially compared to manually reading code.