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

96 Upvotes

161 comments sorted by

View all comments

16

u/da_supreme_patriarch 4d ago

Comments where they don't belong(on dependency imports, build files etc.) javadocs that are just "uncamelcasing" a field or method argument(like @angularAcceleration - the angular acceleration) or just the exact method name in plane English, tautological and heavily coupled to the actual code unit tests(test code checks that the code executes exactly as written, even the slightest deviations in actual code will break the test regardless of what the change is, eve if the program's logic is unaffected), unit tests for toString implementations of random classes where the toString would only affect the logs, random "javascriptisms", a few utils classes even when apache commons, guava or spring are in the classpath, code that is extremely paranoid about null-checking, not using java.time classes for date handling even when the JDK is well above 8, disdain for Optional-s, limited use of records and sealed types(this is a problem specifically with OpenAI models, Claude is somewhat ok here), not using lombok when it's in the classpath and is actively used, randomly introducing lombok to a project that doesn't use it, and a few other things

4

u/Spandian 4d ago

javadocs that are just "uncamelcasing" a field or method argument(like @angularAcceleration - the angular acceleration

That's not an AI thing... IDEs have been able to put boilerplate comments on everything for decades.

7

u/da_supreme_patriarch 4d ago

Correct, but that's completely useless by itself and is supposed to just be a scaffolding for the actual docs, a human doesn't really leave the autogenerated docs in the ide-generated state unless there is nothing to document, but the project rules require every public API to be have javadocs, and as far as I am aware not many projects do that

5

u/vytah 3d ago
/**
 * Sets the up
 */
public void setUp() {

2

u/koflerdavid 4d ago

And LLMs have learned to reproduce that instead of inferring what the purpose of the field is.