aspose file tools*
The moose likes C / C++ and the fly likes C++ vs C# Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Languages » C / C++
Bookmark "C++ vs C#" Watch "C++ vs C#" New topic
Author

C++ vs C#

Aj Singer
Greenhorn

Joined: May 31, 2011
Posts: 4
Why is it worthwhile to learn C++ instead of C#?

Thanks!
-adam
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14268
    
  21

Welcome to the Ranch.

This question is impossible to answer without any context. Whether it is worth learning any subject (a programming language, or anything else) depends entirely on whether you think you are personally going to need it for your job, or for other purposes.

If you're aspiring to become a game programmer, then you'd probably want to learn C++, because most big, high-performance games are still written in C++. If you want to become a .NET developer, you'd probably want to learn C#.

In general, if you want to become a good software developer, it's good to learn more than just one programming language.

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39393
    
  28
Welcome again

The two languages are very different from each other. C# is more similar to Java™ than any other language.

There are problems about learning programming with .NET and C#, particularly that a particular IDE (=integrated development environment) is used. So your learning is liable to be linked to that IDE. You never see a lot of the code, which is generated automatically.

The custom in C++ (and C, and Java™) is to write all the code by hand, so you actually see everything you use. C++ has a particular difficulty, which might make it better for learning, that it still implements pointers. Pointers are difficult to learn, but once you have understood pointers, much of the rest of programming is easy by comparison.

Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19718
    
  20

Campbell Ritchie wrote:There are problems about learning programming with .NET and C#, particularly that a particular IDE (=integrated development environment) is used. So your learning is liable to be linked to that IDE. You never see a lot of the code, which is generated automatically.

Although Visual Studio is often used for writing C#, it's not necessary. The .NET framework comes with its own command line compiler, C:\WINDOWS\Microsoft.NET\Framework\vXXX\csc.exe or C:\WINDOWS\Microsoft.NET\Framework64\vXXX\csc.exe, where XXX is the .NET version. Combining that compiler and writing the code by hand (as you can do with Swing / AWT applications) allows you to write complete applications without any IDE.
The other way around, you can use Visual Studio (or any other IDE like Borland's old C++ Builder) to create C++ applications using an IDE.

Personally, I use SharpDevelop because I'm not as familiar with C#'s GUI development as I am with Java's (and don't like Visual Studio Express, and can't afford the non-express version), and for the few .NET programs I write I prefer the quick approach.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Aj Singer
Greenhorn

Joined: May 31, 2011
Posts: 4
Thank you all very much!
Brian Overland
author
Ranch Hand

Joined: Sep 09, 2011
Posts: 36
The answers here are very good. C# and C++ (as well as Java) are great langagues. But the considerations already mentioned apply.

I think C++ is particularly fascinating because of all that it allows you to do with user-defined data types (classes) -- including operator functions, customized output formats for new data types, etc. -- but then again, I'm biased.

You'll also find the capabilities of the STandard Template Library (STL) now standard in all nearly all shareware compilers, to be amazing.

Brian Overalnd
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: C++ vs C#