Live data from Hacker News

Ask HN : Which should I learn : C# or Java

news.ycombinator.com

41–50 of 87 posts

Re: Ask HN : Which should I learn : C# or Java

#41
From my experience of working with both Java and .NET I can say that: the weakest part of the .NET technology stack is community, and the strongest part of the Java world is community which produced the huge pool of quality, free and open-source frameworks. Currently Maven repositories count for more than 14,000 unique artifacts and almost 60,000 versions (http://www.mvnbrowser.com/faq.html).

C# is a nice language, but when you have to develop a real-world application, it does not help much. .NET simply lacks too many essential tools and frameworks. You can do basic things with it, but when you have a non-standard task at hand, you are alone to implement the solution by yourself or pay for crappy third-party closed-source component. Even for trivial tasks. Want a decent HTML parser to sanitize HTML documents? Write it by yourself or pay for crappy third-party closed-source component. Want to read email messages from the server? ... you got the idea. The list goes on and on. I am currently working on a C# project which has integration with source control systems. We had to invest a lot of time to write our own framework and providers for several most widely adopted tools, such as Subversion and Perforce. If we based our project on Java, we would saved lot of time on development by choosing Maven SCM providers, which are free and open-source. Another example is that we needed a decent audit history for the documents in the database. Again, we had to develop somewhat working home-grown solution. If we based our project on Java, we would simply pick open-source Envers framework (http://www.jboss.org/envers/) which does exactly what we need for free.

And I hate Visual Studio. It offers a little more than a notepad with syntax coloring and debugger. It is horrible for coding and those variegated wizards and diagramming tools don't make me productive either. Being unable to attach third-party source codes is a huge PITA. Eclipse in size is just a fraction of the VS installer, but still is feature-packed, better for refactoring and has a plenty of plugins. Speaking of IntelliJ Idea, it's simply the best IDE ever.

.NET build and CI tools suck, there is nothing to compare with Maven.

If you like to learn new languages, I think there is nothing to beat JVM in terms of variety programming languages running on top of it. Just for example, the most notable ones are JavaScript, Python, Ruby, Groovy (Python-like language with Java-friendly syntax), Scala, Clojure (Lisp-like), CAL Language (Haskell-like) and many more. By the way, JVM by itself is quite a decent piece of engineering.

My experience makes me think that Microsoft is trying to be popular at any cost, targeting inexperienced programmers, intentionally oversimplifying their solutions, making simple things trivial, complex things impossible. The Microsoft culture is to give you a big bright flashy button, which does a lot of things under the hood, but when accidentally it breaks, you are unable to guess what is going on and how to fix it. Living in the world of closed-source .NET code makes me cry.

So the conclusion is: choose Java over .NET, but learn more uncommon programming languages as well. Haskell, Lisp and Prolog were huge "brain-washers" for me.

Re: Ask HN : Which should I learn : C# or Java

#42
post #23

If those were my only choices, I would consider changing my career. Maybe learn to cook and open a gourmet restaurant. Now, seriously, I would go for Java because, at least, it can run cross-platform without the danger of Microsoft suing you out of existence.

"it can run cross-platform without the danger of Microsoft suing you out of existence"

Please explain further. MS isn't suing Mono (and supports them in many ways) and is increasing their cross-platform capabilities with Silverlight. These are not cure-alls, but they are progress.

Re: Ask HN : Which should I learn : C# or Java

#43
I would go with C#. There are lot's of people who say that you are subject to Microsoft's directing of the language, but if you go with Java, you are subject to Sun/OS direction just the same. C# is a great language and ASP.Net is great for the Web. It's not popular to advocate a Microsoft product here but I'm very happy with C# and ASP.Net. Your goals will be the ultimate factor in your decision though.

Re: Ask HN : Which should I learn : C# or Java

#44

Earlier quoted context omitted.

Learn Scala: http://www.scala-lang.org

Exactly. If you need to use Java for some reason, like getting at their libraries, you will do well to use anything other than the Java language. The platform is good. The language is 20 years behind the state of the art. Unless you are forced to work with other people that can't learn a language other than Java, there is no point in using it. I lean in the direction of Clojure, but lately the constant fanboi-ing is…

How's .NET vs Java library-wise?

Re: Ask HN : Which should I learn : C# or Java

#45
post #40
post #31

Earlier quoted context omitted.

C# by itself isn't terribly difficult, other than its constantly balooning specification. A lot of the percieved difficulty with C# today comes from the rapid shifts in direction from Microsoft in terms of the "Microsoft Way" of using it. A prime example is the DLinq / Linq to SQL / ADO.Net Entities fiasco that's occurred in the past 5 or 6 months; Microsoft is trying to react quickly, but in doing so is crossing its…

You're exactly right, those are .NET problems not specific to a language, and not really problems for a hacker. There are multiple open source ORMs that take full advantage of the language features (like LINQ) and aren't subject to MS's whims. I think that "constantly balooning specification" is an overstatement. Look at the release timeline: - 2002: Version 1 (with VS.net 2002) - October 2005: Version 2 (with VS2005…

I don't think the time-line has as much to do with it as the scope of the changes do. Again, this is personal opinion; and I'm speaking from the angle of someone who has spent many years doing consulting work on the Microsoft stack, and having to deal with figuring out which ways the 9-to-5'ers are going to break things next.

Version 1.0 of the C# specification clocks in at 405 pages. There was an addendum in 1.2 that I'll leave out, because it was a respecification of 1.0.

2.0 came along and added 117 pages of specification - including generics, partial classes, iterators, and a handful of other things. On pure specification, that's a growth of 25% to the core language. (I know this isn't really scientific, but I think you get my drift).

Then in 3.0, just 2 years later, the spec is back to over 500 pages (just for the language!). This version added a bunch of functional paradigm stuff to the language, lambdas, linq and the like.

And now in 4.0, they're talking about making C# essentially a dynamic language.

Now, all this being said, I really do like C#; but I think that it behooves everyone who likes C# to admit that it's a large and evolving language; the paradigms that Microsoft keeps adding to the language don't really seem to fit from one version to the next.

Re: Ask HN : Which should I learn : C# or Java

#46
post #41

From my experience of working with both Java and .NET I can say that: the weakest part of the .NET technology stack is community, and the strongest part of the Java world is community which produced the huge pool of quality, free and open-source frameworks. Currently Maven repositories count for more than 14,000 unique artifacts and almost 60,000 versions ( http://www.mvnbrowser.com/faq.html ). C# is a nice language,…

What if you want to sell software components/libraries? Which platform would you choose?

Re: Ask HN : Which should I learn : C# or Java

#47
post #18

I've noticed that no-one has talked about the cost of using either. Yes the Java IDE's are somewhat inferior to MS's, but you can get everything you need to write, develop, manage, and host Java applications for free compared to MS; the OS, IDE, Web Server ... all cost money which can be a substantial amount for commercial purposes.

I love IntelliJ IDEA, it kicks some serious ass: http://www.jetbrains.com/

The last time I used VS was with VC++ 6.0, so no clue how IntelliJ compares.

Re: Ask HN : Which should I learn : C# or Java

#48
post #29
post #18

I've noticed that no-one has talked about the cost of using either. Yes the Java IDE's are somewhat inferior to MS's, but you can get everything you need to write, develop, manage, and host Java applications for free compared to MS; the OS, IDE, Web Server ... all cost money which can be a substantial amount for commercial purposes.

Due to Mono, this is only like 63% true.

Yea except 63% true X 40% of .NET that Mono actually implements is a lot less than the 100% of Java that can be accessed from Eclipse.

Re: Ask HN : Which should I learn : C# or Java

#49
As a ten year veteran of Java, currently learning C# (the world is full of irony), I can say that Java is a simpler language. There are a bunch of bones thrown to c++ and assembler focused guys in C# making it a more complex language to master. And I dispute that VisualStudio is a better IDE than IntelliJ. So, my honest opinion is start with Java.

Spend time writing code, and just as importantly, reading it. Read through Spring, Hibernate, et al. Understand the architectures, the trade offs, and the code tricks.

Re: Ask HN : Which should I learn : C# or Java

#50
post #18

I've noticed that no-one has talked about the cost of using either. Yes the Java IDE's are somewhat inferior to MS's, but you can get everything you need to write, develop, manage, and host Java applications for free compared to MS; the OS, IDE, Web Server ... all cost money which can be a substantial amount for commercial purposes.

Time is money, and Visual Studio is a very productive environment.
Post reply on HN