abhiyerra 18 minutes ago

I learned to read line as the following in Java 1.2 so the Scanner class is new to me. :p

  BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
  String input = in.readLine();
adgjlsfhk1 16 minutes ago

It's amazing that ~30 years on, Java is finally becoming a not horrible programming language.

  • willvarfar 2 minutes ago

    I'm someone who wrote a lot of 'raw' Java and C++ without frameworks, which meant there was a lot less boilerplate and indirection etc. And for me, the big usability bump came about 10 years ago, around the same time for both Java and C++, when they started supporting lambda functions. I started passing code into algorithms and, although it sounds quite complicated, it simplified my programs substantially.

  • voidfunc 4 minutes ago

    Meanwhile some languages like Python still suck 30 years later.

  • bigstrat2003 7 minutes ago

    Java was never a horrible programming language. The hate is wildly overblown.

  • vincnetas 5 minutes ago

    Most likely you have not seen horrible languages or your bar for being not horrible is quite high.

yohannesk 16 minutes ago

Why not abstract away the public static void main(String[] args) method with a top-level statement paradigm, similar to C#'s entry point simplification, to reduce boilerplate and enhance code conciseness?

furyofantares 16 minutes ago

We got there just after we got the ability to legitimately create useful small programs without understanding any of the thousands of lines of code.

TZubiri 5 minutes ago

Ugly? Sure. But isn't this the identity of Java? Taken away for almost no gain, there's literally no real issue stemming from requiring a verbose incantation to write a main routine, this is something you learn like day 1 on learning java, and it's something you write once in a blue moon, like 0.001% of the code you are going to write.

It reminds me of the attempt at removing Richard Stallman from the FSF, yeah, you could do that and fix a problem, but then what you are left with isn't really the same thing as it was before, it's now actually the same soulless thing as the rest of the competing things.

Saving grace is that obviously, you can still recite the incantation, it's not like public static void main(String[] args) is gone, just that you can skip it.

another_twist 9 minutes ago

This is not a prank right ? Is it really gone ?

Panzerschrek 13 minutes ago

So, Java now supports free functions (not associated with some class). Or not really yet?

  • vincnetas 6 minutes ago

    I think all functions are associated with some class. But these classes sometimes are hidden from you and you don't need to know about them. Does that help you? What for would you use true free functions?

    • throwaway47461 5 minutes ago

      > What for would you use true free functions?

      The same things people use free functions for in any other programming language.

  • TZubiri 4 minutes ago

    Presumably these exist in a Main.java file and the java class is implied. Similarly the string params are also implied, and the non param main() function is just an alias or a wrapper for main(String).

    It's just syntactic sugar.