C# vs. Java

  • Thread starter Thread starter Tim923
  • Start date Start date
T

Tim923

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?
 
Tim923 said:
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?
They are both c syntax based languages so there will be a certain
similarity but I have never used Java so wouldnt know exactly how similar.

:)
JB
 
Very similar - I used Java for several years (as well as Visual Basic). The
Java experience made it a piece of cake to pick up the C# syntax. The
Visual Basic experience was irrelevant. The biggest hurdle is actually
learning what the enormous set of Classes in the Framework can do for you.

HTH
Tom
 
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.
 
Yes, syntax wise its very similar and if u know Java u don't have to put much
effort learning syntax. but execution wise C# is different from JAVA as on
compilation JAVA creates ByteCode which in turns executes by JVM whereas C#
on compilation creates MSIL which at runtime converted in machine specific
native code.

Coding wise, just write Java code and u need to done small changes only as
even keywords are also same just sometimes case matters like C# main method
is "Main" as compared to Java's main method "main" with small 'm'
 
Manish.net said:
...whereas C# on compilation creates MSIL. which at runtime converted in
machine specific

Just a small correction.

Even though microsoft sometimes still refer to it as MSIL (microsoft
intermediate language) it was renamed to CIL (common intermediate language)
when it became a ECMA standard.

- Michael S
 
Manish.net said:
Yes, syntax wise its very similar and if u know Java u don't have to put much
effort learning syntax. but execution wise C# is different from JAVA as on
compilation JAVA creates ByteCode which in turns executes by JVM whereas C#
on compilation creates MSIL which at runtime converted in machine specific
native code.

That's not really a difference at all. IL can be interpreted just as
Java byte codes can be interpreted, but both are normally JIT-compiled.
 
Back
Top