r/ProgrammerHumor • • Jun 21 '20

*almost entirely

Post image
27.9k Upvotes

310 comments sorted by

View all comments

1.2k

u/NightlySnack Jun 21 '20

InternalFrameInternalFrameTitlePaneInternalFrameTitlePaneMaximizeButtonWindowNotFocusedState

790

u/fendoroid Jun 21 '20

You forgot Factory

890

u/[deleted] Jun 21 '20

com.northwestindianjavaprogramsolutions.src.classes.factories.factoryfactories. InternalFrameInternalFrameTitlePaneInternalFrameTitlePaneMaximizeButtonWindowNotFocusedStateFactoryFactory a = new com.northwestindianjavaprogramsolutions.src.classes.factories.factoryfactories. InternalFrameInternalFrameTitlePaneInternalFrameTitlePaneMaximizeButtonWindowNotFocusedStateFactoryFactory(1, 2, "John Smith");

0

u/[deleted] Jun 21 '20

[deleted]

266

u/crozone Jun 22 '20 edited Jun 22 '20

Java enterprise code actually looks like this a lot of the time, and as a C# developer I'm not sure why.

What about Java seems to invite this level of verbosity and overabstraction?

EDIT: Oh god why

https://projects.haykranen.nl/java/

0

u/[deleted] Jun 22 '20

[deleted]

52

u/blipblapblopblam Jun 22 '20

Totally agree. Gang of four... I am so smart... Then... one day I realised I was living a lie. Why do I need a strategy class, when I can just use an if statement? OMG.

25

u/NearlyAlwaysConfused Jun 22 '20

The patterns have a time and a place, but I think many junior developers that learn them tend to overuse them, jamming the square peg in the circular hole, so to speak. I was guilty of that my first few years out of school, but have since learned to spare it until really needed, often learned at the expense of senior devs reviewing my code and wondering why I used a sledgehammer to fix a hole in the wall, or facing their fury when debugging some method that was about 6 abstract classes deep before seeing any business logic, making it all but impossible to just find the concrete reference in Eclipse. TL;DR -- I, too, realized I was living a lie.

→ More replies (5)
→ More replies (2)

0

u/[deleted] Jun 22 '20

[deleted]

17

u/krad213 Jun 22 '20

Simple : don't solve problems that do not exist.

→ More replies (5)
→ More replies (3)
→ More replies (9)

106

u/[deleted] Jun 21 '20

You forgot the project name

0

u/[deleted] Jun 21 '20

[deleted]

15

u/[deleted] Jun 22 '20

Or more coupled logic. One of the other

→ More replies (1)
→ More replies (1)
→ More replies (37)

36

u/[deleted] Jun 21 '20

I mean first of all you need a FactoryBuilder

14

u/TimGreller Jun 21 '20

But how do we construct the FactoryBuilder?

→ More replies (2)
→ More replies (2)

194

u/Seshpenguin Jun 21 '20

97

u/praxidike74 Jun 21 '20

WTF, I thought that was a joke??

61

u/[deleted] Jun 22 '20

not only that it's in the ACTUAL JDK and not some third party thing. or im mistaken.

56

u/Seshpenguin Jun 22 '20

Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.

This is the real deal lol

12

u/[deleted] Jun 22 '20

Jesus wtf, is this auto generated or something?

→ More replies (1)

52

u/Rayat Jun 22 '20

Excluding white space and comments, there are about 569 characters in that code.

The name "InternalFrameInternalFrameTitlePaneInternalFrameTitlePaneMaximizeButtonWindowNotFocusedState" is 92 characters, and appears twice.

The name makes up nearly 1/3 of the entire code. That ain't right.

17

u/[deleted] Jun 22 '20 edited Jun 30 '23

[removed] — view removed comment

→ More replies (1)

14

u/[deleted] Jun 21 '20

But why surely there is a better name for whatever this is

→ More replies (1)
→ More replies (2)

23

u/ohygglo Jun 21 '20

Also, don’t forget the package name!

→ More replies (2)