3 ms·
You're correct ... in theory. At least in this project example code, i see tons of empty class like Result.java with empty content, on separate file. So is th
by revskill 3y ago
You're correct ... in theory.
At least in this project example code, i see tons of empty class like Result.java with empty content, on separate file.
So is this normal convention for Java dev ? No eslint (or similar tool) to prevent boilerplateness ? That's my point.
Do you Java dev have strict standard on prevent such things spread on all codebase, ecosystem,... ?
- galdosdi 3y agoWell, I can't speak for how others write Java. It's like any other language -- if a function or file or class is growing too big and complex, you split it up. If you have several that are too tiny and they are logically related, you can group them together. For some reason, some early java devs got the idea that you weren't allowed to have multiple classes in one file (an easy misunderstanding if you follow a Hello World tutorial and stop learning) so yeah, you'll find plenty of projects that have a bunch of class file with 3 lines. So what? If you find this kind of mistake in a project you're working in, it's going to be very easy to refactor it safely, since Java is statically typed and IDEs like IntelliJ can use that static typing to make moving classes around extremely safe.