r/java • • 14d ago

Telltale signs of Vibecoding in Java?

Someone recently flagged one of my mods as being "obviously vibecoded" (which it wasn't), so I appealed the decision. just out of curiosity, what exactly are the signs people are seeing when accusing code of being vibecoded?

109 Upvotes

167 comments sorted by

View all comments

11

u/vips7L 14d ago

Defensive bullshit that no one should worry about. Like record constructors for dtos that copy collections. 

7

u/ukobg 14d ago

defensive copy can actually be useful no? I feel like the scenarios where it would break are not that edgy

3

u/vips7L 14d ago

Yes it’s useful if you’re worried about the hashcode of a record changing if you stuff them into sets. But when it’s a simple record for pushing data over a web response it makes absolutely no sense to defensive copy, especially if the whole object graph of the stuff in the collection isn’t immutable.  It’s only some an LLM will worry about. 

    return Response.ok()          .entity(new WhateverDto(list))          .build()

3

u/Milyardo 14d ago

Not using an immutable collection in a dto seems like the bigger issue an LLM would miss in those situations.

3

u/Cell-i-Zenit 13d ago

Defensive bullshit that no one should worry about. Like record constructors for dtos that copy collections.

alot of guards in a class for null etc, which were already ruled out earlier etc.

For example you have a relationship with hibernate and call parent.getChilds(), and the ai is doing a null check on that for some reason