View Poll Results: C vs C# vs C++: Which is "better"

10. You may not vote on this poll
  • C#

    4 40.00%
  • C++

    5 50.00%
  • C

    1 10.00%
Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: Programming: C vs C# vs C++

  1. #1

    Default Programming: C vs C# vs C++

    I only want experienced programmers who have had enough experience with at least two of the languages to be able to compare and contrast them. I don't want replies like "well I haven't had much experience with ... and ... , but I think ... is great!" or "I don't know much about ... , but I've worked with ... and am learning ... and I think ... is the best".

    I know that this isn't a simple question and a language being "better" depends on the programmer and what it is the programmer wants to do exactly. There are two main things I want to program. My #1 priority is programming IOS Applications (apps for iPhones, iPads, and iTouches). This uses the C language, but I currently don't own a Mac, so I can't program with xCode, otherwise I'd be learning C and how to use xCode right now.

    I also want to do some game programming. According to Microsoft and the XNA Library for xbox 360 programming, they use C#, so I'm currently practicing programming with C# in Visual Studio.

    Essentially, here is the questions I'm hoping to get answered.
    In regards to the poll - "If I want to program apps, learning ... would help the most and if I want to program games, learning ... would be the best language to learn."
    Also, is the C language for Mac's and xCode different than the C language for Windows. Programming with xCode for Macs is waaaay different than Microsoft Visual Studio, so I wasn't sure if practicing C with VS would help me much or not (which is why I started practicing with C#).

  2. #2


    C is not OO. C++ and C# (really is should be C♯ and not C# (as in C-sharp, not C-number sign), but whatever, that's just me being pedantic) are. You say you want to do game programming? Better get an OO language.

    C++ is generally the language you want to learn for serious game programming. If you want to develop for XBOX Live Arcade or Windows phone, you should learn C++ or C#. If you want to develop for iOs, you should learn Objective-C.

    There's no real need to compare and contrast here, since you have a specific goal in mind, i.e. develop for platforms that have a very restricted set of acceptable languages. What should decide the language you learn is what you want to develop for, not which language is "better".

    (Also, I don't have much experience with C and no experience with C++ or C#, but there is really no need to have any experience to be able to tell you what language to use for platform X )

  3. #3


    I'm an embedded programmer so predominantly I work in C. I have used Microsoft C++ (using MFC, never got much into .NET) to build GUI test apps for some of the stuff I developed. It's interesting that a GUI -based operating system like IOS would use C, being GUI is far more adapted to event-based object-oriented programming like C++/#.

    Having said that, it's not too difficult a concept to see how that can be accomplished. We at my work have designed our apps (even though they are non-gui) around the concept of signals, flows, and state-machines all using C. We have to write our own signal/event handling engine and use the embedded OS's pipe routines to get the events to and fro. We use structures tied to a bunch of functions instead of a "class," but I'd imagine the idea is similar with what you have.

    What's your experience?

  4. #4


    As Near has said above, Apple iOS games are programmed with Objective-C normally. However, you can use C# and the .NET framework by using MonoTouch. I wouldn't really go in this direction though.

    Objective-C is a very unique language, unlike C++/C# really. It is well structured, and relatively simple to learn. There is nothing wrong with the language, and there are some great tutorials online.

    Now, to answer your question...


    C is a language that gives you full OS control (technically speaking), It's very low level where everything is pretty much controlled by direct memory, although; sometimes this can be 'masked' from the user. Now, it's not hard to learn; but very elegant C programs, that are well written are commonly very short in code... and very quick to run.

    C is also something that you will find absolutely necessary to get a job, even if they don't code in C regularly, it is likely it would be requested on your job application.

    It's a bit difficult to really describe the language, but it is really one of the more common languages, I think a lot of this has to do with it being used in OS programming as well.

    I personally, dislike C... But, in all honesty it is a well structured, and good language.


    C++ is the OpenGL programmers dream... It is very easy to understand if you have worked with Java, or have some good tutorials to follow. C++ is a nice syntax, with many more 'additional' tools for your support than C gives you. However, C++ still allows you to have all that low level access that C gives you, sometimes in a well structured, (And sometimes masked) format. In addition to this, C++ has *many* different ways to solve one problem (often, most are quite elegant).

    Once again, personally I am sort of indifferent about C++, but I do love it for Open GL


    C#, as my personal favorite language may come off a bit biased... But hey :3

    I find C# to be a very powerful language, with many different supported structures. It follows a nearly complete Java structure, but allows you direct memory access (however, I don't see why anyone would *want* to use it.) I have on some occasions, *had* to use direct memory access, however this was due to an additional framework I was using for a very specific task, and it wasn't actually managing it's own memory (which it wrote to memory blocks quite frequently), I had to go and clean this up myself.

    I won't lie, it was quite disgusting to do this.

    C# also has some *beautiful* GUI programming, with wonderful user control, the designer works -ok-, but if you are working in WPF, you can change the GUI design directly in XML code, which is wonderful! The XML coding is quite simple, and easy to learn... and yet, there is still tonnes that I don't know about WPF programming. There are some really neat things you can do with the control to make GUIs very well designed (from a UX Designer point of view).

    In WFA, it's slightly different, and more structured like Java code for the GUI itself. I prefer to build my GUIs here in the designer, since the designer works quite excellently, and I have rarely had to make some direct-code changes. It isn't hard to do though, so I wouldn't worry too much about this.

    The code of C# is pretty impressive, with many... MANY tools to your disposal, I joke with some of my friends that Apple claims "There's an app for that.", I believe that Microsoft should start claiming "There's a .NET Library for that."

    Of course, this isn't directly beneficial for a programming language.

    While C# may give you all these tools at your disposal (List sorters, Dijkstras, Floyd-Warshalls, Kruskals, Prims, Euelers algorithms, etc.) it doesn't really become a great asset to the 'unlearned' programmer. However, I strongly believe that ANY programmer should have a working understanding of all underlying data structures, and algorithms. This will help them make the best choices of which algorithms, and data structures to use, and how to use them, and when. While an unlearned person, will just use the first thing that works, or what someone online tells them.

    Last point I will make is that C# actually allows the user to use in SOME cases, some functional programming. Such as the MAP function, TAKE, TAKE_WHILE, etc. This is a great asset to any program where you will be using lists, which is in (every program I've ever written to be honest...)

    C# is what I like the most, and prefer to use for most things.

    Final notes:

    There is no "right" programming language. Programming languages are simply tools for developers to complete their required task. You can't really say any language is better than any other language, or focus on any one language. You need to get ALL the tools under your belt to be a successful programmer.

    In short, imagine asking a carpenter what tool was his favorite, A hammer, planar, sanders, or saws...

    It can't be answered, every tool is necessary.

    While this doesn't have a DIRECT correlation to programming, it is a good example.


    Then why did you ask! (Joking!), C# is my favorite language, and if you want to focus on one language (for now?) I would *personally* choose C#. It's a wonderful language...

    One last note about XNA framework since I didn't talk about it... The structure in this code is pretty nice as well, kind of similar to openGL, with the transformations and what not.

    It's hard to learn about this without the mathematical background required (in my opinion). Some users may disagree with me on this, but I think it is both beneficial and necessary.

    Anyways, good luck.

  5. #5


    My experience with these 3 languages:
    I've written a 2D game engine in C
    I've written a 3D game engine in C++
    I've taught summer workshops on how to program simple games to high school kids using C++ and C#
    I'm employed as a software engineer in the games industry, and I use C++ and C# on a daily basis.

    C is a subset of the functionality of C++. C++ compilers compile all C code, so even if you want to write C code, you can still write it in C++. I personally don't see a reason to develop new code in C, carrying it forth for legacy purposes is a different argument. You can also say that because of its reduced feature set compile times and linker times (especially if you're using templates) tend to be shorter, and object files smaller. The C++ feature set has some great stuff in it, but its achilles heel is that it almost gives you too much freedom. There's a bazillion ways to do anything in C++, and while none of them are "wrong", they all have different trade offs that should be carefully considered. As a note to your specific post, Objective-C for IOS is a slightly different language and it should be considered as such. I can't say too much about Obj-C because I don't have a Mac and therefore can't make IOS apps.

    For what it's worth, I really like C++. C++ is much more "close to the metal" than most other popular languages but, for most applications, you don't need the extra control that gets you, and often times it results in more of a headache than anything else. I personally like to be able to explicitly know when I create a struct or a class or instantiate an array how that corresponds to how it is mapped in memory, or exactly how long an object I put on the heap lives. The first time I started writing in C# after writing C++ for so long I nearly had a panic attack when I "new"ed something and never called delete. It's more of a comfort thing, there's no bells and whistles that try to read your mind, which means that you have to do everything right yourself. It also means that if something goes wrong, the problem definitely lies in either code you wrote, or possibly a library you linked in. Either way there's no unexpected consequences. All AAA games, definitely all ones on consoles, are written in C++ because games happen to be in that very small percent that need to be as close to the metal as possible to eek every last ounce of performance from the machine they are running on.

    C and C++ will never cease being used in environments where resources are very constrained, because they work so closely with the hardware that it gives the engineer very tight control over thsoe limited resources. However for PC development, or even phones as technology continues to get better resources are less limited, and the more important thing might be to get stuff working, tested, iterated and polished faster than making sure every last bit is used to its maximum potential.

    C# however is a fantastic language for the other category of tasks that don't absolutely require that extra fiddlyness that comes with C++. C# is clear, has a ton of syntactical sugar like lambdas, delegates, events, and some nice libraries that make normally difficult tasks straightforward (Threadpools are totally awesome). C# is all managed which means that you don't have that close control, but that does mean you can get work done faster and focus on performance at a level where it often matters more, at the algorithmic level. Although super high budget games are primarily written in C++, there are plenty of indie games that could easily run in C# (especially if you disregard that nasty third dimension). C# might not be the absolute fastest running, but it is the fastest for me to get something up, running, and polished. One of the places is is most evident is in UI development. I didn't like WPF/XAML a lot when I first started using it, mainly because I wanted to use it like winforms and XAML files tend to crash visual studio which can be frustrating. Once you really get the idea behind databinding and leverage WPF the way it was meant to be used it's really great. It's the best way I know of to hook up your UI to your backend data. Throw in the fact that intellisense for C# is like, psychic and that you could port your C# application to a web interface using silverlight and it's definitely a favorite.

    EDIT: I'll also add that C# is a much better "learning language" than C++ in some ways. Since it takes care of a lot of the hardware details for you, it similifies things a bit and maybe more importantly, for new people it allows you to get flashier things working a lot quicker. Many C++ programming courses have you outputting to a console for a year, whereas in C# you can program a whole UI and make a polished program after a few weeks of instruction. However, I'd also add that learning C++ in and out makes learning the languages that are derived from C++ a lot easier (like Java or C#). This is because the syntax is similar, but C++ also forces you to learn how things work at very low level. This means when you switch to something higher level, you still have the understanding of how things must be working at that low level, even if the language abstracts the details away from you. I often compare learning C++ to learning latin vs. one of the romance langages.

    If languages were cars, C would be like an ariel atom. Small, lightweight, fast, has all the necessissary components to get the job done. C++ would be like a Formula one racer, specially formulated for performance, but it has more knobs and switches than the space shuttle and you have to be specially trained to not crash it, let alone get the most out of it. C# would be like a Mercedes, also very fast, maybe not as quick as an F1 but it takes care of a lot of the nitty gritty for you so you can focus on the road ahead.

    As an additonal note, I haven't used XNA, but from what i've seen of it, like the rest of C# it does a really good job of exposing the parts of a game engine that are most important to get up and running quickly. In regards to Lobie's comment. The math skills and ease of assets for making 2D games over 3D games is an order of magnitude less, maybe a wider gap. If you aren't trained in some of the more exotic 3D math stuff going 2D first may be a really good option. You can always expand your engine to work in 3D later If you are interested in 3D stuff, I would *highly* recommend going to this website Real-Time Rendering Resources and picking up that book (the blog is also rad). It goes over a lot of the math and science behind 3D rendering in a platform agnostic way (though any shader examples I believe are written in HLSL/Cg) and is a decent primer or at least a good reference when you're exploring that stuff and you have questions like "What *is* a quaternion anyway?" or "Why is the CIE color space so important?" or "What does BDRF mean?"

    ---------- Post added 12-02-2012 at 10:08 ---------- Previous post was 11-02-2012 at 19:41 ----------

    Quote Originally Posted by Lobie View Post
    C# also has some *beautiful* GUI programming, with wonderful user control, the designer works -ok-, but if you are working in WPF, you can change the GUI design directly in XML code, which is wonderful! The XML coding is quite simple, and easy to learn... and yet, there is still tonnes that I don't know about WPF programming. There are some really neat things you can do with the control to make GUIs very well designed (from a UX Designer point of view).
    Also, Lobie have you had a reason to bind nested lists of objects to a treelistview yet? When I found out you could define hierarchical data templates that automatically fill ot the tree, and which can themselves have data templates my jaw dropped to the floor. That's probably the coolest thing I've done with WPF just because it was a really complicated UI with all these different levels and filters, and all I ended up having to do is binding my data to the treelistview and telling it how it should display each class it encounters and it was done in no time.

    I also might add in the interest of fairness that a lot of the functionality in the way of libraries is also available in C++ as well as it is available in C#. There are plenty of libraries that will sort lists or provide search algorithms like Djikstra or even A*. And there are lots of open source game engines and engine libraries you could use. I would also note that the new C++0x standard will introduce some of the syntactical sugar like lambdas, auto variables (though I really don't like these), range based loops (a very nice addition) and the ability to deduce the type of an object when you're inside a templated class or function.

    Also, if you like C# so much and if you're doing mobile development, you should make WP7 apps :P
    Last edited by LBcub; 12-Feb-2012 at 03:10.

  6. #6


    Thanks for the reply guys! I'm loving it!

    I didn't fully understand before how C, C#, and C++ were related. Which also explains why MSVS doesn't really have an exclusive compiler for C like it does for C# and C++. I did a semester of C++ and actually loved the syntax of it, but now that I can see what C# is capable of I'm starting to warm up towards it. I'm very torn between the two but I think I'm going to switch over to C++ for now. I'd rather learn too much now so that when I attempt to learn another language (like going from C++ to C#) it'd be a "step down" as far as difficulty goes.

    I absolutely love the tools and extensions that VS has for C# and it's going to be one of the things I'm going to miss once I take another crack at at C++.

    Thanks for the info guys, you really simplified things for me. Before I wasn't sure if I would have to learn C# for console game programming (and window based apps), C++ for some other game programming, and objective C for iOS development.

    But now, I feel that if I learn C++, then learning C# will be much easier and I shouldn't really attempt C until I have a Mac to do it on.

    So for now it's mastering C++ until I can get my hands on a Mac or I feel proficient enough in C++ to move on to C#.

  7. #7


    The argument I would make in your specific case is that C++ is a great language to learn in university because I think it's a great tool for learning how the computer works at a lower level, but if you're teaching yourself C# is going to get you a lot more bang for your buck. With C++ you really have to take your time learning about not only the syntax, but the way that the language interfaces with the machine. If your ultimate goal is to start programming a game for fun, going through C# and XNA will get you started faster.

    While I can guarantee C++ is the language of choice for big production console games, lets be honest, you're not going to be writing a big production console game. If this is your first project start with something simple, aim lower than you think you should and focus on seeing the project through to completion and polish. Seriously, make pong or brickanoid or something in XNA and see how awesome you can make it. Make sure its got a start screen, menus and all the things you'd expect of a real game. That's a really good experience if for no other reason then that it forces you to understand all of the pieces that go into a game. That way, you can either expand the framework you've built into bigger and better things once you've got the confidence that comes with actually finishing something, and if you do decide to delve into C++ you'll have a better idea of the gotchas and the stuff that takes longer than you thought it would.

  8. #8


    As others pointed out, x-code and Apple in general uses Objective-C hence the differences you mentioned, since these are actually different languages entirely.

    Sent from my iPhone using Tapatalk

  9. #9


    C#, definitely.

  10. #10


    LBcub's answer was quite thorough

    --C is a functional programming language. It's basically assembly on crack... with convenience syntax for things like control structures and dealing with memory. This is about as "close to the metal" as most people would ever want to go unless they're doing embedded programming on some very limited devices.

    --Objective C (what OS X uses) is an object oriented programming addition to regular C.

    --C++ is another separate object oriented programming addition to C.

    --C# as far as I know is an entirely new language that uses similar syntax to C++ and Java. I've always (which may demonstrate my ignorance of C#) referred to it as Microsoft Java. I'm pretty sure it compiles down to byte code which is run by a virtual machine similar to Java, and the little I've been exposed to certainly looks very similar to Java. For awhile it was just "Microsoft Java without the key thing that makes Java desirable: platform independence", but there have been additions to C# that make it in some ways better than Java as a language. Or rather more feature rich. I'm pretty sure e.g. that C# has real run time generics whereas Java, last I checked, was only a compile time feature for backward compatibility's sake. Also, there are non-windows implementations of the .NET framework which allows C# programs to be more portable. It's still not quite up to snuff from what I've read, but I have no actual experience programming in .NET or C# in particular.

    Memory management is really another thing entirely... I'm not sure if you have options in C#, but I'm pretty sure you do in Objective C. Whereas Java simply doesn't let you deal with memory on a low level.

    As far as what's "best"... and this is akin to a religious topic... if you're wanting to do iOS development, you're going to use Objective C and that's the end of that.

    As far as what's best to learn with... again, everyone has their own opinions of this... I've always been fond of learning straight C first and then adding an object oriented superset like C++ or Objective C afterwards. But then, I'm coming from the university experience side of things. C will get you a good understanding of how things "really work", because it kind of sticks your nose in it. It is not necessarily the most time efficient approach, but I think it's one that will be less likely to leave you with a "magical" perspective of computers.

    Once you've gotten an appreciation of that, you can move on to the OOP superset of your choice and appreciate what objects bring to the table and how they work.

    But that's just me.

    A lot of people (and a lot of people in the university setting... professors/etc) believe you should start right out with OOP so as to not be "tainted" by functional programming, because they really are completely different design paradigms. It probably partly depends on if you're a primarily top down or bottom up learner. I'm obviously prefer a more bottom up style. I like to know how details work then move on to how they combine to create more complicated things and so on. Some people (most?) do better going the opposite direction... seeing how things work at a high level... and then "ok, now that you understand that, let's explain the details". The nice thing about top down is you start at your goal and work your way down to some arbitrary detail level until you decide you don't care anymore. Whereas with bottom up, you have to start at an arbitrary level and that dictates what assumptions everything else is based on as you move up to your functional goal.

    Another thing that factors into it is the IDE. Your language can be feature rich, but if the IDE sucks, it's going to be a pain to work with for non-trivial tasks (especially if you work with multiple languages like most people have to do). Microsoft is known for having a very nice IDE. That being said, I never use it, so others would need to chime in there. Developers where I work that do C++ programming all use Visual Studio, but I'm always amazed at how few typical IDE conveniences they actually use. Like watching someone do a string search across source to see where a method is used makes my head hurt. Or doing a string based find/replace in a source file to rename a variable or method name.

Similar Threads

  1. Computer Programming?
    By BabyPandora in forum Computers & Gaming
    Replies: 6
    Last Post: 26-Jan-2012, 23:32
  2. Help with Flash programming.
    By LinkFloyd in forum Computers & Gaming
    Replies: 0
    Last Post: 08-Feb-2011, 01:34
  3. Computer Programming
    By tech50 in forum Computers & Gaming
    Replies: 20
    Last Post: 07-Jan-2011, 23:34
  4. Help with programming in C
    By mizzycub in forum Computers & Gaming
    Replies: 2
    Last Post: 12-Aug-2009, 20:54
  5. Programming
    By IncompleteDude in forum Computers & Gaming
    Replies: 20
    Last Post: 25-Mar-2008, 04:17

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  • - the Adult Baby / Diaper Lover / Incontinence Support Community. is designed to be viewed in Firefox, with a resolution of at least 1280 x 1024.