Comment by tedk-42
Comment by tedk-42 2 days ago
I'd swap java with go any day of the week. I never liked how much 'code-padding' is required with java `public static void main`
Comment by tedk-42 2 days ago
I'd swap java with go any day of the week. I never liked how much 'code-padding' is required with java `public static void main`
Always find 'java is verbose' to be a novice argument from go coders when there is so much boilerplate on the go side of things that's nicely handled on the java side.
It's rich to complain about verbosity coming from Go.
Nonetheless, Java has eased the psvm requirements, you don't even have to explicitly declare a class and a void main method is enough. [1] Not that it would matter for any non-script code.
For Java 25 which is planned to be released in a couple of weeks:
----- https://openjdk.org/jeps/512 -----
First, we allow main methods to omit the infamous boilerplate of public static void main(String[] args), which simplifies the Hello, World! program to:
Second, we introduce a compact form of source file that lets developers get straight to the code, without a superfluous class declaration: Third, we add a new class in the java.lang package that provides basic line-oriented I/O methods for beginners, thereby replacing the mysterious System.out.println with a simpler form: