r/ProgrammerHumor • • 6d ago

Meme justYourNormalJavaDeveloper

Post image
1.5k Upvotes

157 comments sorted by

218

u/CptGia 6d ago

I unironically just wrote a AuthorizationDetailsOAuth2ClientCredentialsAuthenticationConverter, for a spring security converter that handles the client_credentials grant with support for RFC 9396 OAuth2 Rich Authorization Requests.

Your memes have no power over me. 

3

u/tatstytastycakes 6d ago

meme is everything

77

u/buttplugpopsicle 6d ago

Yeah fuck that shit, I'm going to name my class what the fuck it is, why complicate my own life with StrBrkStDwn()?

41

u/DOOManiac 6d ago

A string function that breaks shit down. What’s not there to understand?

34

u/galileo34i 6d ago edited 6d ago

its a string that barks then sits down … I see where the confusion could be, though

14

u/bosoxfan77 6d ago

No you guys are missing the business context. It’s actually a function for a robot that sits down at every “street break” (intersection)

5

u/ataraxianAscendant 6d ago

no, i'm pretty sure this is the function for the store breaks in saint dawn

1

u/AviatorSkywatcher 5d ago

Nope, that function actually sets down strong bricks

24

u/MyAntichrist 6d ago

Honestly, this swings towards the better use cases for elaborate class names. Everyone looking into the project tree will be able to figure out what that class does, and that's a good thing.

7

u/SweetBabyAlaska 6d ago

Is it? compared to something like Auth.Credentials.Converter(client: *Client);

where everything is managed within its own namespace

8

u/Ok-Scheme-913 6d ago

So you created 2 classes (=namespaces) that do absolutely nothing just to wrap your class that does something in two layers?

Depending on whether you have more Auth flows it may make sense, but if not then it's arguably an even more convoluted setup.

3

u/Responsible-Bar7165 4d ago

namespaces literally exist to make things more easy to read.

1

u/wor-kid 9h ago edited 8h ago

Primarily they exist to prevent naming conflicts. Any improvements to readability are strictly coincidental (And probably a smell with the original name).

1

u/Responsible-Bar7165 8h ago

it's possible to resolve naming conflicts without namespaces, it just results in reduced legibility.

1

u/wor-kid 7h ago

Just to make sure we're on the same page, do you mean for example wrapping classes like java.util.Date and java.sql.Date in something named UtilData and SqlDate?

I suppose I can see your point but I think it's a matter of opinion if it results in reduced legibility or not. I personally would rather not directly reference the FQN if I can avoid it.

But I'll accept it's often nicer to just use a more simple name when it's clearly referring to some colocated impl. In that way I'll admit using a package/namespace is fundamentally being used to make things more easy to read (But only within the package it is defined), even if it is using a mechanism to avoid conflicts.

-1

u/SweetBabyAlaska 6d ago

I'm literally just copying the Java name and what it implies, take it up with them. My point is that encapsulating these things properly, you get something that is terse and adequately describes what it is doing.

1

u/wor-kid 9h ago edited 9h ago

Now here, it feels like you are comparing apples and oranges here. You can't just dismiss the lost information in the name and call it equivalent. If that name was adequate they could have simply called their class i.e.

AuthCredentialsConverter. Which is more terse than the suggested Auth.Credentials.Converter if terseness should be a concern at all (Usually not since they are hiding behind a sensibly named interface)

1

u/SweetBabyAlaska 7h ago

you don't need the name to express every component and action that could possibly be taken and their name, despite being longer than any word in the english dictionary, doesn't actually express that much meaningful info in the first place.

You don't need all that fluff to convert a form of credentials in another, and the client or the auth implementation can carry the details for the most part. Sure, my example is not the greatest, but what is there even to go off of.

and in no world is `AuthorizationDetailsOAuth2ClientCredentialsAuthenticationConverter` sane.

like the following barely even means much more than what I wrote when you break it down

  • AuthorizationDetails
  • OAuth2
  • Client
  • Credentials
  • Authentication
  • Converter

but I can guarantee that there is a terse and logical grouping for these things based on what I said.

1

u/wor-kid 6h ago edited 4h ago

Well... I wasn't really arguing if it's a good name or not. Once a name gets that long it's due time to break it down and pass in the specifics of the behavior as dependencies. But luckily such a specific name tells me that immediately. As for if it makes sense or not, it's impossible to tell unless we know what was there before that implementation. It could be running in parallel with some nasty legacy ldap auth system or something that it needs to share an interface with. Personally I disagree with the assertion that the name of concretions shouldn't express the actions and methods (*As in how it accomplishes it's action/side-effect, not the actual abstract methods of the interface) used by an implementation. In fact it's pretty much everything I want a type name to express. Leave the abstract high-level nomenclature to the interfaces which consumers will interact with.

If you intend to put it in a package like, idk, org.sweetbabyalaska.app.permissions.converter.oauth2.Auth, I suppose it's alright until you need to start referencing other classes with the name Auth. Because then you're back to using the FQN which isn't any better than the existing name.

But back on track - What I am saying is 1) information is lost when you change the name from what it was to what you suggested, regardless if they are important details or not (Impossible for any of us to tell without seeing the code), and 2) using a namespace (package) doesn't automatically make the name any more or less readable or terse.

1

u/RyanStonepeak 5d ago

Sometimes you really need package protected access. I wish that java had a way to grant package access to a specific class in another package. Alas, it does not without some really weird inheritance shenanigans.

1

u/ssssssddh 5d ago

This comment reminds me of the recent `make_u32_from_two_u16` Linus rant

2

u/BlurredSight 5d ago

JPA Repositories letting you do entire SQL queries mapped to Spring entities as a function name does go crazy though

6

u/BanditoRojo 6d ago

This is why widescreen monitors are a necessity for Java development.

1

u/AloneInExile 6d ago

While you are it ship everything in a com.company.auth package.

With 300 Other classes like that.

1

u/CMDR_ACE209 6d ago

You just did this so you don't have to write a javadoc comment for the function, right?

1

u/CMDR_ACE209 6d ago

You just did this so you don't have to write a javadoc comment for the function, right?

1

u/ConcernUseful2899 6d ago

That's way too short I still don't understand what it does by the name.

1

u/Jumpy_Fuel_1060 6d ago

What does your class do?

4

u/CptGia 5d ago edited 5d ago

So, this class lives in an app that implements an OAuth2 Authorization Server. It's part of the token endpoint that creates access token JWTs. 

First, it delegates to the standard spring converter to extract the client_credentials parameters from the request into an authorization object. Then, it extracts and validates authorization_details from the request's additional parameters, and adds it to the authorization object. This object is eventually authenticated and turned into an authentication principal.

Basically I'm augmenting the JWT that my authorization server is creating with an additional claim that add details to the authorization scopes, turning "can send an email" to "can send an email but only to the domain xyz.example.com"

3

u/BooxOD 5d ago

Are you an actual programmer or something, this sub is for larpers only.

1

u/luisrcdias 5d ago

Please refactor so that the RFC 9396 is present in the class name.

1

u/Hindulaatti 1d ago

Needs more Abstract and Factory

368

u/Luzzgar 6d ago

Hot take, I would rather have a name that is too long than too abreviated.

C style function names like itoa() are impossible to understand without looking them up.

107

u/tatstytastycakes 6d ago

and then those functions and parameters in win32 with that stupid hungarian prefix

83

u/andreortigao 6d ago

Ffs, I had a boss who would use terribly useless Hungarian notation for everything. He used 'o' for object, 's' for string, 'i' for numbers.

Something like

Person oPerson = new Person();
oPerson.Name = sName;
oPerson.Age = iAge;

Made me die a little inside every time I had to maintain his code.

36

u/gerbosan 6d ago

Their IDE was Windows Notepad?

32

u/tatstytastycakes 6d ago

their ide was a typewriter with paper and ink lol

12

u/andreortigao 6d ago

When I joined he was already using visual studio

But yes, I've seen him editing some code in notepad... I'm not sure if this is what he mostly used before, but I wouldn't be surprised.

I know he lost some code for a few projects before I joined due to not making backups. Several projects had [pagename]_bkp.asp files because he wasn't using source control. When I joined he had just started using visual source safe.

2

u/srout_fed 5d ago

I am relatively new and have never seen this shit before(Thank god!)... Who the hell came up with that?!

....it was because of low memory, wasn't it?

1

u/tatstytastycakes 2d ago

i think it was to act as shorthands for devs to get quick recollection of the purpose/return types since this was before ide tooltips and whatnot allowed for people to just know automatically what the function's purpose/return types were so they implemented these so that they could recollect easily

5

u/andreortigao 5d ago edited 5d ago

There are valid cases to use Hungary notation, not due to low memory, but a limitation of the type system. It helps when you're dealing with two values that represent different things but have the same type.

For example, 20 years ago the security for web development was pretty much non existent, web frameworks were primitive, making xss attacks pretty common.

Any user provided string that needed to be displayed on the browser for other users had to be sanitized, otherwise the string could contain "<script ...>" tag that would make the browser render the script and steal other user's cookies. We needed to replace < > with & lt; and & gt; respectively.

So a good use of Hungarian notation would to use 'us' for unsafe string and 'ss' for safe string.

So you could have code like

string ssUserName = toSafeString(usUserName);
ssRender(ssUserName);

If a developer forget to call the sanitization, it was pretty easy to catch either of these on code review:

string ssUserName = usUserName;

Or

ssRender(usUserName);

The problem is stupid people like my boss reading about something, not understanding what it's for, and using it wrong.

Some languages like F# circunvent this by providing unit of measures (also called phantom type in rust), that allows you to declare variables like this:

let safeStr: string<safe> = % "trusted data"
let unsafeStr: string<unsafe> = % "user input" 

10

u/uvero 6d ago

The Hungarian notation can go fuck itself

1

u/tatstytastycakes 6d ago

i am so sorry for you

10

u/andreortigao 6d ago

Thanks, but that was ~20y ago, I've done enough therapy to recover from it by now

4

u/tatstytastycakes 6d ago

happy to hear

oh yeah and i had a crisis over understanding vulkan

THANK GOD I USED THE VK-RAII HEADER THAT STUFF SAVED MY LIFE

3

u/MehPropy 6d ago

counter strike developers do this for classes

m_fFlags, m for member field and f for float, imo it just looks readable and it's not overused

5

u/menzaskaja 6d ago

hát akkor a jó... /s

74

u/MakeoutPoint 6d ago

Ah yes, the Legend of the Feet Var

"Had this weird var called feet, didn't know why. Turns out originally it was 'legendHandlers', then later shortened to 'legHands' then later to 'feet'"

5

u/calamariclam_II 6d ago

Itoa is pretty easy actually. It stands for into anus

3

u/mafiazombiedrugs 6d ago

Bro, going from mainframe hlasm (max 8 char var names) to java was like putting on glasses for the first time.

-9

u/ElectricSpock 6d ago

The problem with Java names stems from conventions and OOP patterns.

That’s how you end up with DomainNameResolutionProviderFactoryBuilder.

31

u/Luzzgar 6d ago edited 6d ago

It's perfectly descriptive and reflects the architecture of that piece of software.

It's an architectural problem, it's not really a problem of naming convention problem.

8

u/ryosen 6d ago

Still a hell of a lot better than var a;

-6

u/birdieonarock 6d ago

Counter point, I'd rather have a short incomprehensible name than a long incomprehensible name.

Counter counter point: AI advances mean soon I won't be reviewing code anymore so idgaf I guess.

-9

u/Trotan_ 6d ago

hot and embarrassing take

82

u/budgiebirdman 6d ago

Oh no, my code is verbose. The shame of people being able to understand it. The horror.

20

u/tatstytastycakes 6d ago

dramatic gasp THE CLASS NAME ISN'T FOO!?

13

u/WawaTheFirst 6d ago

Nope. It's Bar.

79

u/TeraFlint 6d ago

Honestly? As long as the name is self-explanatory, I'm fine with it. Sure: the longer the name, the more specific the use case of the class (and it's worth investigating if it could be replaced with a more general abstraction), but it's much better than a hastily/incompetently named class Foo whose name says NOTHING about what it does.

6

u/tatstytastycakes 6d ago

i agree that descriptive classes are a good thing, but i feel like there's a bit of a limit to when you stop making classes "descriptive" and make then "unnecessarily verbose"

5

u/TeraFlint 6d ago

I think proper namespacing/packaging could help there.
the namespace would still carry the hierarchical use case information, but the class name itself would be shorter, and language features could be used to locally strip the class of its namespace.

2

u/tatstytastycakes 6d ago

yeah that makes sense

16

u/TOGoS 6d ago

My take: The design of the Java language drives the shape of the ecosystem around it, including the need for explicit definitions for very specific cases. Early Java didn't have generics or lambda expressions, which nudged people towards writing re-usable classes for things that these days might just be a `this::someMethod`. And then they saw that they were doing that in multiple places, so they made a package with those definitions. And therefore they needed names that did some of the explaining of what this class was for, because without the original context you'd otherwise be saying a lot of "WTF".

In a similar way, lack of stack-allocated objects drove everyone towards re-using heap objects, which is why things tend to be a giant web of mutable state instead of nice pure functions that you could get away with in e.g. C++ since the C++ compiler is free to inline things and elide unnecessary copies.

11

u/Ulrich_de_Vries 6d ago

On the flip side this paradigm is heavily outdated and unnecessary in Java. The language is pretty much moving towards immutable algebraic data types, and decoupling data from behavior, as outlined in e.g. the article "Data oriented programming in Java" by Brian Goetz (the lead architect of the language).

I don't expect it to disappear completely due to all the legacy stuff and bloated (but useful) frameworks, but this is a sooo much more pleasant language now than it was in the olden times.

1

u/SweetBabyAlaska 6d ago

I personally think composition and data oriented programming is as close to "correct" as we have come so far.

2

u/Ok-Scheme-913 6d ago

I think history disagrees with you a bit.

Most of this extra verbosity comes from the Design patterns that were very popular at the time. And not for java, they originate from c++! (Take a look what language gang of four book uses)

Java just sort of became the de facto language for large companies, and it was stable enough for these complex monstrosities to not crumble under their own weights. While C++ in that style was absolutely chock full of memory vulnerabilities, so it was mostly dropped in this domain (banks, backends etc).

2

u/TOGoS 5d ago

Java just sort of became the de facto language for large companies, and it was stable enough for these complex monstrosities to not crumble under their own weights.

No disagreement that the design patterns du jour were part of it. That the JVM being a relatively solid piece of engineering despite the language being kind of crappy is also a huge factor.

Dev: "My monstrosity ran out of memory!"

Lead engineer: "-Xmx2g"

Manager: "Good work everyone! You're really crushing it this sprint. We'll send the implementation team to the client site to adjust the memory settings next month."

28

u/much_longer_username 6d ago

Look, Emo was popular when the conventions were being established, what do you want?

Example song titles:
"Our Lawyer Made Us Change The Name Of This Song So We Wouldn't Get Sued"
"It’s Hard To Be Religious When Certain People Are Never Incinerated By Bolts Of Lightning"
"It's Not a Fashion Statement, It's a Deathwish"
"A Detailed and Poetic Physical Threat to the Person Who Intentionally Vandalized my 1994 Dodge Intrepid Behind Kate's Apartment"
"Good To Know If I Ever Need Attention, All I Have To Do Is Die"

You think they're going to name a class something like foo? c'mon!

16

u/tatstytastycakes 6d ago

c++ namespaces be like

Persistence::EntityIdentification::ImmutableSurrogateKeyPrimitives

meanwhile the contents of that namespace

struct Id {
    int v;
};

i am thoroughly convinced that c++ devs just do that because it looks pretty

6

u/Piisthree 6d ago

IWriteTragediesNotClasses.java

3

u/bubzor888 6d ago

How could you forget "We Provide the Paint for the Picture-Perfect Masterpiece That You Will Paint on the Insides of Your Eyelids" by Bandits of the Acoustic Revolution (B.O.T.A.R.)

3

u/MyAntichrist 6d ago

My favorite take on the emo band thing was Matt Heafy of Trivium with his mock song "Head-on Collision With A Rosebush Catching Fire".

3

u/pindab0ter 6d ago edited 6d ago

Let me tell you about a song by The Chariot called Someday, In The Event That Mankind Actually Figures Out What It Is That This World Revolves Around, Thousands Of People Are Going To Be Shocked And Perplexed To Find Out That It Was Not Them. Sometimes This Includes Me. from the album Everything Is Alive, Everything Is Breathing, Nothing Is Dead And Nothing Is Bleeding.

21

u/johnnybgooderer 6d ago

I don’t understand why people hate long names. It’s nice knowing what code does at a glance. Instead of just “token” in an app with multiple token types.

12

u/tatstytastycakes 6d ago

long names aren't bad, descriptive names are nice.

but sometimes the names are very verbose and use a bunch of fancy words and just feel like bloat

if i have a dice function that returns a random number, i'd rather it be simple and descriptive like diceRollFunction rather than executeSingleDiscreteUniformRandomNumberGenerationWithinInclusiveUpperAndLowerBoundsToSimulatePolyhedralDieRollOutcome

one is descriptive and understandable, the other is unnecessary verbosity that demands a PhD

1

u/Ok-Scheme-913 6d ago

The other is a meme.

Like the most egregious example I have seen in actual code bases are possibly some internal spring classes.

But they actually are often FactoryFactorys so they have that going for them.

10

u/itsTyrion 6d ago

meanwhile C and Go devs: 1 LETTER, 2 ON A GOOD DAY, TAKE IT OR LEAVE IT 

3

u/tatstytastycakes 6d ago

meanwhile python devs be like

I_SWEAR_TO_GOD_THAT_I_AM_NOT_CRAZY_GUYS

7

u/funplayer3s 6d ago

Only a four word title?

justYourNormalJavaDeveloperWorkloadHandlingManagementSystemicCurator

6

u/tatstytastycakes 6d ago

yesIWouldLikeToApologizeYouAreAbsolutelyRightHowCouldIHaveMadeSuchARookieMistake?

1

u/funplayer3s 6d ago

NOW we're working with visual basic.

2

u/UnpluggedUnfettered 6d ago

Meanwhile C++ devs like

class DataMgr

2

u/funplayer3s 6d ago

This legacy codebase has 73 DataMgr and they are all different formats with different headers.

3

u/trade_me_dog_pics 6d ago

Please don’t bring up my trauma

4

u/tatstytastycakes 6d ago

sorry that the caption takes the full size, i didn't have a way to fit it on the screen without making it cover the full gif.

will try next time to see if i can avoid this issue

5

u/ClipboardCopyPaste 6d ago

fit the screen

you could have written a java class name

2

u/tatstytastycakes 6d ago

if i did that then it would have been even longer

4

u/ChapterSevenSeeds 6d ago

This isn't Java, but I came across this C# gem a few years ago:

class BoundTreeRewriterWithStackGuardWithoutRecursionOnTheLeftOfBinaryOperator

Found here

1

u/sleeping-in-crypto 6d ago

What? No FactoryFactoryFactoryFactory?

3

u/MasterGeekMX 6d ago

For a moment I thought I was on r/MinecraftMemes.

3

u/letmehaveanameyoudum 6d ago
class ThisIsAclassThatIDontKnowHowToNameButOtherDevsWouldScreamAtMeIfIUseTheSameClassNameSoCheeseChesseCheeseCheeseCheese

4

u/tatstytastycakes 6d ago
class CheeseCheeseCheeseCheeseCheeseCheeseCheeseCheeseCheeseCheeseCheeseCheeseCheeseCheeseCheeseCheeseCheeseCheeseCheeseCheeseCheeseCheeseCheeseCheeseCheeseCheeseCheeseCheeseCheeseCheeseCheeseCheeseCheeseCheeseCheeseCheeseCheeseCheeseCheeseCheeseCheeseCheese

3

u/letmehaveanameyoudum 6d ago
class AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

1

u/tatstytastycakes 6d ago
class WHATWASTHEPLOTBROIFORGOTWHATTHEPLOTWASWHATWEREWEEVENDOING

2

u/gain91 6d ago

So like those Isekai novel titles

3

u/tatstytastycakes 6d ago

yes

happy cake day

109

u/PhilippTheProgrammer 6d ago

The name of my AbstractButtonControllerFactoryPropertyListEntryBuilder isn't that long.

3

u/Detfinato 6d ago

Oh no! My extremely readable / verbose class name in the source code that is transpiled to a few bytes and totally equivalent to any other class name at run-time is too long! Those extra 5-10 characters will surely waste my time reading and bandwidth for my gigabit symmetrical fiber connection! Waaa!!

1

u/tatstytastycakes 6d ago

how python devs feel having to write __name__ == "__main__":

1

u/aberroco 6d ago

Scientists and mathematicians naming their functions λ and γ_1 in their python code.

1

u/tatstytastycakes 6d ago

who decided to name it lambda functions anyways??? why did lambda need to become anonymous like a 4chan user for us???

1

u/y0shii3 6d ago

The association of variable-capturing functions with the letter lambda comes from Alonzo Church's lambda calculus. He's one of the original GOATs of computer science

1

u/tatstytastycakes 6d ago

nice

and yeah a goat lambdas are freaking awesome

1

u/stjeana 6d ago

better than cookie and cake

1

u/tatstytastycakes 6d ago

omg its clippy

1

u/Dabbelju 6d ago

Rage bait: I use a proportional font (IBM Plex Sans SemiCondensed) in my IDEs. Makes long identifier names so much easier to read.

1

u/tatstytastycakes 6d ago

Dabbelju used rage bait, it's super effective!

1

u/Puzzleheaded-Weird66 6d ago

I prefer that, I even name my sql params and alias like that

1

u/tatstytastycakes 6d ago

you use sql? wait, i'm sorry...

YOU USE SQL? OH, THAT IS VERY NICE TO HEAR!

(ok but lets put aside all jokes)

3

u/iStumblerLabs 6d ago

Laughs in Objective-C

1

u/Glittering_Sail_3609 6d ago

I have a gut feeling that OP never saw a heavily templated C++ code.

1

u/tatstytastycakes 6d ago

i have seen that code

my brother in christ

who does that with a straight face?

1

u/Rojeitor 6d ago

strategyComandBuilderFactory

1

u/tatstytastycakes 6d ago

strategyCBFactory

idk i just felt like saying this and honestly it's worse

2

u/Jediweirdo 6d ago

We live in the age of autocomplete, so such squabble means nothing to me

1

u/maklever 6d ago

I really love to make AmongUs 2020 jokes in my code for some reason So yeah SusButtonRed

1

u/zirky 6d ago

do people not use code complete? like, every ide has code complete. you don’t have to type all that

1

u/Acclynn 6d ago

My first thought to this is that I'm wondering if LLMs might be more token-expensive when working on Java just because of this

1

u/CrimsonPiranha 6d ago

CS first semester joke

1

u/Alacritous13 6d ago

Some of you don't have to deal with strictly imposed variable name lengths, and it shows.

1

u/Shinare_I 6d ago

2-4 full words, no abbreviations. Anything else should require good justification and a review.

1

u/TxTechnician 6d ago

I wrote one small Java program years ago. And I was like, nah, this language is not for me.

1

u/InStars 6d ago

But it's great, just hit Ctrl+N in IntelliJ and type some words you know and BAM - the right class opens!

1

u/NightIgnite 5d ago

My monitor is 1920 pixels wide, Im going to use all 1920 pixels

1

u/Caveking 5d ago

No mental mapping and principle of least surprise. In a sufficiently complicated code base you will have methods that are complicated enough to warrant a long name. As a maintainer, I’d much rather have a long and detailed name than one I have to reread every few weeks to understand.

1

u/Sad_Shop4 5d ago

just imagine writing comments also

1

u/chrisebryan 5d ago

I remember someone using emojis instead of text in class names, so there is that too...

1

u/dillanthumous 5d ago

I prefer verbose classes. It doesn't take much longer to read a long class name. Understanding what a vague class is for on the other hand.

1

u/billabong049 5d ago

I don't mind long names EXCEPT when they get excessively long due to unnecessary abstraction. I had some dudes at my last job that abstracted the fuck out of everything and made the code impossible to maintain and a nightmare to modify (wanna pass another parameter to this service? Update 8 different interfaces and pojos.) and I hated seeing stuff like `AbstractServiceAdapterHandlerImpl` after 8 layers of that same shit, like, where's the actual fucking implementation? Is it absolutely necessary that we have so many layers of abstraction to call some trivial services? Would it be that bad if things were more tightly coupled in this monolithic app that no one else is going to extend or share code with? Jeebus.

1

u/Havatchee 4d ago

It strikes me that the overlap between people who say, "I don't need comments, good code is self documenting," and people who hate on Java Devs for writing names like this is probably significant.

1

u/GrimReaper2601 4d ago

Don't judge me, I need my CustomerOrderProcessingEventHandlerManagerFactoryBuilderImpl or the enterprise will collapse.

1

u/Matwyen 2d ago

If you ever worked on a project spanning multiple years and people, you know 

public class XMLBicExtractor implements Extractor<BicDto>
public class BicValidator implements Validator<BicDto>
public class XMLBicNotAllowed extends BicException

Is a super verbose way to do what python would do in a single line, but you also know 10 years from now, when someone will need to modify that code with new business logic, the full app won't break because you're not here to babyseat things like regex.split()[::-1].replaceAll("X", "") shenanigans 

You already know that when PO will ask if we can integrate Json format, add a new allowed bic, change validation rules,... The implem will be cleaned, business and technical issues are already split, ...

Basically: why I got to love Java is because, by design, you can force your legacy code to be easy to maintain. That's not the case if you're not forcing yourself to writr meaningful variable names in python.

1

u/El-yeetra 12h ago

don't talk to me or my InternalFrameInternalFrameTitlePaneInternalFrameTitlePaneMaximizeButtonWindowNotFocusedState or my HasThisTypePatternTriedToSneakInSomeGenericOrParameterizedTypePatternMatchingStuffAnywhereVisitor ever again

0

u/Grtz78 6d ago

DonauDampfSchiffKapitaensPatentAmtManager

1

u/tatstytastycakes 6d ago

moly holy

1

u/JAXxXTheRipper 6d ago

Germany had a law that was called Rindfleischetikettierungsüberwachungsaufgabenübertragungsgesetz, it's short-form was RkReÜAÜG. German allows the creation of infinitely long words, it is the Java of languages

No classname is too long for us, this is rookie shit

1

u/tatstytastycakes 6d ago

how much perfection

1

u/JAXxXTheRipper 6d ago

That doesn't even make sense

1

u/Grtz78 6d ago

Like 99% of the class names I encounter on new projects. In short: Perfection

0

u/frozen-dessert 6d ago

How to tell you are still in school, without saying you are still in school

0

u/XxasimxX 6d ago

This joke wasn’t even valid 10 yrs ago, how are ppl still making this joke?

1

u/Wise-Variation-4985 4d ago

Was just gonna ask this, saw the same on LinkedIn

-8

u/Amadex 6d ago

Java and C++'s OOP bloat are the bane of programming

1

u/tatstytastycakes 6d ago

writing c code feels therapeutic until i have to write a single malloc or use *

something is wrong with me

1

u/Right_Ear_2230 6d ago

at least C++ does not require OOP bloat

1

u/Z3t4 6d ago

I paid handsomely for my UltraWide, and I'm gonna use every damn inch!