C++ or C#.NET

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sotiris Salloum

    C++ or C#.NET

    I'm planning to enter the shareware business and I was wondering what is your
    opinion should I go for C++/MFC or with C#.NET regarding of
    1) performance and 2)capabilities meaning that I want as much access to the
    OS as possible.

    PS: What about decompiling ... I know that Java code can be decompiled
    easily is this the same case with C#.NET?
  • William DePalo [MVP VC++]

    #2
    Re: C++ or C#.NET

    "Sotiris Salloum" <Sotiris Salloum@discuss ions.microsoft. com> wrote in
    message news:17958B8A-1B4F-428C-B444-7C1497473A22@mi crosoft.com...[color=blue]
    > I'm planning to enter the shareware business and I was wondering what is
    > your
    > opinion should I go for C++/MFC or with C#.NET regarding of
    > 1) performance and[/color]

    The answer will depend on your application. There is no easy answer.
    However, if performance is the first item in the must-have feature set, then
    you can't go wrong with C++

    2)capabilities meaning that I want as much access to the OS as possible.

    ..Net provides easy access to most but not all of the Win32 API. It does have
    a "Platform/Invoke" capbility that takes care of the rest. Of course, since
    Win32 is largey a C API and what isn't is C is COM with C++ you can't go
    writing here either.
    [color=blue]
    > PS: What about decompiling ... I know that Java code can be decompiled
    > easily is this the same case with C#.NET?[/color]

    Yes.

    Regards,
    Will


    Comment

    • Lloyd Dupont

      #3
      Re: C++ or C#.NET

      > I'm planning to enter the shareware business and I was wondering what is[color=blue]
      > your
      > opinion should I go for C++/MFC or with C#.NET regarding of
      > 1) performance and[/color]
      pure (unmanaged) C++ is NOT THAT MUCH more performant than C#.
      even the worst comparison I've seen gave C++ weak advantage (best advantage
      I've seen, if I remember well should be around 20%, but in most case it's
      more like 5%).

      But productivity is much lower with MFC/C++ (compare to C#/ManagedC++/.NET).
      Also it's easy to write good looking Application with .NET. Probably due to
      better productivity hey ;-)
      For example it tooks me 3Hours to rewrite from scratch Apple's color well
      for Winodws/.NET. (with all the bells and whistles such as enabled shading,
      focus rect, click on enter, orange border on mouse over, etc...)
      [color=blue]
      > 2)capabilities meaning that I want as much access to the
      > OS as possible.[/color]
      used a mix of Managed C++ & C#.
      while you could theoritically do everything in C# (include all WinAPI), it's
      some times more practical to use ManagedC++ for that.
      [color=blue]
      >
      > PS: What about decompiling ... I know that Java code can be decompiled
      > easily is this the same case with C#.NET?[/color]
      Yep


      Comment

      • Tom Serface

        #4
        Re: C++ or C#.NET

        One good thing about C++ is that you can use it for managed or unmanaged
        code or a combination of the two to increase performance where needed. Of
        course, I'm a C++ programmer and this is a C++ forum so ...

        :o)

        Tom

        "Sotiris Salloum" <Sotiris Salloum@discuss ions.microsoft. com> wrote in
        message news:17958B8A-1B4F-428C-B444-7C1497473A22@mi crosoft.com...[color=blue]
        > I'm planning to enter the shareware business and I was wondering what is
        > your
        > opinion should I go for C++/MFC or with C#.NET regarding of
        > 1) performance and 2)capabilities meaning that I want as much access to
        > the
        > OS as possible.
        >
        > PS: What about decompiling ... I know that Java code can be decompiled
        > easily is this the same case with C#.NET?[/color]


        Comment

        • Nishant Sivakumar

          #5
          Re: C++ or C#.NET

          You might want to know that VC++ 2005 can be used to write both managed and
          native apps, and for managed apps, it can be considered to be a slightly
          better option that C# or VB. I've got an article on this that you may want
          to read :-

          A rational attempt to substantiate C++/CLI as a first class CLI language


          --
          Regards,
          Nish [VC++ MVP]


          "Sotiris Salloum" <Sotiris Salloum@discuss ions.microsoft. com> wrote in
          message news:17958B8A-1B4F-428C-B444-7C1497473A22@mi crosoft.com...[color=blue]
          > I'm planning to enter the shareware business and I was wondering what is
          > your
          > opinion should I go for C++/MFC or with C#.NET regarding of
          > 1) performance and 2)capabilities meaning that I want as much access to
          > the
          > OS as possible.
          >
          > PS: What about decompiling ... I know that Java code can be decompiled
          > easily is this the same case with C#.NET?[/color]


          Comment

          • riscy@onetel.com

            #6
            Re: C++ or C#.NET

            C# is easier to code application and much more reliable since it is
            designed to be type safe, where C++ use pointer which is not type safe,
            in other word it is programmer responsibility to track of type variable
            when pointer is applied. C# on other hand reduce that responsibility
            and take strain out of the programmer task. There are several
            alternative technique in C# that replace pointer and found be to
            effective.

            It also easier to read the code left behind for several month.

            You can bring unmanaged code (ie COM library) into manage code using
            interop service, they well document on various website...just need time
            to get use to it. (It took me 1-2 day).

            The .net framework library is written in C# by the way.

            The only negative side as far as I can see that I have not seen C# code
            being used for gaming application...p ossibly due to lower level access
            to speed or access to driver/hardware issue but I might be wrong.

            It worth adopting OOP practice as well.

            You can do both due to the eay JIT work.

            Good luck

            Riscy

            Comment

            Working...