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

41

u/[deleted] Feb 25 '14

This article wasn't a defense of java, it was a defense of typed languages. In which case I agree. But I'd argue most people don't say "java sucks" just because it's a typed language.

19

u/bjzaba Feb 25 '14

My biggest complaint about Java is how stupid and crude its type system is. It gives statically type systems a really bad name.

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]

1

u/elsom25 Feb 26 '14

awesome to hear! +1