Thread: c++ vs c#

  1. #1
    Registered User
    Join Date
    Sep 2005
    Posts
    36

    c++ vs c#

    Please - no one kill me. I know that this thread could potentially turn dangerous so just try to answer my question at hand.

    I know that c# is the new kid on the block, and it doesnt look like c++ users seem to be changing to it. For all my application making needs, I've used a scripting language called autoit (www.autoitscript.com), but it doesn't have a visual gui designer (gotta basically guess and check control positions), slower, and just not fit for bigger projects, so I'm thinking I should get involved with a real language.

    What I want to know is what language is better for application designing? Is it a matter of preference or is c# simpler? I'm majoring in computer programming next year and they don't have any c# classes (yet?), and the real world jobs I get probably would demand the use of c++ - so I don't want to go to c# even if it's easier for my personal usage if I can't use it at a job.

  2. #2
    Dump Truck Internet valis's Avatar
    Join Date
    Jul 2005
    Posts
    357
    Definitely go with C++ first.

    C# is incredibly slow and less cross-compatible than C++ (if you are using cross-compatible libraries as many do), C# must run on top of the .net framework, so not only is it slow running, it takes much time to load and the user is required to have the framework running (I have mine disabled in windows because it's bloated and I have yet to successfully setup mono on bsd)
    C# apps take enourmous amounts of memory.
    Lastly if you are concerned about making a win gui app quickly, just use mfc, it encapsulates enourmous amounts of windows stuff, for other gui apps, various easy to use cross-compatible libraries exist.

    I really don't know why anyone would ever program in C# unless you were doing server work with an asp frontend or something along those lines.

    There you have it, my angry rant of an opinion.

    edit:

  3. #3
    Registered User
    Join Date
    Sep 2001
    Posts
    4,912
    C# is incredibly slow
    Remember that it's JIT compiled. It's compiled to machine code the first time you run it on a particular machine. After that point, it's speed is actually close to that of C++.

    Yes, there is a drawback to using the framework, but it has advantages too. You can put together complete applications extremely quickly, and for some applications that's more important than fine-tuning every aspect of the speed of the program.

    The .NET framework is become more widely supported, with projects like Mono and Rotor, but I would still recommend C++, as it is already well-established - but I do recommend that once you have become proficient in C++ you start branching out into other areas - and C# may be a good option for you to try next.

  4. #4
    Software engineer
    Join Date
    Aug 2005
    Location
    Oregon
    Posts
    283
    There really is no verses here. C++ was made for a certain set of problems, and C# was also made for another set of problems. Coming across these problems are only yours to experience. Use the right language for the problem.

  5. #5
    Registered User
    Join Date
    Jun 2005
    Location
    Stockholm, Sweden
    Posts
    64
    Personally, I use C# if I need to make a GUI app and I know the target platform has the .NET Framework (or an open source implementation of it). The reason behind this is that it is a lot faster to get a product out the door if you are using .NET, and since people come to me and want stuff finished yesterday, development speed is more important than runtime speed.

    However if the app doesn't require a GUI or I have more time available, I'll go with C/C++ since it eliminates the need for the framework, which is a considerable overhead if you don't need the RAD features it provides.

    In short:
    C# is faster to develop in.
    C# is slightly slower at runtime and uses more system resources.
    C# requires the .NET framework (or an implementation of it) on the target machine.
    C/C++ is slower to develop in.
    C/C++ is faster at runtime and (usually) uses less system resources.

  6. #6
    Registered User
    Join Date
    Dec 2003
    Posts
    50
    Quote Originally Posted by ryeguy
    What I want to know is what language is better for application designing? Is it a matter of preference or is c# simpler?
    For me, it depends on the type of application and customer needs.

    For embedded applications, I use assembly, C or C++.
    For desktop GUI applications, I use MFC.
    For web-based applications, I use ASP.NET with C# .

    You need to know a few languages so that you can choose the best "tool" for the right job.

    Best Regards,
    Yeoh
    --

  7. #7
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,130
    What I want to know is what language is better for application designing? Is it a matter of preference or is c# simpler? I'm majoring in computer programming next year and they don't have any c# classes (yet?), and the real world jobs I get probably would demand the use of c++ - so I don't want to go to c# even if it's easier for my personal usage if I can't use it at a job.
    If you are a professional ( or on your way to become a professional ) there really is only one answer: learn both. Both have strong points and weaknesses. Learn to use the one that will produce the best solution for your problem at hand.

    Many of the real world (tm) jobs focus on problem solving, less on programmer attitude and hardware restrictions. Managers want you to get the job done. If you can do it inside the restrictions, you can get away with memory hogs and ugly constructs. Look at VB, it's widely popular. And not for it's elegance or efficience. Because it gets the job done.

    Focus on your requirements. C++ is memory efficient, fast but harder to program. C# has the .NET framework infrastructure that needs to be installed and has a memory overhead. It's not blazing fast, but programming is easy.

    If you need an application that needs pure power, needs to be very memory efficient and can come with an ugly user interface, OR if you have enough time on your hands to triple the effort to get a nice user interface, use C++. If your users have normal machines where 20MB of RAM usage is not worth thinking about, when you need a good user interface and you don't want to waste three times as long just because you're a C++ fanatic, use C#. Speed is not of importance on a client. Any language ( yes, even VB ) is faster than the user anyway ).

    Servers: C++
    Clients: C#
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

Popular pages Recent additions subscribe to a feed