Like Tree21Likes

C++ or C#?

This is a discussion on C++ or C#? within the General Discussions forums, part of the Community Boards category; I am using Visual C++ or visual C#, which should I use?...

  1. #1
    Registered User
    Join Date
    Apr 2014
    Location
    Hong Kong, Hong Kong
    Posts
    16

    Question C++ or C#?

    I am using Visual C++ or visual C#, which should I use?

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,532
    What kinds of programs are you interested in writing?

    Programming languages are tools (much like a hammer and saw are tools for a carpenter).
    Picking the right tool(s) for the job at hand is vital.
    Masterx and Jimmy like this.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Registered User
    Join Date
    Apr 2014
    Location
    Hong Kong, Hong Kong
    Posts
    16
    I wanna make a game, but I'm making a calculator to start.

  4. #4
    SAMARAS std10093's Avatar
    Join Date
    Jan 2011
    Location
    Nice, France
    Posts
    2,681
    C++ I would say is the way to go then.
    Code - functions and small libraries I use


    It’s 2014 and I still use printf() for debugging.


    "Programs must be written for people to read, and only incidentally for machines to execute. " —Harold Abelson

  5. #5
    Registered User
    Join Date
    Apr 2014
    Location
    Hong Kong, Hong Kong
    Posts
    16
    Thanks, can anyone compare them?

  6. #6
    Registered User
    Join Date
    Nov 2012
    Posts
    1,097
    This question should be in a more general forum.

    C# runs in a virtual machine and mostly assumes prescence of a .NET framework. In practice it makes it easier to develop Windows applications, if that is your target.

    C++ compiles to native code and makes minimum assumptions about the underlying system. There is no built in GUI or graphics support, so to get those features you generally choose the libraries you want and add them to your project. In practice it probably takes more effort to get productive in C++ but once this effort is exerted you have more possibilities than in C#.

  7. #7
    Registered User
    Join Date
    Apr 2014
    Location
    Hong Kong, Hong Kong
    Posts
    16
    thx!

  8. #8
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,712
    Moved to General Discussions.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  9. #9
    Registered User MutantJohn's Avatar
    Join Date
    Feb 2013
    Posts
    1,058
    Hmmm.... This is a tough question to answer. I think C# is quicker and easier if you want to keep your applications more Windows friendly. This isn't to say that Unix-like systems won't be able to benefit from your code but I'm not sure how easy it is to port C# code between platforms.

    I've found something that might help though. Assuming you know C++ and C# well enough, this might help :

    C# for C++ Developers

    and

    C++ vs. C vs. C# - C++ Forum

    Edit : I'm someone that loooooves to focus on performance or optimizations so C++ is my favorite. Or at least, I try​ to focus on performance, ha ha.
    Last edited by MutantJohn; 04-27-2014 at 10:43 AM.

  10. #10
    Registered User
    Join Date
    Apr 2014
    Location
    Hong Kong, Hong Kong
    Posts
    16
    Dude, you guys are nicer than what i expected, I think there might be flamewars (I am ready for it)

  11. #11
    Registered User
    Join Date
    Jun 2005
    Posts
    6,284
    Quote Originally Posted by MutantJohn View Post
    I'd tread carefully when reading those links.

    The first is clearly written by someone (or someones) who knows C# a lot better than they know C++. Some of the things stated to be "common" in C++ are considered really bad practice in C++.

    Although some posts in the second link are alright (people taking a balanced view in which C, C#, and C++ all have their place), most of the posters are writing to advocate one or other of the languages.

    As a general rule, it is a mistake to reason about any one of these languages based on experience in another. The languages are too different for that sort of thing to work well. A C# developer who knows a little bit of C and C++ is rarely a useful source of information about C or C++. That sort of statement cuts each way too.
    Salem and Jimmy like this.
    Right 98% of the time, and don't care about the other 3%.

  12. #12
    Registered User
    Join Date
    Apr 2014
    Location
    Hong Kong, Hong Kong
    Posts
    16
    I've decided to go with C#, I can use it in Unity, I wanna learn unity, dude.

  13. #13
    Registered User MutantJohn's Avatar
    Join Date
    Feb 2013
    Posts
    1,058
    Bro, I'm so glad we helped you come to a solid conclusion, mang. Manger. Bro-tastic voyager, I wish you only the best of luck in your coding adventures!

  14. #14
    Unregistered User Yarin's Avatar
    Join Date
    Jul 2007
    Posts
    1,620
    Quote Originally Posted by lolllol View Post
    I am using Visual C++ or visual C#, which should I use?
    Use C#, it's by far better.

    C# is bound to the garden of Microsoft, where things are kept nice and ordely for everyone's benefit. But C++ is on any random platform, it's freedom is bad. Like it would be for weed.
    C# uses a nice massive runtime, but C++'s runtime is pretty small and ubiquitous. So when your users don't see those dependencies they'll think it's not a very well supported program.
    C# is dynamic, so when things take a long time to happen, your users will know it's getting stuff done. But C++ is natively compiled so when things happen fast, your users will think it's not getting any real work done.
    C# is spontaneously garbage collected, so you can write code without caring about resources. In C++ you're encouraged to use predictable features like RAII, and when you have to consider everything your code is doing it hurts your productivity.
    Last edited by Yarin; 04-29-2014 at 10:27 AM.
    A class that doesn't overload all operators just isn't finished yet. -- SmugCeePlusPlusWeenie
    A year spent in artificial intelligence is enough to make one believe in God. -- Alan J. Perlis

  15. #15
    Registered User MutantJohn's Avatar
    Join Date
    Feb 2013
    Posts
    1,058
    That's facetiousness, right? Because right now I'm laughing so hard XD

Page 1 of 4 1234 LastLast
Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21