Welcome Guest! To access all forums & features, please register an account or sign-in. → Why register?



is c# better then c++?


53 replies to this topic - - - - -

#1 togerland

    Neowinian³

  • 415 posts
  • Joined: 06-June 07

Posted 08 May 2012 - 08:36

What is easier to learn and does it work on linux?


#2 htcz

    Resident Elite

  • 1,821 posts
  • Joined: 22-July 11

Posted 08 May 2012 - 08:45

Posted Image

No seriously, On Linux you have Mono which is pretty good but not 100% polished. C++ does set some important begineers lessons in programming but C# is great :)

#3 DrakeN2k

    Resident Elite

  • 1,007 posts
  • Joined: 04-December 10

Posted 08 May 2012 - 08:50

I would say c#

#4 Lant

    Resident Elite

  • 1,532 posts
  • Joined: 13-April 06
  • Location: North London, UK

Posted 08 May 2012 - 09:06

My answer would be to say that they are different. They are each better than the other at certain tasks.

Regarding ease of use, there is no completion, C# wins hands down here.

#5 inferniac

    Neowinian Wise One

  • 5,309 posts
  • Joined: 27-April 09
  • Location: Wroclaw, Poland

Posted 08 May 2012 - 09:13

View Posttogerland, on 08 May 2012 - 08:36, said:

What is easier to learn and does it work on linux?

No C# doesn't work on linux, on windows it's better than c++.

#6 htcz

    Resident Elite

  • 1,821 posts
  • Joined: 22-July 11

Posted 08 May 2012 - 09:20

View Postinferniac, on 08 May 2012 - 09:13, said:

No C# doesn't work on linux
What?

http://www.mono-project.com/Main_Page

#7 nik louch

    ..:::..:::..:::..

  • 31,367 posts
  • Joined: 14-January 03
  • Location: Leicester, UK
  • OS: Windows 7, OSX, Android, Ubuntu
  • Phone: Galaxy Note II

Posted 08 May 2012 - 09:30

C# is arguably an easier language to get into that C++. A lot of the management is done for you, memory, and so on. However, there is an underlying feeling that C++ is more powerful overall if you want to jump down to the depths (I can't argue either way on this, I make apps that don't require me to go THAT deep).

As for Linux, yes - there is MONO, but it's a port, it's not pure C#.

#8 Slugsie

    NeoSlug

  • 608 posts
  • Joined: 10-October 03

Posted 08 May 2012 - 10:06

To decide which is better we need to know what you want to use it for. It's a bit like asking which is better, a Ferrari or a Mini van? Each has their uses and pros/cons, and if you make the wrong choice you will find things very difficult.

C++ is ultimately more powerful, and allows you much finer grained control. It is essentially the language that most of the big OSs are written in. But for most of us normal programmers their is no need for that level of control, especially when you consider that if you get it wrong things will go disastrously wrong very quickly. C# will be easier to learn, and if nothing else will give you a basic grounding that you can use to move up to C++.

#9 Stephen

    Neowinian Senior

  • 3,052 posts
  • Joined: 17-July 05
  • Location: Manchester / Huddersfield, UK

Posted 08 May 2012 - 10:06

View Postnik louch, on 08 May 2012 - 09:30, said:

C# is arguably an easier language to get into that C++. A lot of the management is done for you, memory, and so on. However, there is an underlying feeling that C++ is more powerful overall if you want to jump down to the depths (I can't argue either way on this, I make apps that don't require me to go THAT deep).

As for Linux, yes - there is MONO, but it's a port, it's not pure C#.
c# is an open standard, mono is an implementation of that standard as it the .net framework. afaik

#10 inferniac

    Neowinian Wise One

  • 5,309 posts
  • Joined: 27-April 09
  • Location: Wroclaw, Poland

Posted 08 May 2012 - 10:42

View Posthtcz, on 08 May 2012 - 09:20, said:

Didn't knew about that, shame I can't edit my previous post.

#11 Kami-

    ♫ d(-_-)b ♫

  • 3,624 posts
  • Joined: 28-July 08
  • Location: SandBox

Posted 08 May 2012 - 11:03

View PostStephen, on 08 May 2012 - 10:06, said:

c# is an open standard, mono is an implementation of that standard as it the .net framework. afaik
Correct; each is a framework built on the standard.

#12 +Majesticmerc

    Resident Idealist

  • 5,104 posts
  • Joined: 24-August 05
  • Location: United Kingdom
  • OS: Arch Linux / Win 7
  • Phone: HTC One X

Posted 08 May 2012 - 11:14

Yes, C# is better than C++. It's much more elegant and doesn't have much of the legacy stuff that comes with C++. Whether or not you want to use it as a learning language is more a personal preference thing. I tend to recommend C++ over C# for learning, since it gives you experience with lower level concepts such as pointers, whilst still offering object-oriented goodness, but C# allows you to dive straight in more easily and handles all the lower level stuff for you.

C# is supported (as others have said) on Linux through the Mono project, so it's perfectly usable on Linux. You may come into ideology conflicts with Linux users if you create software using it though :)

#13 spacer

    I'm awesome

  • 5,369 posts
  • Joined: 09-November 06
  • Location: Connecticut, USA
  • OS: Windows 7
  • Phone: Nexus 4

Posted 08 May 2012 - 11:26

Short answer: C# is far easier to learn if you're just starting out.

Long Answer: C# is far easier to learn, but you never really have to learn about memory management with C# which is an important part of software development. Though, it's arguably less relevant in C# because it's a managed language. You can always use C# to learn the ropes of object-oriented development, and then go back to focus on memory management in an unmanaged language like C++.

C# also has better tools, which can make it significantly less frustrating to develop. You can use Visual Studio for both languages, but C# has syntax highlighting, type-ahead, intellisense, and all other modern features of IDEs built into the language (it's a .NET language after all). C++ has some intellisense, but no highlighting or anything else. For beginners, this might be a huge obstacle.

For 99% of anything software developers will ever have to do, C# a good choice. For the other 1%, videogame development, C++ is arguably the better choice. And by "arguably" I mean C++ is only better if you're planning on writing the next Unreal Engine. C# is actually very capable for making small 2D and 3D games.

#14 MFH

    RAII fanatic

  • 1,972 posts
  • Joined: 24-June 10

Posted 08 May 2012 - 11:28

IMHO C++ is better; one of the first and foremost reasons is RAII which lets you manage resource (notice the difference here: GCs only manage memory!, but memory is the least dangerous garbage you may produce in a [modern] system…) in arguably the cleanest way possible - as you don't have to do anything yourself…

Another big advantage is that the whole library is developed under strict control in terms of runtime complexity - a feature you'll never be able to find under C♯ (or Java for that matter)…

#15 +articuno1au

    Neowinian Senior

  • 3,978 posts
  • Joined: 20-March 11
  • Location: Brisbane, Australia

Posted 08 May 2012 - 11:46

What's with all the soft wording :\

C++ is a much more powerful and faster executing language. Depending on the compilers you are using, you can even insert compiler code directly into the app for those processes you want to scream along. C++ runs as native code. It's compiled to be as efficient as possible on which ever platform you run it on. It's far "lower level" and lacks a lot of niceties that higher languages possess (such a Just-in-Time debugging).

C# is far FAR faster to deploy in. It is also far more forgiving of mistakes. In the process is being so, it is also far slower. Where as C++ runs code that is compiled directly for the CPU, C# runs as a managed language. You don't have to worry about assigning memory as the CLI handles that for you. You can make small mistakes in your code and have it continue to run. You can't do as much (but it's fairly negligible a difference for the average coder).

Personally, given the work I do, I much prefer C#. I enjoy the niceties of the .net framework (this should be what ultimately makes the decision for you). That said, I personally believe that if you want to be a serious coder, you should learn on C++ so you know exactly what C# is handling for you in the background. That way you will realise exactly how much CLI handles and why it's so much slower than C++ for HPC uses.

tl;dr - C++ first then C# if you plan to be a serious coder. C# first and no C++ if you don't care.