• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

C++ vs C#

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why is it worthwhile to learn C++ instead of C#?

Thanks!
-adam
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Marshal
Posts: 76433
366
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

 
Sheriff
Posts: 22683
128
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Aj Singer
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you all very much!
 
author
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
We're being followed by intergalactic spies! Quick! Take this tiny ad!
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic