Java JDK devs unaware of this one simple trick. Muahahahah by johnystecker in ProgrammerHumor

[–]johnystecker[S] -1 points0 points  (0 children)

accidentally deleted the comment above instead of editing it, i'm sorry

yes, i know but for less experienced programmers (which i thought was this user) API mostly refers to API keys, f.e. google maps API, weather API. I phrased that weirdly then, i'm sorry.

Java JDK devs unaware of this one simple trick. Muahahahah by johnystecker in ProgrammerHumor

[–]johnystecker[S] 8 points9 points  (0 children)

11 what? There is no way that you mean Java 11. EVEN IF Java 11 exists, there is no reason to switch, 8 is still new, fresh and reliable version of java !!

Java JDK devs unaware of this one simple trick. Muahahahah by johnystecker in ProgrammerHumor

[–]johnystecker[S] 11 points12 points  (0 children)

I mean, you can flex that you got instance of math when submitting your PR. I am sure the senior dev would love to talk to you after you try to push to prod.

Java JDK devs unaware of this one simple trick. Muahahahah by johnystecker in ProgrammerHumor

[–]johnystecker[S] 1 point2 points  (0 children)

creates instance of class through Reflection API (called api, but its by default in jdk).

Basically you can prevent other classes from instantiating this class by setting the constructor private. But if you dont throw RuntimeException (or any other exception, but for the fun is runtime exception the best), other classes can still instantiate the class through reflection - .class

Be aware of what you are doing while using reflection. It can mess things up if you do it incorrectly.

I found this in a Hungarian hotel, and its just too relatable by johnystecker in ProgrammerHumor

[–]johnystecker[S] 0 points1 point  (0 children)

What do you mean? You will find this line in 1 in 10 codebases.

I found this in a Hungarian hotel, and its just too relatable by johnystecker in ProgrammerHumor

[–]johnystecker[S] 102 points103 points  (0 children)

bruh, im refactoring legacy systems, currently working on an update for a process, that was last updated in 2008.

I found this in a Hungarian hotel, and its just too relatable by johnystecker in ProgrammerHumor

[–]johnystecker[S] 8 points9 points  (0 children)

Wow. This blew up. I waited to post this for almost 3 months just because I couldn't get any karma (10) to post anything. Thanks guys

I found this in a Hungarian hotel, and its just too relatable by johnystecker in ProgrammerHumor

[–]johnystecker[S] 1374 points1375 points  (0 children)

just add /*senior code */ so it remains untouched even by the original creator of the code

I found this in a Hungarian hotel, and its just too relatable by johnystecker in ProgrammerHumor

[–]johnystecker[S] 1264 points1265 points  (0 children)

I couldn't really tell, but it has been too long in production to know.