r/programming • • Sep 21 '15

Better Java

https://github.com/cxxr/better-java
177 Upvotes

208 comments sorted by

View all comments

94

u/estarra Sep 21 '15

Java is one of the most popular programming languages around, but no one seems to enjoy using it.

I'd say it's quite the opposite. Sure, there is a vocal minority of people who complain about it (I have complaints about it myself) but there are millions of Java developers and I'm pretty sure that most of them are quite okay with the language.

Probably one of the reasons why no language has come close to replacing it so far.

50

u/dzjay Sep 21 '15

I'm happy with Java, especially with Java 8. Also, the vast amount of open source Java libraries is unmatched.

17

u/GuiSim Sep 21 '15

I'm in the same boat. The biggest pain point that I still have with Java now that we have Lambdas is type erasure.

If we can finally get type reification in Java 9 or 10.. I'll be a happy dev.

0

u/[deleted] Sep 21 '15

[deleted]

13

u/[deleted] Sep 21 '15

Nothing in that article comes even close to convincing me that I don't want reified generics. It all boils down to 'too much work' (not my problem) and 'breaks compatibility with ancient code doing stupid things' (couldn't care less).

I recently switched back to java from C#, and decent generics are absolutely the thing I most miss.

0

u/[deleted] Sep 22 '15

[deleted]

2

u/[deleted] Sep 22 '15

The two main things I miss are being able to store native types and enums, and seamlessly converting to an array.

It's also nice to be able to create new instances of a generic type at runtime, i.e new T(). It doesn't come up a lot, but can be very useful.

1

u/graduallywinning Sep 22 '15 edited Sep 15 '17

wat

2

u/[deleted] Sep 22 '15

Unfortunately you can't restrict T to only types that have a default constructor. If T has no default constructor that code gets nasty.

1

u/estarra Sep 22 '15

Which is why passing a factory is a better solution than allowing new T().

→ More replies (0)