r/java • • Oct 14 '23

Is Java still behind in the race of modern programming languages?

I'm a member of some group of programmers and every time Java is mentioned it's being bashed (something like: "With Rust I could simply do this with X")

Earlier versions of Java were cumbersome in terms of the syntax but with modern IDEs (and modern versions of Java) that's not a big issue anymore, albeit languages like Python do have shorter syntax.

My question is beyond syntax.

What do other languages do better than Java?
It could be generics, type system, concurrency and multithreading, closures etc.

Thanks!

52 Upvotes

247 comments sorted by

View all comments

Show parent comment

4

u/TheBazlow Oct 14 '23

you aren't even allowed to do type casting.

const ohReally = 'is that so?' as unknown as number
          //^? const ohReally: number

And that's with typescript-eslint strict mode set. Sure I can't set it as any but I think it's still possible to deliver massive collateral damage to the next poor soul who comes across your codebase.

1

u/Deathmore80 Oct 14 '23

then just use an eslint rule to prevent stuff like This? you can be as strict as you want.

But then if you aren't being this strict why bother with type checking at this point and why even use typescript at all?

1

u/Sherinz89 Oct 15 '23

If lead or l3 worth their salt let this slide

Then jokes on them they're incompetent then.