tags:

views:

796

answers:

10

Since C# is in many ways a direct derivative of Java I wondered whether there was any advantage to learning Java after the fact of having learnt quite a reasonable about about C#?

Note: Please provide clear, direct advice rather than discussion in order to keep in line with SO guidelines.

A: 

Absolutely. A lot of jobs want java specifically. Having learnt Java and being able to put it convincingly on your resume means you wont have to wrangle with HR and recruiters who do not have that much clue.

And since both are more or less same except in a few places, its a very good return on investment. Not to mention it opens up possiblities of using other frameworks.

Mostlyharmless
+7  A: 

If you want to program in Java, learn Java. It really is that simple.

The patterns, algorithms, and design ideas aren't going to be different enough that learning the language on its own is reward enough.

However, Java runs acceptably well on vastly more platforms than does C# (though with mono that's changing) so if you want to dip your toe into platform agnostic code, you might give Java a try. You'll notice it's a bit rougher around the edges, but not like going to C++ or C.

Adam Davis
+2  A: 

I'm primarily a Java guy but have done a little C# here and there. IMO there is not enough of a difference between the two to really give a lot of benefit from a broadening your programming horizons perspective. Generally when I'm looking to learn a new language I want to find something that will force me to look at a program from a different perspective. Java's perspective is basically the same as C#. There are a few differences in how some of the high-level language features work and the APIs differ in some places, but overall Java and C# are both memory-managed, statically typed, OO languages.

Mike Deck
A: 

similarities between C# and Java allows you to get to know java rather quickly. the principles are the same, and you get a competitive advantage when searching for a job, or doing your own projects by choosing which platform is more appropriate for the project (based on the commercial side of the project, and the scalability matter, because you can scale java on linux servers as much as you need without additional licenses costs).

zappan
A: 

I know Java pretty well, and had to learn C# for a work project. It was very painless, and I learned a lot about both languages in the process.

Java will also offer the whole 'write once, run everywhere' thing, and open up a path to doing unix/linux server based integration projects.

Internet Friend
*cough* Mono *Cough*
FlySwat
FlySwat, can Mono on Linux run any C# program written with Visual Studio?
Thorbjørn Ravn Andersen
+4  A: 

The syntatical difference between the two is not large, though you get a lot of .NET specific code like [] tags that you won't find in Java. But I do find that the APIs and the development approach is quite different. The back end of each is very different from the other and in .NET some code that is efficient and works well may not be suitable for Java, and vice versa.

I've worked in both, the limitation that you're going to have to get used to if you work in Java is in the IDEs. None of the IDEs out there compare to Visual Studio for speed of development and ease of deployment. (IMO anyway).

I got a lot out of working on a few Java projects. You learn a lot of different programming techniques and methodologies. Specifically I would suggest working in J2EE, the difference will certainly give you the feel of working with a different language and technology.

Odd
A: 

The answer to this question relies more on your own personal situation rather than the similarities between the languages. If you have the time to learn Java, that is good, but is there something more valuable you could be doing with that time.

If you are concentrating on going the Microsoft route, it is not going to be good to learn Java at the expense of spending time getting to know even greater depth in C#, or learning a Microsoft product that could make you more valuable, such as the new items in the .NET 3.5 framework.

There is more than enough to learn in the .NET world without learning languages that are unrelated in terms of thier usage in the majority of corporate environments.

Being a generalist is gives you a broader outlook on developement, but being a specialist earns dollars more directly.

Nat
A: 

There are two considerations here.

If you want to learn in order to work in a Java environment, then learning Java is obviously a step in that direction. It should be quite straight forward in some respects as the substantive differences between C# and Java are relatively minor. Depending on exactly what technologies you are using, there may be some implementation differences in the support stack you use, but in raw language terms there is very little difference.

However, if you want to learn Java to further your personal development, then I would say your time is better spent learning something that is going to stretch you a little more. A language like Python, Ruby or Erlang will really expand your horizons as a programmer. Each of these requires a slightly different mind-set than you will find in Java or C#.

Toby Hede
+5  A: 

I'm going to go with a different answer than the rest. If you are writing applications for the Windows platform, I don't see any benefit. The reason I say that is your "job" depends on knowing that platform. I can only assume that your job depends on it, otherwise, why would you be invested into it (hope that makes sense).

My suggestion is not to STOP learning though but LEARN something else that will give you a totally different perspective. Specifically I'd suggest to learn something dynamic or functional. Maybe F# for example, or give Ruby or Python a try. I think that is a better investment in time.

My $.02.

-Keith

Keith Elder
A: 

Being a fresher[ who knows C# well and JAVA not that much], I will suggest you this.

If you are in search of a job:

Invest yourself in learning the differences of C# & Java. This is because,it will increase your value and decrease your time to find a job.

If you are in need for a project [to be done in Java]:

Then,obviously you have to learn right !

If you are in search of a newer technology:

Dont waste time in Java, go for Python, Ruby or Erlang. This is because, 80% both C# and java are the same and you are going to learn only the remaining 20 % (for a maximum), which I feel is a waste of time.