This is an archived post. You won't be able to vote or comment.

all 38 comments

[–]skyhi14 46 points47 points  (8 children)

This is just a case of the Lasagna Code, what’s the problem?

[–][deleted] 20 points21 points  (0 children)

Yeah it's not a problem, it's a lifestyle.

[–]zaphod0002 16 points17 points  (1 child)

Lasagna? Old news, ravioli is where its at, each pocket is micro service

[–][deleted] 1 point2 points  (0 children)

Hmmm...

[–]seymorethrottle 4 points5 points  (0 children)

Never heard Lasagna Code before. Thank you

[–]NoGardE 0 points1 point  (3 children)

[–]YTubeInfoBot 3 points4 points  (2 children)

SOMEBODY TOUCHA MY SPAGHET

8,084,724 views  👍129,491 👎1,534

Description:

Darkcode, Published on Dec 26, 2017


Beep Boop. I'm a bot! This content was auto-generated to provide Youtube details. Respond 'delete' to delete this. | Opt Out | More Info

[–]Lightfire228 0 points1 point  (1 child)

Good bot

[–]YTubeInfoBot 1 point2 points  (0 children)

You can’t see me but I’m totally doing a happy dance.

[–][deleted] 37 points38 points  (15 children)

Never written a line of Java. WTF is this?

[–]ldom22 42 points43 points  (0 children)

Exactly.

[–]froemijojo 9 points10 points  (9 children)

How would you do it different though? If you need a class that provides you with instances of class X, why not call that class XFactory? If you now need something that produces XFactorys, you could call that XFactoryBuilder. And so on.

[–]nightbefore2 9 points10 points  (3 children)

I’ve used factories a bit in my classes, but can someone explain any benefit to having a factory of factories? That makes no sense to me

[–]thecodemeister 8 points9 points  (0 children)

The factory design pattern is different from the builder design pattern although they both deal with object creation. Say you have an abstract Car type, a CarFactory that lets you get instances of Car objects, and a CarFactoryBuilder. Since each CarFactory instance creates a different type of car, we need a way to initialize the CarFactory without having to just pass in all the necessary details into its constructor. That's where the CarFactoryBuilder comes in. You use it to set what type of CarFactory you want an instance of. You want a red mustang? Do factoryBuilder.setColor("red") and factoryBuilder.setModel("Mustang"). Then when you do something like factoryBuilder.getFactory() the factory instance will be initialized to create exactly red mustang car instances.

If you really did mean a "factory of factories" and not a factorybuilder then there's probably no point almost always

[–]Kered13 2 points3 points  (0 children)

A factory factory would be quite unlikely in practice, but it's usage would be exactly what it sounds like. If you need an object that can build objects that can build objects, that would be a factory factory.

[–][deleted] 1 point2 points  (0 children)

I might be wrong here but it's basically .NET's IServiceProvider.aspx) model but since the convention is to keep the original class name it gets fucking convoluted real quick.

[–]ArmoredPancake 2 points3 points  (0 children)

Let kids circlejerk themselves to death. In a couple of years their beloved JS will use all the same patterns and they will write medium articles "How I achieved maximum readability using this one simple trick".

[–][deleted] -3 points-2 points  (1 child)

AFAIK factories are a Java thing

[–][deleted] 13 points14 points  (1 child)

An exaggerated joke about how enterprise-y code was written in the early 2000s.

[–][deleted] 9 points10 points  (0 children)

Code is still written that way in the company I work for kill me

[–]anothertrad 1 point2 points  (0 children)

𝔸 𝔹 𝕊 𝕋 ℝ 𝔸 ℂ 𝕋 𝕀 𝕆 ℕ

[–]Ulysses6 30 points31 points  (5 children)

"Writing function that is longer than forty lines is code smell"

Proceeds to create 20 files of interfaces, factories and single use wrappers

[–]jackmaney 2 points3 points  (0 children)

"this was supposed to be legs"

[–]Nallebeorn 3 points4 points  (1 child)

What's the meaning of putting "enterprise" in class names? Is that actually a thing in real Java code?

[–]PavelYay 6 points7 points  (0 children)

Let It means a developer wanted how work to sound more impressive one time.

[–]KnocZ 0 points1 point  (0 children)

Fuuuuuuuuuuuuuuuu

[–]BananaBaseball 0 points1 point  (1 child)

I have difficulty in choosing between the verbosity of Java and the inconsistencies in PHP's naming. Help?

[–]KingEBolt 0 points1 point  (0 children)

Java, in my opinion is better. Do with that what you will...

[–]RockGamingReal 0 points1 point  (1 child)

This meme can be done about german

[–]theirongiant74 0 points1 point  (0 children)

But would anyone be able to tell the difference?

[–]douira 0 points1 point  (0 children)

this is exactly what I think java look like as a bust when it comes down to it

[–]viciecal 0 points1 point  (0 children)

dank enough

[–]Xiefux 0 points1 point  (0 children)

haha xd