Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Debate: C# v. C++ v. Java

Status
Not open for further replies.

robwistar

Technical User
Jun 5, 2003
29
US
I just graduated college with a Computer Engineering degree. In essence, this means I know a bit of programming and a bit of Electrical Engineering (heavier on the electrical engineering side).

I have had a fair amount of Java experience in my early years at college, and some C++ in high school. It's been about two years since I've really dealt with either, so I'm a bit rusty.

I have a new project to do at work, which (hopefully) doesn't require a specific language (you can write directly to memory addresses in Java and C#, right?). I want to use this project as an opportunity to start to get really good at one language. Though I relaize that when you know one, you can usually figure out another pretty quick.

Anyway, the question up for debate: what language will rule?

My coworker believes that C++ is on its way out. He claims that Microsoft is pushing C#, so C++ loses its main application. Then Java will be embraced by the anti-Microsoft crowd.

I am hoping that Java is on its way out. It was a great idea, but it just runs like ass, and it's a little too stringent on the object-orientation (no structures, unions, or C++-style enumerations). Side topic - any truth to the rumor that M$ is intentionally making Java run poorly on Windows boxes?

C# seems like a great idea from the *propaganda* that I have read, but it reeks of Microsoft. I must say, I can't ignore a great idea because I hate the source.

I realize that posting this on the C# forum may yield a somewhat biased response, but I suspect any of you guys (and gals) who have been around a while know a lot about all the languages, especially since C# is relatively new.

So where do you advise the newbie to cocentrate?

Rob [atom]
 
Writing to memory in c# is not the common way. I don't know a lot about that, but as you know pointers are not allowed in java. In c# you can use pointers under "unsafe" statement.
 
"My coworker believes that C++ is on its way out. He claims that Microsoft is pushing C#, so C++ loses its main application."

Not meant for the same jobs. C++ is lower level than C#. C++ will continue to have uses.

Java v C#....much of a muchness is if don't mind running on Windows at the moment, not sure on how far Mono is to porting .Net Framework. Pays your money, takes your pick.

Me, VB.Net all the way. Simple to read code with same advantages of C#. But I like a simple life!

Craig
 
i would have to agree with craig's opinions of c++.

i tend to look at c# vs java this way; they're both so damn similar as not to bother me when moving from one to the other, so i really just pick and choose based on the environment. ie, if i want something to run in the jvm, i write it in java.
 
I'd guess that C++ will be to future programmers what Assembly is to us today: if you need something done extremely efficiently, with as little resources as possible, use C++. You have greater control over the machine than with C#, VB.NET, Java, etc. because it's a lower-level language, as was stated above. I think that these languages are probably going to become the mainstream programmer's tools. I doubt if there will be a language that stands in a class by itself.
 
Thanks for the input everyone. I'll use C# for this project, but it seems I should stay on top of C++ and Java. If Java and C# as similar as seanbo suggests, that shouldn't be hard.

Thanks again!

Rob [atom]
 
Hi,
C# is not lower than C++.NET!
The C++.NET 2003 is more powerfull than C#. There are things that you can do only in C++.NET 2003 and not in C# ( for example, templates).
But the C# and C++.NET will be do the same very soon. The both language will coexist and Microsoft continues to develop in C++.NET 2003.
If you know C++ and you want to choose between C# ,C++.NET and Java , I recommend you to start with C#.
Why?
1. OO
2. simpler
2. powerfull
3. clear
4. safe or unsafe only if you want
5. easy IDE and deployment

Good luck!
obislavu



 
"But the C# and C++.NET will be do the same very soon."

Well all the .NET stuff is managed code as I understand it. If you were to use C++ (not .NET) or any other language that directly comiles to executable code, that will always be more powerful than managed code, right? Even unsafe managed code?

This is actually a concern, becaus eventually I will be writing code to communicate directly with embedded systems such as smartcards.

Rob [atom]
 
although you're generally right, it might be better to say 'fully compiled code is potentially faster than managed code'.

it's easy to produce something that runs fairly quickly with a language like c#, that would only pelt along with c++ if you really knew what you were doing.
 
"... it might be better to say 'fully compiled code is potentially faster than managed code'."

So in managed code you have full access to all the same resources that you have with unmanaged code?

Rob [atom]
 
not directly. you're limited by the on-the-fly compiler, but there are ways of getting around this. good use of fully compiled dlls etc. (so we're always going to be going back to writing full compiled stuff).

managed code lets you write fast, high-level programs because it inherently lends itself to a higly object oriented, multi threaded language - like c#, and now even vb.
 
In some cases you may need to use more than one language for a project. Johnson Controls, for instance, uses multiple languages for their latest MetsSys software for building automation.

The code that communicates with the building controls is written in C++, the logic/data-access layer is built in C#, with that logic/data being served up by ASP.NET Web Services. The XML Web Services are then consumed by a Java GUI.

It is extremely efficient, and one of the best implementations of each technology I have seen to date.
 
Craig0201
>> Me, VB.Net all the way. Simple to read code
[lol] That's easy for a VB'er to say... looks like a freakin circus to me [lol]

C++ is not going anywhere for a while. Why, very powerful OOP and as others have stated speed.

C# helps on the MS Platform since it may keep people that shouldn't be messing with C++ out of it. [lol]

C# (.NET/CLR <whatever>) and Java have many architectural parallels. Neither one is similar to C++ beyond syntax. Probably the biggest difference between Java and .NET (C#) is the API's. Both of them are rather large and of course almost completely different. Sure there are some similarities like IO Streams etc. But for the most part the learning curve when moving from one to the other is the API.

>> Anyway, the question up for debate: what language will rule?

I doubt that any of them will rule in the near future. The bottom line is that it’s really going to depend on where you work. Most companies, shops are not going to allow you to choose. Some will, I happen to work in an environment where I use all three.

Of course so far I have only done prototyping with C# but I must say that desktop application development with C# in Visual Studio is… umm.. I don’t think I can accurately describe it (amazing maybe). Now keep in mind I have not done a complete complex application yet. There are many things I have yet to attempt in C# so I am still not totally convinced, but so far WOW. Did I say WOW?

I do believe you will see .NET gaining significant momentum in Microsoft Development Environments. It is just way better than Delphi or VB. Beyond that who knows past a couple of years? Things change so fast in this industry.

Ok… I hear you all screaming, &quot;Shut up already&quot; [lol]


-pete
 
Java, C++ and .Net are all used differently. It's incorrect to state that one of them is &quot;better&quot; than the other. Java is great it you want your software to run on just about all platforms. Also it scales very nicely when designing n-tier applications. C# is similar to Java but only runs on Microsoft platforms (they are developing or have developed proof of concept run time environment for Linux, but don't know if they will ever be released). C++ is very beneficial when you are doing systems programming. C++ is used heavily in government and military projects, and will remain so for a quite some time. I prefer Java because it's been around for a few years now and is more mature than .Net. Not to say it's any better.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top