3 ms·
> 1) Delete most of the comments 2) Stuff breaks. WTF? The code was processing its own comments! My campfire story: change method name, stuff breaks. Method na
by praptak 14y ago
> 1) Delete most of the comments 2) Stuff breaks. WTF? The code was processing its own comments!
My campfire story: change method name, stuff breaks. Method names had been parsed in a wrapper object (Python's __getattr__ being abused) so that calling 'setFoo()' triggered a 'Foo_changed' event. In fact, the method names constituted a mini-language with its own grammar and semantic. Apparently someone had gotten high on reflection.
- evilbit 14y agoCorollary: AOP is the enemy of refactoring. You unwittingly changed one of the (seemingly unused/unnecessary) pointcuts and your aspects aren't firing anymore. While not impossible to track down, these problems are difficult to resolve.
- praptak 14y agoI am not sure if this was AOP though maybe I'm committing the no true Scottsman fallacy here. Side note: decorators were not present in Python then, so there was no easy way to do the cutpoint thing in a visible way.
- ldh 14y agoThis worries me every time I use AOP, but I mitigate that risk by writing integration tests which assert that the aspects are doing what they are intended to, and also to raise an alarm if somebody unknowningly breaks them.