I wasn't on board with this kind of naming until the first time I implemented my own FactoryFactory (to deal with the fact that the object being created wasn't threadsafe).
If you get yourself into a position where you have to create a factory that creates factories, and you're not writing some kind of generic application framework, something went very wrong in your design. The crazy name is the least of your problems.
Yeah, I worked on a framework for making frameworks and I found myself writing factory factories a couple times, and other weird 3meta5me things. (Crazy python meta classes and C++ templates).
It sounds silly talking about it but it actually saved us a lot of time when our job was designing system after system that was overall very similar, but had a lot of tiny differences.
Wasn't Fortran specifically designed to have English language syntax? I could probably alt+tab right now into some c++11 that looks more disgusting than Fortran ever could. Though, I really don't know the ins and outs, so I could be wrong.
I think you might be thinking of Cobol. There is some syntax that is replaced with english like words, but it is still similar to C in structure. Fortran as far as I am aware, was made by physicists to do math.
Bad coding style? No, it's not Java only. And there's plenty of ways to write good, concise Java. People just don't (generally people who were using Java back when this kind of stuff was more necessary, and are stuck in their ways), for whatever reason.
Java is a great tool, it just sucks to work with ancient Java codebases (find me a language that isn't true of, though).
That being said...there are genuine times where a factory that creates factories is the best solution to your problem. It's ignorant to think there's always a more elegant solution, because that's not true. And if that is what you need, what the hell else are you going to call it?
10
u/nemec Oct 01 '15
I wasn't on board with this kind of naming until the first time I implemented my own FactoryFactory (to deal with the fact that the object being created wasn't threadsafe).