You are here:

C++/C# vs Java vs C++

Advertisement


Question
QUESTION: Hello Sir,
I am a 21 years old guy. Don’t really know much about programming (especially OOP) and software development. Though am pretty good in C and data  structures.  Am  not particularly interested in embedded prog or designing drivers.
I am interested in hardcore prog, ie building applications.
I am now turning my attention towards OOP. But I am pretty confused which one to pursue - C# or Java.
What sort of softwares/application can be built by C# and JAVA. Which one should be preferred and why? Is it that C# is preferred for a certain type of application and Java for something else.
I also wish to know where should  VC++ replace C#.  And why is C# more famous than VC++.

In which environment JAVA is more preferable to C#.
Can everything that can be done in JAVA , also be developed in C# and vice versa.
All I know is that .Net is from MS and Java to SUN.

Thanking you in advance.

ANSWER: At the outset, let me clarify that I have done most of my programming in C++ and Python. I've just done some background checks on C# and Java and written a few programs using these languages. With that caveat in place, these are my impressions of C# and Java.

1. If you get to know one of these languages well, you will have absolutely no problem picking up the other in just a couple of days.

2. Both C# and Java target the same kind of applications. Neither can step into the niche occupied by C/C++ for performance critical platform/middleware applications. And languages like Python beat both C# and Java hands down on development time and ease of use.

3. Overall, I feel that C# provides greater expressiveness and is more suited to writing performance-critical code than Java, while it shares Java's simplicity. C# is faster to develop in (especially GUI design), has a better IDE then any of the various Java IDEs out there, one can perform lower level operations in a much easier and much more efficient way (for instance native code invocation), and in my experience clearly outperforms Java.

4. Java is better at cross-platform compatibility. java is ported everywhere, will run on almost every system, though in some cases the code would require tweaking. Right now C# is, in effect, limited to Microsoft platforms. Perhaps when Mono becomes more mature, it might make more sense to use C# for multi-platform development.





---------- FOLLOW-UP ----------

QUESTION: Gr8. Thanx...!

Being from c++ background, can u plz give a few examples of middlewares built in c++. Or applications that are preferably built in c++.
Which c++ compiler is the best?I have heard that C++ is most preferred for system prog. Is it mainly about driver design ? Can u also explain middleware and list examples?
Whats is SCADA and is c++ used for it?
I lov data structures. Where r they primarily used, and for what purpose?

Thanx again...!

Answer
> a few examples of middlewares built in c++. Or applications that are preferably built in c++.

Many examples can bew found here: http://www2.research.att.com/~bs/applications.html


> Which c++ compiler is the best?

There can be no one compiler that is best for everyone, people's needs differ too much for that. The GNU compiler g++ and the Microsoft compiler VC++ 8.0 are both good compilers which are heavily used.


> I have heard that C++ is most preferred for system prog. Is it mainly about driver design

C++ can be used for system programming. C too is still used heavily for that.


> Whats is SCADA and is c++ used for it?

See: http://en.wikipedia.org/wiki/SCADA


> I lov data structures. Where r they primarily used

They are used everywhere in programming.


> and for what purpose?
Different data structures are used for different purposes. For example B+ trees are used for:

"The primary value of a B+ tree is in storing data for efficient retrieval in a block-oriented storage context — in particular, file systems. This is primarily because unlike binary search trees, B+ trees have very high fanout (typically on the order of 100 or more), which reduces the number of I/O operations required to find an element in the tree.

NTFS, ReiserFS, NSS, XFS, and JFS filesystems all use this type of tree for metadata indexing. Relational database management systems such as IBM DB2, Informix, Microsoft SQL Server, Oracle, Sybase ASE, PostgreSQL[, Firebird, MySQL[ and SQLite support this type of tree for table indices. Key-value database management systems such as Tokyo Cabinet and Tokyo Tyrant support this type of tree for data access. InfinityDB is a concurrent BTree." - from http://en.wikipedia.org/wiki/B%2B_tree  

C++

All Answers


Answers by Expert:


Ask Experts

Volunteer


vijayan

Expertise

my primary areas of interest are generic and template metaprogramming, STL, algorithms, design patterns and c++09. i would not answer questions about gui and web programming.

Experience

over 15 years

Education/Credentials
post graduate engineer

©2012 About.com, a part of The New York Times Company. All rights reserved.