What language is better to learn - C# vs. Java

Started by
17 comments, last by ATC 11 years, 5 months ago

That's wrong cos Java offers checked and unchecked exceptions.


But its standard library uses checked exceptions, requiring you in turn to check them.


What feature doesn't Java possess??


It doesn't allow co and contravariance in its generic definitions. You cannot make a generic class that supports T (and subtypes) or T (and super types). It's T or nothing.
Advertisement

But its standard library uses checked exceptions, requiring you in turn to check them.

It uses both.
For example:
· collections use unchecked exceptions
· IO classes use checked IOException
I think the criteria used is, in general:
· when the problem arises because of a programming error an unchecked exception is thrown
(for example IndexOutOfBoundsException)
· when the problem is not a consequence of a programming error, but can be reasonably treated, a checked exception is thrown
(for example FileNotFoundException)
· when the problem is not a consequence of a programming error, but can not be reasonably treated, an Error is thrown (unchecked)
(for example OutOfMemoryError)


[Java] doesn't allow co and contravariance in its generic definitions. You cannot make a generic class that supports T (and subtypes) or T (and super types). It's T or nothing.

Java allows code like this:
[source lang="java"]
class Geometry {}
class Shape extends Geometry {}
class Circle extends Shape {}
...
List<? extends Shape> covarList = new ArrayList<Circle>();
List<? super Shape> contravarList = new ArrayList<Geometry>();
[/source]
and also
[source lang="java"]
class X<T extends Base> {}
[/source]
however the next is forbidden
[source lang="java"]
class X<T super Child> {}
[/source]
What feature doesn't Java possess??

JAVA is typeless language, thus it lucks a real pile of things. Every time I code in Java I feel like if Java was raping me. I have a big respect to people that compile functional aplications upon Java.
Interesting reads there! I have played around with both languages a bit more and have found that C# just feels better for me. I really don't know why, it just does. Java is ok, and I can definitely see using it to develop Android apps. It's not as horrid of a language as people try to make it out to be.

My website! yodamanjer.com
My development blog!

Follow me on Twitter! [twitter]jwg1991[/twitter]

do not aproach C# witho out managing c++ theory. It may seem an object all things safe, but do not be fooled, the fact that compiler hides management from you may be benefitial also not. especiaily object competence. A C# ot Java progamer must now fundamentals of c++
If your interests are focused on doing more client-side development, I would go with C#. If your interests are more focused on doing more back-end server development, I would go with Java. If you go the Java route and really want to learn back-end development, then I suggest also getting dirty with Glassfish or JBoss and start absorbing Enterprise Java concepts.

Kirk "Runesabre" Black
Enspira Online


do not aproach C# witho out managing c++ theory. It may seem an object all things safe, but do not be fooled, the fact that compiler hides management from you may be benefitial also not. especiaily object competence. A C# ot Java progamer must now fundamentals of c++


If you want to be really good, yes, you should learn about c++ and its type oriented meta programming model (and how it is very different from C# generics). You should also learn deep and pure functional programming, to be able to write really sharp C# code.

On the other hand, IMHO, starting out with just plain and simple C# is a much better approach to get you going.

openwar - the real-time tactical war-game platform

Microsoft is letting the MonoDevelop and Mono development teams do their thing, at least for now, in my opinion. Almost everything you need to compile and run C# games cross-platform is in the MonoDevelop IDE. With it, you get much interface support for things such as sound, GUI, physics, and more.

If you can use the Visual Studio IDE and later cross-platform port the game through Mono, then that would be better long term. I believe that MS knows this and is why they let the Mono community do their thing.

Look at SharpDevelop and SharpDX, which could potentially also be ported cross-platform through Mono if you find Mono to be better for you.

The main Unity 3D/ Mono community and several sprout communities are really rockin' in C# big time, so take a look!


Energy is favoring C#, in my opinion - for learners, but Java has gigantic libraries and active cross-platform gaming communities. The growth of Apple systems could mean a big surge in Java use for games in coming years, added to other companies with tablet and mobile needs for Java games.

Do more research, please, and let us know what framework and other things which you decide to use, okay? smile.png


Clinton

Personal life and your private thoughts always effect your career. Research is the intellectual backbone of game development and the first order. Version Control is crucial for full management of applications and software. The better the workflow pipeline, then the greater the potential output for a quality game. Completing projects is the last but finest order.

by Clinton, 3Ddreamer

I always recommend C#... Now this is just my personal opinion but I say C# > Java lol...

From what I've seen C# is faster, and I think it's a much cleaner and more elegant language. To me, writing C# almost feels like you're painting a picture or playing music -- it's like an art lol, whereas C and C++ are like running a power tool... but I've just never cared for Java.
_______________________________________________________________________________
CEO & Lead Developer at ATCWARE™
"Project X-1"; a 100% managed, platform-agnostic game & simulation engine

Please visit our new forums and help us test them and break the ice!
___________________________________________________________________________________

This topic is closed to new replies.

Advertisement