C# versus Java

  • Thread starter Thread starter Curious
  • Start date Start date
C

Curious

I'm a C#.NET developer, but I have not used Java.

Now there's a tool (a component) that has good functionalities
implemented in Java we plan to use. There are other tools implemented
in C#.NET but seem weak compared to the Java tool.

Although I hesitate to learn a new computer language (expecially
something like Java with a lot of interface stuff), I don't want to go
with the second best option (implemented in C#) just to avoid the pain
of learning a new language. I want to do it for the right reasons.

Just wonder:

1) Is Java as efficient as C#.NET?

2) Will it be difficult to pick up Java?

Thanks,
 
Curious said:
I'm a C#.NET developer, but I have not used Java.

Now there's a tool (a component) that has good functionalities
implemented in Java we plan to use. There are other tools implemented
in C#.NET but seem weak compared to the Java tool.

Although I hesitate to learn a new computer language (expecially
something like Java with a lot of interface stuff), I don't want to go
with the second best option (implemented in C#) just to avoid the pain
of learning a new language. I want to do it for the right reasons.

Just wonder:

1) Is Java as efficient as C#.NET?

It depends on what you are doing and what you call "as efficient". In many
tests, C# beats Java in pure performance, but the delta between C# perf and
Java perf is not so great that I would freak about this.

There are things I personally do not like about Java, if I were chosing one
or the other for a new project. Most of the things are related to getting
skilled people to work on the project, as Nashville is not a Java town. But,
I do have vendors who work in Java.

If the product is good, then it is good, Java or not. There is good
programming in Java and crappy programming in .NET. If you have a great
product in Java and a mediocre product in .NET, it could be your best
choice.

I would weigh all factors in before making a decision, as the human dynamics
may make the "superior" Java solution seem less than stellar.
2) Will it be difficult to pick up Java?

The syntax is similar. Most of the learning curve is in the slight
differences in language and understanding the underlying frameworks and
apis. How difficult this is to you is largely dependent on how you see .NET.
If it is the only thing you have ever programmed in, you will likely see
..NET constructs as programming constructs rather than understanding how they
fit into common programming constructs.

If so, it will be more difficult to grasp as you will require a more stiff
paradigm change in your thinking.

If not, you will still have to fit Java into the programming constructs and
get past the differences, but it will not be as hard, as you thinking will
be more abstract when it comes to the individual languages.

In short, I cannot state how difficult it will be for you.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://feeds.feedburner.com/GregoryBeamer#

or just read it:
http://feeds.feedburner.com/GregoryBeamer

********************************************
| Think outside the box! |
********************************************
 
Java is very similar to C#, if you ignore that it doesn't have:
- delegates
- preprocessor
- value types
- linq
- operator overloading
- properties
- elegant event handling (unless you call Java's indirect interface approach
'elegant')
- 'unsafe' code options

..... then again, maybe Java is not very similar....

--
http://www.tangiblesoftwaresolutions.com
C++ to C#
C++ to VB
C++ to Java
VB & C# to Java
Java to VB & C#
Instant C#: VB to C#
Instant VB: C# to VB
Instant C++: VB, C#, or Java to C++/CLI
 
Hi Gregory,

Thanks for your insightful advice.

Our new project is to analyze real-time live stock market data. It's
quite computational intensive, because every several seconds, you have
to react to real-time events (and go back to retrieve historical data
in a high-frequency database ) and do something. I guess performance
is critical. After I read your post, I am kind of leaning towards
C#.NET.

I also don't know what editor/compiler I should use for Java. Also I
don't know if it has garbage collection to automatically claim memory
not used. I also don't know if it has memory leak. Just too much
overhead to deal with before you start a new project. Not worth it.
 
I saw a lot of "interface" stuff in this API in Java, and kind of feel
scared, because I'm not into that.
 
Curious said:
Hi Gregory,

Thanks for your insightful advice.

Our new project is to analyze real-time live stock market data. It's
quite computational intensive, because every several seconds, you have
to react to real-time events (and go back to retrieve historical data
in a high-frequency database ) and do something. I guess performance
is critical. After I read your post, I am kind of leaning towards
C#.NET.

I also don't know what editor/compiler I should use for Java. Also I
don't know if it has garbage collection to automatically claim memory
not used. I also don't know if it has memory leak. Just too much
overhead to deal with before you start a new project. Not worth it.


Java does have automatic garbage collection, but another thing I'd consider
is whether or not your app needs to run on multiple platforms. If it's not a
web app (you didn't mention), and you just need to target Windows, I
wouldn't consider switching.
 
This is Java's standard approach to event wireups. I'm sure it becomes
intuitive after a lot of time coding in Java, but it seems pretty indirect
and clunky to me.
--
http://www.tangiblesoftwaresolutions.com
C++ to C#
C++ to VB
C++ to Java
VB & C# to Java
Java to VB & C#
Instant C#: VB to C#
Instant VB: C# to VB
Instant C++: VB, C#, or Java to C++/CLI
 
Java does have automatic garbage collection, but another thing I'd consider
is whether or not your app needs to run on multiple platforms. If it's not a
web app (you didn't mention), and you just need to target Windows, I
wouldn't consider switching.

It'll be a Windows Forms application on Windows XP (not a web
application).
 
Curious said:
I saw a lot of "interface" stuff in this API in Java, and kind of feel
scared, because I'm not into that.

What exactly do you mean by "a lot of 'interface' stuff"? It's not like
C# doesn't have/use interfaces too - and if you're avoiding or ignoring
them at the moment, you're not making full use of the language.
 
Back
Top