r/programming • • Feb 22 '15

Java Makes Programmers Want To Do Absolutely Anything Else With Their Time

http://www.forbes.com/sites/quora/2015/02/21/java-makes-programmers-want-to-do-absolutely-anything-else-with-their-time/
35 Upvotes

636 comments sorted by

View all comments

Show parent comments

-1

u/nickguletskii200 Feb 22 '15

C#

C# is a great language, but not a great platform. It's tooling is significantly worse than Java's, the standard library is utter shit and there aren't that many 3rd party libraries (and a lot of them are just half-complete ports of Java libraries).

The only thing I upgrade by switching from Java from C# is the language itself. Everything else is a downgrade. And yes, I've used it.

2

u/fhelwanger Feb 22 '15

Also, tough its tooling is basically only VS, it's really great. Maybe your point is only based on your personal taste

1

u/fhelwanger Feb 22 '15

Why do you think the standard library is utter shit? At least in C# we don't have to use some 3rd party libs to work with dates. We also have LINQ, which is great. I can't get your point

1

u/nickguletskii200 Feb 22 '15

At least in C# we don't have to use some 3rd party libs to work with dates

Neither do we. Java 8 has an amazing date time API.

We also have LINQ, which is great.

And we have streams. And?

2

u/fhelwanger Feb 22 '15

And why C# standard lib is utter shit? Can you point something?

-1

u/nickguletskii200 Feb 22 '15

Treating paths as strings, for example. In Java, we have classes like File (the old class) and Path (the new, generic class). In C#, a path is a string and you modify it by calling static methods.

1

u/[deleted] Feb 22 '15

But streams suck compared to enumerables, the nice thing about IEnumerable is that it's for collections and streams. So you don't have to collect anything unless you're casting to a collection, you can make extension methods that work on all collections and streams, and the syntax is way nicer.

-2

u/[deleted] Feb 22 '15

[removed] — view removed comment

2

u/nickguletskii200 Feb 22 '15

Examples? I can show this tiny example of exactly the opposite.

Treating paths like strings. The collections library is lacking.

java people often bring that argument, but they fail to provide REAL concrete examples of such supposedly miraculous "libraries" that don't exist in .Net.

A proper additional collections library like Guava or Apache Commons Collections, especially since C# is a language that most definitely needs one.

Something like Spring Security and anything AOP in general. Spring Security method security has no alternative on .NET AFAIK and everything else AOP on .NET is not as mature and feature rich as on Java.

Oh, and here's a killer... Alternative for JRebel and Spring Loaded.

-3

u/[deleted] Feb 22 '15

[removed] — view removed comment

2

u/nickguletskii200 Feb 22 '15 edited Feb 22 '15

There's a path API in System.IO, if you don't use it it's your fault.

Did you even read what I said? System.IO.Path treats paths like strings. A path isn't a special object, its just a freaking string!

Nuget is your friend

I did research on the libraries I could find earlier. None of them are even close to being as comprehensive and fast as the Java alternatives.

Their site[2] seems to enumerate a bunch of features that are built-in on ASP.Net/MVC:

Did you even read what Spring Security method security actually is? .NET CAS is more like Java security policies. If I am wrong, please provide me with an example of a method that can only be called by authenticated users when a certain condition is met or by an admin at any time. In Spring Security, I would just write something like this:

@PreAuthorize("(hasRole('USER') and @myCustomService.myPredicate()) or hasRole('ADMIN')")
void foo() {

}

LOL. java needs a third party commercial paid library for something that the .Net compiler does for free.[4] .

Are you fucking shitting me? This blogpost is a hack that lets you replace controllers and controllers only! With JRebel or Spring Loaded (which is actually completely free), I can hotswap any method!

-2

u/[deleted] Feb 22 '15

[removed] — view removed comment

2

u/nickguletskii200 Feb 22 '15

Show me how its done in C#, and then we'll laugh. Also, I accidentally submitted the parent post early, read the last paragraph.

-3

u/[deleted] Feb 22 '15

[removed] — view removed comment

2

u/nickguletskii200 Feb 22 '15

http://stackoverflow.com/questions/3007337/make-a-method-of-the-business-layer-secure-best-practice-best-pattern

I asked you to write me an equivalent of @PreAuthorize("(hasRole('USER') and @myCustomService.myPredicate()) or hasRole('ADMIN')"), not a simple "has role" check. Please note the fact that I can use my own predicates.

Of course we laugh (at least I do) when looking at java's utter retardedness and failed attempts to imitate whatever .Net did right (such as generics/value types/LINQ).

What .NET did right while not having to worry about backwards compatibility. Also, Java is getting there. It just has a more careful approach to adding features.

Yeah, ASP.Net 5 has that stuff built-in, and it works solution-wide, but I'm too lazy to look that up now, go find it yourself if want.

How would that be ASP.Net's concern? That can't be implemented without proper support from the VM...

-2

u/[deleted] Feb 22 '15 edited Feb 22 '15

[removed] — view removed comment

→ More replies (0)