r/java • • 5d 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?

99 Upvotes

161 comments sorted by

View all comments

65

u/Ok_Option_3 5d ago
  • Comments saying what the code does not do. 
  • Comments that repeat themselves
  • Vast amount of code with no comments at all
  • Excessively complex clauses all in one statement
  • Flat class structures, where inner classes might make more sense

The tells are the same in all languages.

73

u/xyzsomething 5d ago

"Vast amount of code with no comments at all" ... that's a lot of Java code bases I've seen before 2020, I would actually say the opposite is true, the more comments the more signs it is vibe coded.

"Excessively complex clauses all in one statement"... again I've seen this a lot in very old pre vibe-coding code bases, you have to remember that LLMs are just imitating us.

8

u/Ok_Option_3 5d ago

That's why they are AI tells - not 100% certain proof that AI was involved.

4

u/Wonderful-Habit-139 5d ago

The funniest part is seeing people that use AI, get caught using AI, and then they start telling you things like this. Even though they have already being caught lol.

2

u/-illusoryMechanist 4d ago

I guess I'm an llm because i put probably an excesisve amount if comments in my code

→ More replies (2)

15

u/john16384 5d ago

History lessons. Claude tends to include things in comments or javadoc for how things used to work, or things that were tried during a coding session but rejected. I have to keep telling it to document how things currently work and to skip the history lessons. This is also the reason why I really dislike people that tend to make 5000 commits for one feature, as if all that is actually relevant when it is just back and forth changes.

→ More replies (2)

7

u/dad_farts 5d ago

Excessively complex clauses all in one statement

My style being called out

20

u/barcodez 5d ago

This just sounds like most code written by humans. AI on the other hand adds comments, and generally keeps to good clean design in my experience.

12

u/Head_Evening_5697 5d ago

No. Humans (rarely?) never add comments saying what the code does not do.

6

u/slaymaker1907 5d ago

I'll add it if there's a non-obvious answer why something wasn't done a particular way.

3

u/LelouBil 5d ago

Of course, but that's more of an explanation on why the code is like this.

if you vibe code and don't care you will end up with comments like.

// This methods now only returns the full name of the user, and not the first name only like in the old behaviour.

Basically comments that don't explain the state of the code as it is now (or why is it like this), but explain how it was before. Which is not the point of comments.

6

u/eboob1179 5d ago

I like to screw with people in code review to see if they're paying attention. I leave comments like "//We've been trying to reach you about your car's extended warranty."

→ More replies (12)

10

u/vowelqueue 5d ago

I’ve mostly used Claude and feel that by default it goes really overboard with comments. You can definitely rein it in but a lot of people don’t do that and it’s very easy to tell what code was written with AI by its commenting style.

7

u/_predator_ 5d ago

It's like websites and frontends. You can immediately tell when Claude was used to create them, which is ironic given how simple it would be to avoid it with some small instructions related to styling and font choice.

3

u/coderemover 5d ago

No it doesn’t keep the code clean. It has a very bad taste at how to decompose problems into smaller ones.

→ More replies (1)

2

u/Greenix 5d ago

Comments and clean design in the same sentence is an oxymoron.

→ More replies (2)

3

u/katieglamer 5d ago

I am so bad at adding comments to my code, and do leave myself notes saying what things don't do like // I'm going to need to deal with this thing so it doesn't break the other thing. But what I write is so unhiged I doubt anyone would think it's AI

2

u/Kwese_ 5d ago

Flat class structures, where inner classes might make more sense

In my experience it's the complete opposite. AI loooves to extract things into separate classes, be it inner classes or just regular classes, even when it makes no sense at all.

What I would add: AI also loves to put everything in a helper function. I've seen AI extract Boolean.TRUE.equals(x) into a isTrue(x) helper function.

2

u/Zatujit 4d ago

"I've seen AI extract Boolean.TRUE.equals(x) into a isTrue(x) helper function" tbf sometimes i do thins like this

2

u/Revanchan 4d ago

I have very bad commenting habits (to my own detriment) so I usually have huge blocks of code not commented at all.

3

u/Electrical_Being_813 5d ago

Ai comments actually say what function does. Unlike human

3

u/koflerdavid 5d ago

As long as somebody bothers to keep them in sync whenever the code changes in the future...

1

u/Aulodia 5d ago

i *very* rarely add comments so this explains alot lol

2

u/Odd_Percentage6799 2d ago

Lack of comments isn't an AI tell. 

Claude for example will comment the shit out of a codebase.  Likely a decision by anthropic to help with context when it returns to its own code. 

In contrast, my company favours humans avoiding comments altogether with detailed explanations in commit messages instead. 

1

u/agentoutlier 5d ago

Oof... except for that first one and maybe that last one my code falls in to a lot of that I think although I'm not sure about the clause one.

→ More replies (4)