Live data from Hacker News

The Return of Aspect Oriented Programming

thomaswc.com

41–50 of 79 posts

Re: The Return of Aspect Oriented Programming

#41
AOP is an interesting pattern but i've mostly tried to stay away from it mostly because:

- code readability and maintainability takes a hit. If you don't know things are defined using AOP in files x,y,z you can read the code and miss a whole lot of things.

- AOP implemented at runtime is a mess when you're trying to debug things

So yeah, instead of having aop defined somewhere else to wrap a function call, i tend to prefer doing it explicitly transaction(function())

Re: The Return of Aspect Oriented Programming

#42

Has anyone done AOP outside of Spring Framework? That's my only exposure and it feels very library level. Nothing I would use as a the primary way to structure the code.

In the Java-verse it’s also do-able with Guice. I’ve tried it with Dagger but bailed (square peg / round hole).

I think I prefer Springboot AOP, especially with SpEL.

The term “cross cutting concerns” is thrown around a lot when discussing AOP. Took me a while to appreciate just how powerful it is in this context - sprinkle an AOP annotation here or there to avoid massive refactors in a large codebase, or avoid rewriting classes in a way that makes your classes themselves “cross cut concerns.”

Re: The Return of Aspect Oriented Programming

#43

> And the "weaver", to use the AOP term, is simply the LLM that generates the program from the documents. Oh HELL NO. The LAST thing you want is a non-deterministic process monkey patching your code.

This is, indeed, the next generation of AOP: they've managed to evolve it from "extremely complex and hard to understand runtime behavior" into "completely undefined runtime behavior". UB as a service. True innovation!

That's what all the customers are demanding.

Re: The Return of Aspect Oriented Programming

#45
The stuff i dreamed of doing but was smart enough to avoid in Java many years ago, is what I now use FP to do on the JVM, in scala, without any of the drawbacks of AOP. if i was stuck in java languiage on the jvm for some reason i could see the appeal of trying AOP now that LLM can assist with it. Thinking of the annoying stuff like setting up automated builds/compiler etc

Re: The Return of Aspect Oriented Programming

#46
Putting aside the question of whether AOP is a good model for software systems development, I wonder if the specific approach proposed is a good model for LLM-driven software systems development.

LLMs really like the most important context to be clustered in the most recent section of their window. Dividing up cross-cutting concerns into their own documents would seem to be pushing in the other direction.

Re: The Return of Aspect Oriented Programming

#48

> And the "weaver", to use the AOP term, is simply the LLM that generates the program from the documents. Oh HELL NO. The LAST thing you want is a non-deterministic process monkey patching your code.

> The LAST thing you want is a non-deterministic process monkey patching your code. I'm not poking fun of you, but the irony here is that code-as-written is mostly a "suggestion" to modern compilers and JIT interpreters and the actual instructions emitted often look nothing like your ver-batim code.

Compilers are deterministic. You can control all the input to the compiler and the environment it runs in to get reproducible builds. This isn't an accident. That's best practice.

Re: The Return of Aspect Oriented Programming

#49
post #38
post #31

Earlier quoted context omitted.

I always thought AOP was super cool, but also that it completely destroys readability and the ability to understand a codebase. I also think it's probably one of the worst concepts to embrace in the age of agentic coding. That would be like a foot missile. There are a limited number of patterns that absolutely do benefit from AOP though. The obvious one is logging. I don't think there's many though. Regardless, AOP i…

I've feel like AOP is Spring on steroids. Same downside for both IMO.

I think that's a good point, never thought about it like that. I like the abstraction level that Spring Boot brings, but working with a principal engineer who was very into AOP on my previous team was a huge pain. Like you and GP said, AOP absolutely destroys readability. Current team has code split into a million xyz-common libraries, which isn't my preference, but I can still click through to see the source of the library. I will never get what AOP truly improves on

Re: The Return of Aspect Oriented Programming

#50

Earlier quoted context omitted.

This is, indeed, the next generation of AOP: they've managed to evolve it from "extremely complex and hard to understand runtime behavior" into "completely undefined runtime behavior". UB as a service. True innovation!

That's what all the customers are demanding.

Our customers are CEOs and CTOs - kinda checks out.
Post reply on HN