Differences between C# and Java

Started by
17 comments, last by meeshoo 12 years, 2 months ago
Thanks for all the great advice and suggestions. I think I will jump into C# as soon as possible. Does anyone know of any good resources for learning C#? Such as books/online tutorials?

Thanks
Advertisement
This is a nice tutorial cum presentation on the C# language. Check it out: http://www.jaggersoft.com/csharp_course/index.html

Not to mention the obvious fact that Java is entirely cross-platform (And by the way, converting java code to an exe file seemse counter productive to me, as perhaps the biggest advantage to using java IS its cross-platform nature), where-as C# is Microsoft only (unless you take into account Mono, which is another argument all together).


I don't know, i wouldn't consider mono being another argument. While it makes sense not to equal mono's other platforms with java platform everywhere, it also has the upside of providing cross platform "without" the cost of "no base platform", because while java may run pretty much anywhere, it doesn't run anywhere by default, most windows computers i know off don't have java installed, but have .net installed.
The C# from Java Orange Book, here is essentialy a list of the main differances between the language. Might be useful.
You could also just jump into Visual Studio and try to recreate a small program you did in Java. You would be surprised to see how easy you will get around. However after a while, as someone said above, you will notice things start to get a bit different, but in a good way (they get easier IMO :) ).

[quote name='jonbonazza' timestamp='1328416999' post='4909732']
Not to mention the obvious fact that Java is entirely cross-platform (And by the way, converting java code to an exe file seemse counter productive to me, as perhaps the biggest advantage to using java IS its cross-platform nature), where-as C# is Microsoft only (unless you take into account Mono, which is another argument all together).


I don't know, i wouldn't consider mono being another argument. While it makes sense not to equal mono's other platforms with java platform everywhere, it also has the upside of providing cross platform "without" the cost of "no base platform", because while java may run pretty much anywhere, it doesn't run anywhere by default, most windows computers i know off don't have java installed, but have .net installed.
[/quote]

Most populate linux distros come with java pre-installed. No OSs come with Mono pre-installed.
Co-founder/Lead Programmer
Bonafide Software, L.L.C.
Fairmont, WV 26554 US

Most populate linux distros come with java pre-installed. No OSs come with Mono pre-installed.

I don't believe that is true, as I believe both Ubuntu and Fedora are distributed with Mono. I really have not bothered checking other distros for this though.

Edit: It looks like GNOME requires Mono, as some of its components use it, especially Tomboy. So any distro that uses GNOME is going to require Mono by default.

[quote name='stein102' timestamp='1328343637' post='4909455']
and would like to know some of the similarities and differences between the languages.


C# up to 2.0 was essentially 'Java with lessons learned'. It does away with checked exceptions, has a concept for interfaces, a sane DateTime instance, and good generic support. It shared the same sort of OO approach, garbage collection and bytecode ideas.

Since 2.0 (around the same time Java stagnated) C# has added support for dynamic variables/execution, extension methods, generators, expression trees, concurrent data structures in the standard library, and better use of methods as data (including better anonymous method syntax),

This last one is the big day to day difference you'll see between modern C# and Java. Modern C# tends to make fairly heavy use of in-line anonymous methods which are antithetical to the Java way of doing things.
[/quote]

C# has aged much better than Java, I think there are few that would argue that. With very few exceptions ( non-generic datatypes like ArrayList ), their are very few legacy warts in C#, unlike Java, while it has implemented new language features, like generics, much cleaner than Java.


That said, I don't know if C# just commited a cardinal sin implementing dynamic. For such a safe language, it seems like such a glaring and horrible hole smashed into the design. I can't help but wonder if Anders suffered a bit of language envy of Ruby or Javascript at the time and tried to make C# a be-all language. I guess only time will tell.

That said, I don't know if C# just commited a cardinal sin implementing dynamic. For such a safe language, it seems like such a glaring and horrible hole smashed into the design. I can't help but wonder if Anders suffered a bit of language envy of Ruby or Javascript at the time and tried to make C# a be-all language. I guess only time will tell.


Well, the tools are there, you can use them or you can pass. I currently work at my job with WPF, WCF, Entity Framework and some other "modern" .net stuff, however using them has a lot of drawbacks, especially performance wise. So I'm glad they keep adding new stuff, but then none is force to use it.

This topic is closed to new replies.

Advertisement