3 ms·
Separately from AOP being an incredibly bad idea, implementations of it contain another bad idea: using pattern-matching on symbol names to select a point cut.
by kazinator 3y ago
Separately from AOP being an incredibly bad idea, implementations of it contain another bad idea: using pattern-matching on symbol names to select a point cut.
As a Lisp person, Kiczales should have know better than to go around splitting atoms.
You're really planting a bomb when you capture not only every currently available method that begins with "Get", but any future one someone may add.
Computer programs should ideally have the property, that any identifier occurring in the system can be replaced by one having a different name (other than that of some existing identifier), such that the program's behavior doesn't change. The only thing significant about identifiers is whether two identifiers are the same one or not. An identifier's name is just for debugging, and for linkage across subsystem boundaries that do not admit the passage of object identity.
- incrudible 3y agoIt is bad for changing the behavior of the programs intent (for lack of a better word), but it is good for observing it. Non-intrusive selective logging is the obvious use case. Generally though I agree, architecting your software around AOP features is a terrible idea. Strike the O in any programming paradigm and you will be better off.
- kazinator 3y agoI think AOP is basically a tool that is most valuable to people who are dealing with some monstrous legacy code base that they don't want touch (let alone fully understand), but are under pressure to deliver some solution to a new requirement. It lets you play games like "when the legacy code makes certain calls here and here, we do our thing, with our state, without disturbing anything else". If it doesn't work out, the AOP stuff can be easily backed out and disabled (or further massaged), rather than reverting some commit over 37 files of legacy code. It's kind of like the software equivalent of patching a circuit board with wires. You have a bad circuit board, already manufactured in some quantity, and need to demo the hardware tomorrow. No time to spin another rev of the board.