Results 1 to 21 of 21

Thread: C++ Vs C#

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2002
    Posts
    146

    C++ Vs C#

    I'm a VB programmer and completely new both to C++ and C#.

    Should I concentrate on learning C++ or C#?

    I'd like to know the complete comparison between C++ and C#..
    I'm afraid that learning C# might make me stuck in Microsoft Windows forever.
    Is C# only for windows platform?
    Which is better speed-wise?

    Please advice me.

  2. #2
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

    Re: C++ Vs C#

    C++ is faster, C# is easier. Both C++ and C# can be used on other platforms. Both is usefull. When you know one of them, the other should be easier to pick up. If you are a VB programmer, and there is nothign special you need to learn it for then I suggest C# first, so the step won't be THAT big for you.


    - ØØ -

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: C++ Vs C#

    Quote Originally Posted by NoteMe
    If you are a VB programmer, and there is nothign special you need to learn it for then I suggest C# first, so the step won't be THAT big for you.


    - ØØ -
    As a VB programmer, I can definately back NoteMe up on that statement. I was suprised at how quickly I managed to get the fundamentals down. I have played around with C++, and find it much less "friendly" than C#.

  4. #4
    Hyperactive Member vbcode1980's Avatar
    Join Date
    Nov 2005
    Location
    Anywhere the wind blows
    Posts
    365

    Re: C++ Vs C#

    Quote Originally Posted by winterslam
    I'm a VB programmer and completely new both to C++ and C#.

    Should I concentrate on learning C++ or C#?

    I'd like to know the complete comparison between C++ and C#..
    I'm afraid that learning C# might make me stuck in Microsoft Windows forever.
    Is C# only for windows platform?
    Which is better speed-wise?

    Please advice me.
    I should go for C# as it's gaining popularity fast.

    Like Noteme said, C# is not bound to Windows. It uses the .NET platform, which is available for other platforms than just Windows. And yes C++ is faster. But I think the difference in speed is neglectable in 'standard' applications. (Not games or something)
    I code C#....

  5. #5
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: C++ Vs C#

    C++ is more difficult to learn, which is one of the reasons that languages like Java and C++ were created in the first place. In all but the most demanding of scenarios C# will be just as efficient as C++, and the syntax is similar enough to VB.NET that it is not a huge leap, especially with all the common classes that the .NET Framework provides. Learning unmanaged C++ from Microsoft is likely to tie you to Windows anyway because of the Windows-only MFC library, if that still exists.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Sep 2002
    Posts
    146

    Re: C++ Vs C#

    How about the dependency of the products made in C#?

    Are they stand-alone or the whole .NET Framework is required to run them?

  7. #7
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

    Re: C++ Vs C#

    Yeah, that is the biggest negative thing about .NET applications. YOu need the framework. But once someone has used one .NET app they have it, so I can't see the big problem with it as many others do.


    - ØØ -

  8. #8
    Hyperactive Member GlenW's Avatar
    Join Date
    Nov 2001
    Location
    Gateshead, England
    Posts
    479

    Re: C++ Vs C#

    I've never understood people's concerns about needing the .net Framework, needing its VM didn't hinder Java.

  9. #9
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: C++ Vs C#

    Quote Originally Posted by GlenW
    I've never understood people's concerns about needing the .net Framework, needing its VM didn't hinder Java.
    I hear you. The only concern with needing the Framework is if your user downloading your app and is on a dialup connection. Otherwise you just provide the Framework in your installer, either downloadable or on CD, or provide a link to download it from the source.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  10. #10
    Hyperactive Member capsulecorpjx's Avatar
    Join Date
    May 2005
    Location
    Renton, WA
    Posts
    288

    Re: C++ Vs C#

    C# is more business friendly. It costs much less to develop and debug bus apps with .net or java apps.

    C++ is used for hard core programming, such as Games, Graphics tools, Operating Systems. Things where performance is key. At that point, Assembly is probably used too.

    Quote Originally Posted by winterslam
    I'm a VB programmer and completely new both to C++ and C#.

    Should I concentrate on learning C++ or C#?

    I'd like to know the complete comparison between C++ and C#..
    I'm afraid that learning C# might make me stuck in Microsoft Windows forever.
    Is C# only for windows platform?
    Which is better speed-wise?

    Please advice me.
    "I like to run on treadmills, because at least I know I'm getting nowhere."
    - Me

  11. #11

    Thread Starter
    Addicted Member
    Join Date
    Sep 2002
    Posts
    146

    Re: C++ Vs C#

    Actually I'm not a big fan of dependent programs. Visual Basic itself requires runtime library files to run.

    I don't know what microsoft's problem is. Why can't they just make the products run on their own.
    I believe C# produces intermediate code just like bytecode in Java.
    But mose computers have VM installed, and I don't think many computers will have .NET framwork installed.

  12. #12
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: C++ Vs C#

    Quote Originally Posted by winterslam
    But mose computers have VM installed, and I don't think many computers will have .NET framwork installed.
    No computers had a Java VM installed until either the user installed one or the OS was released with one included. That is the exact same situation with the .NET Framework. More and more people will install it over time and Vista will come with it pre-installed so it won't be an issue then. If you don't have the .NET Framework then you lose every class that it contains. Every language needs a decent class library, so the .NET Framework provides one of the best around, plus it provides automatic garbage collection and god knows how many other useful things. It also saves us from ahving to use Windows APIs in the vast majority of circumstances, and I for one am glad about that.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  13. #13
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: C++ Vs C#

    1) More and more computers will have the .NET framework installed as time progresses, due to it being shipped with Windows (as of XP SP2) and distributed with new .NET applications.

    2) The requirement for the .NET framework enables platform-independence, as platform-specific versions of the framework can run .NET assemblies that are the same for all platforms.

    3) The JIT (Just-In-Time) compiler model used by the .NET framework does in fact (in theory) enable .NET applications to run more efficiently than C++ applications, as they are compiled ON the exact platform that they will be running on and can thus use all platform-specific optimisations in the code, whereas compiled applications (C++ etc.) must be compiled using code that runs on MOST platforms (hence without such a fine level of optimisation).

  14. #14
    Hyperactive Member umilmi81's Avatar
    Join Date
    Sep 2005
    Location
    Sterling Heights, Mi.
    Posts
    335

    Re: C++ Vs C#

    Why would you want to code for a non-windows system? Does anyone actually own one? I always thought they were a myth. Like Santa.

  15. #15
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

    Re: C++ Vs C#

    I am sitting in Solaris right now.. And linux on my other box...and windows on the 3rd box here at work.. My secretary looks nice behind her mac..


    - ØØ -

  16. #16
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985

    Re: C++ Vs C#

    C#, the language itself is platform-independant and standardized. The only problem is there are two compilers for it: The .Net SDK from Microsoft (Which only works on Windows) and Mono (which currently only works somewhat on Linux and a version of OS X is in the works but is, like 2% completed). The .Net Framework and Mono include many non-standard items like GUIs, Networking, XML Readers, etc...

    So, until someone writes a standardized C# compiler, then it really isn't platform independant.
    Quote Originally Posted by jmcilhinney
    No computers had a Java VM installed until either the user installed one or the OS was released with one included.
    Java no longer comes installed on Windows XP and later versions because of a legal issue between Microsoft and Sun.
    Quote Originally Posted by penagate
    3) The JIT (Just-In-Time) compiler model used by the .NET framework does in fact (in theory) enable .NET applications to run more efficiently than C++ applications, as they are compiled ON the exact platform that they will be running on and can thus use all platform-specific optimisations in the code, whereas compiled applications (C++ etc.) must be compiled using code that runs on MOST platforms (hence without such a fine level of optimisation).
    This is not entirely true. They will NOT run more efficiently than a C++ application. First off, C#, VB.Net and managed C++ all use .Net's garbage collector, which already gives it a large overhead. There are many more layers of abstraction (even with the native image) so C# and managed C++ will never be more efficient than a pure C++ application.

    With C++, you can prove a huge amount of optimizations without knowining the arch. Here are some of the optimizations I use in C++:
    Code:
    -O3 -fforce-addr -fomit-frame-pointer -finline-limit=2000 -fsched-spec-load -fmove-all-movables -freduce-all-givs -ffast-math -funroll-loops -fprefetch-loop-arrays -mmmx -msse -mfpmath=sse -minline-all-stringops -maccumulate-outgoing-args
    The only arch specific optimizations here are the : -mmmx -msse -mfpmath=sse and those work on all PIIIs and Up (including AMD).
    Quote Originally Posted by umilmi81
    Why would you want to code for a non-windows system? Does anyone actually own one? I always thought they were a myth. Like Santa.
    Mac OS X and Linux are becoming increasingly popular. Each quarter, Apple sells a record breaking amount of Macs and it's continuing so Mac OS X is going to get a much much larger market share within the next few years. Once you use a Unix like system, you'll realize Windows sucks with multitasking. The only problem is, Windows is more friendly than Linux and has more software than OS X.
    Last edited by Kasracer; Nov 24th, 2005 at 01:12 AM.

  17. #17
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Re: C++ Vs C#

    ASM is better

  18. #18
    Hyperactive Member umilmi81's Avatar
    Join Date
    Sep 2005
    Location
    Sterling Heights, Mi.
    Posts
    335

    Re: C++ Vs C#

    Quote Originally Posted by kasracer
    Once you use a Unix like system, you'll realize Windows sucks with multitasking.
    I cut my teeth on SunOS 5.X (AKA Solaris 1) and Solaris 2. I'll throw down with anyone on Bourne Shell scripting and nawk.

    This is how you kill a hung text editor
    ps -ef | grep "vi" | awk '{print $1}' | kill -9

    Talk about intuitive There are some things I miss about Unix. The shell is super powerful. But as soon as you extend beyond moving around files and directories, and editing text, you find yourself deep in the mud. You just can't beat Windows for building robust user friendly applications, quickly.

  19. #19
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

    Re: C++ Vs C#

    I have buildt a crawler here at CERN in Python for Solaris...

  20. #20
    Addicted Member
    Join Date
    Aug 2005
    Location
    York
    Posts
    197

    Re: C++ Vs C#

    ASM is better
    ASM is better - and you can write platform independent ASM given that the platform remains on the same processor architecture i.e. it'll run on another Intel/AMD PC but not a PowerPC. You just have to use the various GUI frameworks like GTK and stuff for gui - and other platform dependent stuff.

  21. #21
    Addicted Member Pythagoras's Avatar
    Join Date
    Feb 2005
    Location
    Greece
    Posts
    137

    Re: C++ Vs C#

    I hear you. The only concern with needing the Framework is if your user downloading your app and is on a dialup connection.
    If your users are still using dialup, then I think there are bigger issues at hand.

    I think that its common place for most machines to have the framework installed, especially if you performing windows updates like we all should be.


    Although I do agree that MS should start making software that can run on its own. But that would also just bring us back to the days when DLL's were a problem, not that were entirely free of that yet.
    Visual Studio.Net 2003

    "Every man has been made by God in order to acquire knowledge and contemplate."
    --Pythagoras

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width