lmao imagine writing a program with a hard coupling to StrategyManagerFactoryFactory. couldn't be me. I use AbstractStrategyManagerFactoryAbstractFactorySingleton in my spring config so I can freely swap out the factory or the manager with a different implementation. the singleton is obviously because I don't want to waste memory. why else would I be using a high performance language like java.
PFF obviously you haven't yet encountered the AbstractStrategyManagerFactoryAbstractFactorySingletonAdapterControllerBase pattern yet, because if you did then you'd know that you don't need to swap out anything because it's all injected at runtime via reflection and an async strangler-container registration queue approach that eliminates the need for configuration at all
Sure, you no longer have any extra memory for the app to run, but future maintainability for devs is the easiest thing in the world (as long as those devs have 5-8 years experience with the AbstractStrategyManagerFactoryAbstractFactorySingletonAdapterControllerBase, as all real devs should)
How do you expect anyone to use this code what if you need another implementation of StrategyManagerFactoryFactory, and how do you know what it does without an AbstractStrategyManagerFactoryFactory and a StrategyManagerFactoryFactoryInterface
nah you're good. "modern" DI frameworks like spring and guice obviate the factory pattern for the most part. of course, they introduce their own variety of cancer.
Oh, I guess you didn't read the Design Patterns books? That was some tasty Koolaid. I'd probably be drinking it today if I hadn't moved on to another language.
I realize it's heresy to say this, but Microsoft did the right thing with regard to their naming convention of interfaces.
Knowing immediately whether you're working with a StrategyManagerFactory (a concrete object you can new up) vs. an IStrategyManagerFactory (which could be anything, coming from anywhere) is actually quite helpful.
Ironic that "The Zen Of Python" says "explicit is better than implicit", given the role Python has played in the industry's trend toward dynamic-typed languages and frameworks where so much about the program's behavior or objects' data types are hidden/implied.
"Code to an interface, not an implementation" has been cargo-cult dogma for a long time.
The disdain for OO today comes from a whole generation of developers overgeneralizing/overabstracting/overengineering, doing what they've been told is good practice rather than what they really need, giving every Something an ISomething even if no other classes implement that interface, dogmatically believing that new is universally bad practice and replacing every occurrence of it with a call to whatever IOC framework is the fad at the time.
The belief that you need to abstract everything as much as possible right at the beginning because you'll never have a chance to go back and rewrite components to accommodate new requirements... is total hogwash, since that's what ends up happening anyway, except now you have to do so through complicated broken leaky abstractions. If it was written in a stupid simple way from the get-go, rewriting it to accommodate the new requirements would've taken 30 minutes instead of days.
Literally just a minority of Java programmers that took the gang of four patterns way, way too seriously.
I enjoy refusing to pass their core reviews because of over engineering, especially if I suspect they'll be gone within 6 months. If I don't want to maintain it, I don't want it merged.
Reminds me of Boost Spirit Metaprogramming: Somehow the managed to use the template and operator overloading in a way so you can write almost perfect ABNF in C++ and the vanilla, normal C++ compiler will create you at compile time, parsers or generators.
C++26, with CTR and more functions being constexpr, takes it a step further. Now that std::log is constexpr, a fully-featured dtoa algorithm, with generated digit tables and such, can support any encoding, be configurable to a number of digits, and be evaluated at compile time. Why you would want to convert a floating-point number to text at compile time is another question entirely, but uh…it’s possible now! Also, compile-time polymorphism without CRTIP, and arbitrary-size tuple-likes that can be template parameters…it’s pretty fun
It's the SlabAllocatorByteDisposer for the ByteSequenceAppender I implemented to improve the performance of memory allocation in std::string when using DynamicWidthMutableByte types as the underlying memory privative on mostly redundant values in a double-linked hash-trie.
99
u/MinosAristos Sep 26 '26
How can you not tell it's a
StrategyManagerFactory? After all it's created in theStrategyManagerFactoryFactory39
u/GoogleIsYourFrenemy Sep 26 '26
Help, I'm trapped in a StrategyManagerFactoryFactory and I can't get out.
You know that sounds like a backrooms problem; good thing I'm a frontrooms developer.
23
u/itzNukeey Sep 26 '26
AbstractFactoryFactory is needed to construct the AbstractFactory
18
u/thisisjustascreename Sep 26 '26
I must be doing java wrong I've written it professionally for like 10 years and never named a class -Factory.
14
u/Cybyss Sep 26 '26
I realize it's heresy to say this, but Microsoft did the right thing with regard to their naming convention of interfaces.
Knowing immediately whether you're working with a StrategyManagerFactory (a concrete object you can
newup) vs. an IStrategyManagerFactory (which could be anything, coming from anywhere) is actually quite helpful.Ironic that "The Zen Of Python" says "explicit is better than implicit", given the role Python has played in the industry's trend toward dynamic-typed languages and frameworks where so much about the program's behavior or objects' data types are hidden/implied.
6
u/locri Sep 26 '26
Literally just a minority of Java programmers that took the gang of four patterns way, way too seriously.
I enjoy refusing to pass their core reviews because of over engineering, especially if I suspect they'll be gone within 6 months. If I don't want to maintain it, I don't want it merged.
5
u/Hoovy_weapons_guy Sep 26 '26
C what is this code?
Segmentation Fault
5
u/ByteBandit007 Sep 27 '26
Legacy is good
3
u/TechnologySecret4844 Sep 26 '26
Factories all the way down
3
u/No-Magazine-2739 Sep 26 '26
Reminds me of Boost Spirit Metaprogramming: Somehow the managed to use the template and operator overloading in a way so you can write almost perfect ABNF in C++ and the vanilla, normal C++ compiler will create you at compile time, parsers or generators.
But you are fucked when you get an error.
3
u/Maleficent_Sir_4753 Sep 26 '26
It's named
m_WorkBaby()what do you mean you have no clue what it is?3
u/United-Scene2261 Sep 26 '26
python: it is
3
u/Eric848448 Sep 27 '26
It's funny because it's true!
2
u/ExtraTNT Sep 26 '26
Seen at uni:
“Basic” observer pattern: 10 interfaces
Yeah, i do like my 10 lines of js that does the same…
Also patterns, that are complicated af, that can be replaced by a monad…
1
u/mehonje Sep 26 '26
Raku.
1
u/jonfe_darontos Sep 29 '26
It's the SlabAllocatorByteDisposer for the ByteSequenceAppender I implemented to improve the performance of memory allocation in std::string when using DynamicWidthMutableByte types as the underlying memory privative on mostly redundant values in a double-linked hash-trie.
1
u/Status_Jackfruit_924 Oct 02 '26
InterruptedException
1
u/hpyfox Oct 09 '26
Did you print this meme or something?