Re: C# vs. Java

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Jeremy Gailor (jeremy_at_infinitecube.com)
Date: 09/14/04


Date: Tue, 14 Sep 2004 03:41:21 GMT

Codewise, they are very similar, but C# is a superior language.
Operator overloading is a huge improvement, in my opinion, over Java
because it allows you to more naturally manipulate custom types than
Java's enforcement of using a method to perform what would naturally be
done via an operator. I also appreciate some of the more C++ type
abilities of C#, but the language still allows you to ignore writing a
lot of the boilerplate code that goes along with any project. There are
several other differences (I personally prefer the event model in C# far
more than Java's use of interface implementation and overloading the
appropriate interface method), which really shows to me that C# decided
to both take the strong points of other languages and try to eliminate
their weaknesses.

Also, the .Net JIT seems to be significantly faster than the JVM, which
is what made me start to veer away from using Java. I still appreciate
the speed and power of C++, but if it's something that I can get away
with writing in C#, and save several hundre or thousands of lines of
code over C++, then that's my first choice.

As an aside, I'm a software engineer who's been writing Java/J2EE code
for the past several years, and I can't wait to move into another
position writing C#, even though I fought hard against adopting .Net for
a long time. But I think I have a pretty good perspective of the two
languages at this point, and can compare and contrast them from a
usability standpoint.

Tim923 wrote:
> The code in C# looks very similiar to what I remember from Java, but
> we haven't done much manual coding yet. How similiar are they?



Relevant Pages

  • Re: Why Javas math expression (power) is so inconvenient and error prone?
    ... Java is not a very elegant language. ... Interestingly, they have operator overloading. ... programmer and who cares about the customer ... ...
    (comp.lang.java.programmer)
  • Re: choosing a teaching language, was Java compiler courses
    ... immediately understand how to use a language for writing programs. ... using powerful libraries ... C or Java? ...
    (comp.compilers)
  • Re: assert-like debug { /* code */ } feature?
    ... But if you're writing about some language other than Java, ... expression whose type is int and whose value is 1. ...
    (comp.lang.java.programmer)
  • Re: is it possible that instruction re-ordering cause problems?
    ... threads using regular "var = expression;" statements, then, YES, you can get into big trouble. ... Some high-level languages, Java for example, has a threading models specified by the language; others, like C, doesn't; in that sense, writing in C is like writing in assembly -- it's theoretically system-dependent how things behave. ...
    (comp.lang.asm.x86)
  • Re: UNIX, C, Perl
    ... mind can follow. ... I agree that operator overloading makes the language (and ... don't expect operator overloading to ever be added to the C standard. ... requires extra effort and skill by whoever is writing the overload functions ...
    (comp.lang.c)