3 ms·
I have the opposite view. AOP didn't go far enough. At this point we're reaching limits of IDE support[0] and language design. New languages have been piling u
by TeMPOraL 3y ago
I have the opposite view. AOP didn't go far enough.
At this point we're reaching limits of IDE support[0] and language design. New languages have been piling up increasingly arcane mathematical abstractions to try and squeeze in a lil' bit more stuff in the same number of characters, but they too can't get past the fundamental problem: there is only so much you can fit in a piece of plaintext. You can't cover every cross-cutting concern at the same time in the same piece of code, and keep all of them easy to understand and work with. That is, we are being limited by insisting on directly authoring and manipulating source code that's plaintext and a "single source of truth".
AOP solved a lot of these issues, but it was hamstrung by being deeply embedded in that "plaintext single source of truth" code workflow. It was confusing to have "spooky action at a distance" that's invisible unless you're using a properly configured IDE, but the real problem here is that we expect everything to be local in the same piece of text. If we drop that expectation - learn to work on higher-level representations of the underlying source code - then none of it is a problem anymore. AOP becomes a subset of more general techniques of authoring software systems.
--
[0] - Perhaps with exception of LLMs, which promise to be able to both write heaps of code and explain what all that code does. We can probably ride quite far in that direction, but it'll also eventually hit the same wall: no more progress until we abandon the idea of working with the plaintext source code directly.
- BlargMcLarg 3y ago>It was confusing to have "spooky action at a distance" that's invisible unless you're using a properly configured IDE This statement seems slightly ironic given the prevalence of IoC containers in the most commonly used backend languages and rampant 'interface everything' syndrome alongside it. You'd almost think such a world would embrace AOP.
- 0x445442 3y agoIf you look at something like Spring, IOC isn't the issue but annotations are.
- marcosdumay 3y agoIt's a silent change, but I think IoC is becoming commonly accepted as a bad pattern. (And I'm sure we will see a overreach at some point where people do bad things to avoid it.) The most commonly used languages are there because the most conservative people (that hire a large majority of people) pick them.
- rewmie 3y ago> but I think IoC is becoming commonly accepted as a bad pattern. I have no idea where you got that from. Inversion of control is perhaps the most important design pattern ever devised, and IoC frameworks make or break any project. Where exactly did you get your personal assertion from?
- TeMPOraL 3y agoWhich IoC? So many different things meant by it. Often overlapping with Dependency Injection. In the most basic form - passing dependencies to a function/object constructor, instead of instantiating them within said function/object constructor - I feel it's mostly a good idea, but there's something that's bugging me about this, and I'm not yet able to pinpoint what that is. The more advanced form - autowiring things with magic annotations - yeah, I hated that when I was working in Java. However, these days I think the problem isn't with the idea, but - again - with our insistence on working with the final, pre-binary, single source of truth plaintext code. That is, autowiring is the kind of stuff that really needs support from tooling able to tell you what exactly happens in a particular scenario - it feels icky, but it does so because we're not used to relying on tooling over raw plaintext. And what I'm saying is, we should ditch the plaintext and embrace the tooling, or else we'll remain forever stuck in endless debates about code style, readability, etc. - problems that, to me, seem to be fundamentally caused by hard limits on how many cross-cutting concerns you can cram into a single block of text.
- marcosdumay 3y ago> Which IoC? Well, I have seen some heat specifically against the habit popular on Java and C# of passing dependencies into factories and getting classes with completely different interfaces as a result. But you are correct, IoC is a very generic name that can cover even passing lambdas to a map function. Anyway, the problem with deviating from the single source of truth plaintext is that when other sources of truth have bugs, you are usually forever unable to fix them¹. This is because when people create tools that affect the program behavior independently of your source, they inevitably make them stateful. A stateless tool could in theory not have this problem, but then, developers are annoyingly good into reducing your stateless tool "configuration script" into normal code and using that instead. 1 - There are many programing environments where tools affect the program behavior. Those are usually aimed into novices and non-programmers, because programmers with any experience are quick to reject them. A very common theme on those environments is that error that keeps happening despite everything being correct, and can only be solved by throwing your work away and doing everything again exactly the same way from scratch.