Originally posted by uid313
View Post
Announcement
Collapse
No announcement yet.
Oracle Releases GraalVM 21.3 With Java 17 Support, Other Enhancements
Collapse
X
-
-
Originally posted by tildearrow View PostBy the way, C++ does have exceptions as well and the standard library does use many of them.
Leave a comment:
-
Originally posted by bug77 View Post
Well, Java6 was also 2013. Java has gained lambdas and streams since 8. 17 has stabilized records (~properties), which have been available for 2 or 3 releases in preview form.
It's still missing coroutines/fibers and default parameters, for example.
I much prefer C#.
Thanks for the reply!
- Likes 1
Leave a comment:
-
Originally posted by uid313 View PostWell, Java 6 (pretty much) when I used it was shitty, there were no properties (you had to declare your own get and set methods), there were no lambda/closures, etc. I much prefer C# over Java, but I don't know if Java has improved since then.
It's still missing coroutines/fibers and default parameters, for example.
- Likes 1
Leave a comment:
-
Originally posted by barti_ddu View PostBut even on old (pre-8) versions of Java You could use anonymous methods like this:
Code:int x = new Object() { int fact(int i) { return i < 2 ? 1 : i * fact(i - 1); } }.fact(8);
Leave a comment:
-
Originally posted by uid313 View PostAh, thanks!
Nice to see that Java got lambdas, I remember the lack of such was a pain point back when I used it for Android development.
Code:int x = new Object() { int fact(int i) { return i < 2 ? 1 : i * fact(i - 1); } }.fact(8);
Leave a comment:
-
Originally posted by tildearrow View Post
Fixed my post.
By the way, C++ does have exceptions as well and the standard library does use many of them.
Originally posted by tildearrow View PostJava 8 and higher have support for lambdas in the form of Predicate, using this syntax:
Code:(arg) -> { CODE return <value>; }
Nice to see that Java got lambdas, I remember the lack of such was a pain point back when I used it for Android development.
Leave a comment:
-
Originally posted by uid313 View Post
Yeah, that's one way to see it, but it also provides also garbage collection and exceptions.
By the way, C++ does have exceptions as well and the standard library does use many of them.
Originally posted by uid313 View PostWell, Java 6 (pretty much) when I used it was shitty, there were no properties (you had to declare your own get and set methods), there were no lambda/closures, etc. I much prefer C# over Java, but I don't know if Java has improved since then.
Code:(arg) -> { CODE return <value>; }
Last edited by tildearrow; 20 October 2021, 03:39 PM.
- Likes 1
Leave a comment:
-
Originally posted by tildearrow View Post
I think of it like a C++ but with more verbosity, no header files and a ultra-simplified type system in where everything is a pointer except for int, long, float, double, short, byte and char.
Originally posted by bug77 View Post
8 brought some functional-like traits to the language, but it has barely improved since. Everything in Java these days (the language, not JVM) is about catching up with features Kotlin or Scala have offered for years. GraalVM ain't gonna fix any of that
It's not that the language itself is bad (it's quite readable, compared to many others), it's just that OOP everywhere doesn't really fit many of the things you're required to implement these days.
- Likes 1
Leave a comment:
-
Originally posted by uid313 View PostI used to code in Java 6 (and partly 7 and maybe 8) in Android, and it was really shitty, then came Kotlin which was a fresh breeze.
How has Java evolved since then, and how is Java 17? Is it still shitty, or is it nice nowadays?
It's not that the language itself is bad (it's quite readable, compared to many others), it's just that OOP everywhere doesn't really fit many of the things you're required to implement these days.
- Likes 1
Leave a comment:
Leave a comment: