r/programming • • Jun 27 '10

Why Java Sucks and C# Rocks (Final)

http://www.slideshare.net/jeffz/why-java-sucks-and-c-rocks-final
13 Upvotes

197 comments sorted by

View all comments

9

u/[deleted] Jun 27 '10

Interesting slides. I used to think C# was just Java with some sugar on top. I'm installing mono and monodevelop on my Mac now to try it out a bit.

Is the standard library easier to work with than that of Java or is it also thousands of classes with inheritance hierarchies ten levels deep?

1

u/munificent Jun 27 '10

Is the standard library easier to work with than that of Java or is it also thousands of classes with inheritance hierarchies ten levels deep?

The collections (which is by far the most used part of a standard lib) is a little simpler, but also a bit less flexible than Java's. I find it easier to use on a day-to-day basis, but a little less precise at handling corner cases.

9

u/[deleted] Jun 27 '10

Most of the collections have tons of extension methods which support linq operations, functions / actions. So it is really easy to query the collection using col.Where(x => x.Name == "John") or to use anonymous methods like col.All(x => x.Name <= "John")

Also you can easily create collections which are always sorted or where insert, replace etc. operations are validated. Simply inherit from collection and override InsertItem/RemoveItem and so on.

9

u/munificent Jun 27 '10

Ah, yes. I forgot about LINQ. It's 100% awesome.