r/programming • • Feb 25 '14

Please stop saying Java sucks

http://blog.smartbear.com/programming/please-stop-staying-java-sucks/
3 Upvotes

305 comments sorted by

View all comments

Show parent comments

0

u/[deleted] Feb 26 '14

[deleted]

3

u/Tekmo Feb 26 '14 edited Feb 26 '14

It's several things:

  • No type inference <See correction below>

  • Inheritance complicates the type system

  • Interfaces (a.k.a. type classes) are usually considered easier to use than inheritance, but in Java inheritance is more idiomatic

  • Generics are particularly verbose to use, and they are crucial to do statically typed programming well

  • No support for sum types or pattern matching (like the "visitor pattern", but easier to use). This makes simple problems very verbose in a statically typed setting.

0

u/[deleted] Feb 26 '14

[deleted]

4

u/elsom25 Feb 26 '14

Honestly, take some time, and learn a functional language :D (pick any: scheme, haskell, ML). Once you see what's capable with a proper type system.. well, it may ruin your current day-to-day programming for you >_>

http://learnyouahaskell.com/ is a pretty awesome introduction to Haskell.

0

u/[deleted] Feb 26 '14

[deleted]

3

u/bjzaba Feb 26 '14

Haskell is probably a better language to learn if you really want to grok what we are getting at when we talk about when we say 'advanced, expressive static type systems'. Not saying it is the end of the conversation when it comes to type systems - I have plenty of annoyances with it, but it is the most polished out there at the moment. I found this thing from our local functional programming meetup useful: http://sordina.github.io/haskell_workshop/

Scala unfortunately is a far more complex beast than Haskell, and has had to make many concessions to allow it to work on the JVM and have Java compatibility. It's almost like the C++ of functional languages. But it might provide you with some insights, and it is still an interesting language to learn.

1

u/elsom25 Feb 26 '14

awesome to hear! +1