10 Replies - 1124 Views - Last Post: 14 June 2013 - 06:00 AM

#1 shortbus  Icon User is offline

  • D.I.C Head

Reputation: 17
  • View blog
  • Posts: 187
  • Joined: 26-March 13

what is better c# or c++

Posted 05 June 2013 - 04:49 AM

sorry if this is in the wrong section, I looked around and this seemed like the best place to post. Since school is coming to an end i figured the summer would be a good time to broaden my programming horizons and learn a new language. I did some research and i narrowed it down to c# and c++ since i currently am learning java and i want to move to something similar but with a little more power. The question i have is which one is used more in the field and what one is more like java?

Is This A Good Question/Topic? 0
  • +

Replies To: what is better c# or c++

#2 andrewsw  Icon User is offline

  • It's just been revoked!
  • member icon

Reputation: 3624
  • View blog
  • Posts: 12,538
  • Joined: 12-December 12

Re: what is better c# or c++

Posted 05 June 2013 - 05:03 AM

VB is better ;)

But seriously folks.. C# is nearer to Java than C++.

I'll let others comment on which one is better or used more.
Was This Post Helpful? 0
  • +
  • -

#3 Michael26  Icon User is offline

  • DIC-head, major DIC-head
  • member icon

Reputation: 362
  • View blog
  • Posts: 1,534
  • Joined: 08-April 09

Re: what is better c# or c++

Posted 05 June 2013 - 05:33 AM

My neutral answer :)
I would says that both are means to an end, C# and C++, it's just a matter of familiarity and past experiences. Try both

But i agree with andrew C# is more similar to JAVA than C++
Was This Post Helpful? 0
  • +
  • -

#4 macosxnerd101  Icon User is online

  • Self-Trained Economist
  • member icon




Reputation: 10669
  • View blog
  • Posts: 39,635
  • Joined: 27-December 08

Re: what is better c# or c++

Posted 05 June 2013 - 06:16 AM

Moved to Software Development. The Lounge isn't the place for programming questions.
Was This Post Helpful? 0
  • +
  • -

#5 Ryano121  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1362
  • Posts: 3,002
  • Joined: 30-January 11

Re: what is better c# or c++

Posted 05 June 2013 - 06:22 AM

It really depends on what you want to do with them.

We can't really comment on which one is better as they each have their benefits and limitations depending on what you want to create.

So yeah you need to give us an idea on what it is you like doing before we can suggest which one may be more beneficial.
Was This Post Helpful? 1
  • +
  • -

#6 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 3623
  • View blog
  • Posts: 11,291
  • Joined: 05-May 12

Re: what is better c# or c++

Posted 05 June 2013 - 07:17 AM

For example, if you are going to litter your code with P/Invokes and marshalling code to access Win32 APIs or some other external DLLs, you may be better off writing code in unmanaged C++ rather than C# if you can't find a pre-written C# library to hide that ugly and error prone mess from you.
Was This Post Helpful? 0
  • +
  • -

#7 lordofduct  Icon User is online

  • I'm a cheeseburger
  • member icon


Reputation: 2538
  • View blog
  • Posts: 4,639
  • Joined: 24-September 10

Re: what is better c# or c++

Posted 05 June 2013 - 08:19 AM

The 2 languages are two different beasts all together.

You probably were led to C# and C++ in your research because Java's syntax is "C-like", and C# and C++ are the most current languages with the "C" monicker.

Thing is, being C-like doesn't mean jack relative to how it actually compiles.

C++ is a compiled language (I'm ignoring MS C++/CLI). It gets compiled directly to machine code for distribution. It is completely unmanaged and allows you the programmer a LOT of freedom. It's nothing like Java when it comes to designing your program because Java isn't unmanaged compiled code.

C# is a managed language. It gets compiled into intermediate code that is then ran inside a runtime that compiles the intermediate code into machine code for that user. It's very similar to Java which also is compiled into intermediate code (byte-code I believe Java calls it) which is then compiled into machine code in the Java runtime. Because it's managed you don't have to worry as much about cleaning up memory and the sort.

Note there is a version of C++ released by Microsoft that compiles for use in the .Net runtime like C# does. It's usually called C++/CLI. Personally I don't know why anyone would use that madness... you get the complexity of the C++ language, but none of the benefits of the C++ compiling pipeline. Dafuq you do that for?

In the end, for you OP, your choice should be based on if you want to travel far or near. If you wanna stay close to home with Java, go C#. If you want to get out and see the world, go with C++.
Was This Post Helpful? 0
  • +
  • -

#8 jon.kiparsky  Icon User is online

  • Pancakes!
  • member icon


Reputation: 7884
  • View blog
  • Posts: 13,400
  • Joined: 19-March 11

Re: what is better c# or c++

Posted 05 June 2013 - 09:02 AM

Quote

what is better c# or c++


No.
Was This Post Helpful? 0
  • +
  • -

#9 cfoley  Icon User is offline

  • Cabbage
  • member icon

Reputation: 2045
  • View blog
  • Posts: 4,233
  • Joined: 11-December 07

Re: what is better c# or c++

Posted 05 June 2013 - 10:56 AM

Stay with the familiar and learn C#, or learn a bit more and go with C++. If you want to learn a language that requires a different way of thinking then go with a functional language like haskell or lisp.
Was This Post Helpful? 0
  • +
  • -

#10 BobRodes  Icon User is offline

  • Your Friendly Local Curmudgeon
  • member icon

Reputation: 574
  • View blog
  • Posts: 2,989
  • Joined: 19-May 09

Re: what is better c# or c++

Posted 10 June 2013 - 08:53 PM

Reminds me of when someone asked a chess commentator who he thought was the world's greatest chess player. The answer was "if chess is a battle, Lasker, if it is a science, Capablanca, and if it is an art, Alekhine."
Was This Post Helpful? 2
  • +
  • -

#11 frankpowell422  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 13-June 13

Re: what is better c# or c++

Posted 14 June 2013 - 06:00 AM

Both the languages are apt in their own places. It depends entirely on you, what are your requirements, what platform you wanna use etc. If you are asking which programming language is better then you will have to provide the ground as well on the basis of which you wanna compare both of them. And I totally agree with the "Chess Quote" of BobRodes.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1