Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • December 08, 2016, 03:56:09 AM
  • Proudly celebrating 10 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: C++ Development: win32 or .NET?  (Read 9196 times)

cnewtonne

  • Honorary Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 117
    • View Profile
    • Donate to Member
C++ Development: win32 or .NET?
« on: August 06, 2007, 12:03:22 PM »
As you probably can tell from this question that the I'm beginning to delve into the world of desktop development. Having spent the last 3 months getting up to speed on C++ and VS IDE, I'm at a fork road now trying to decide which way to go, C++ with native win32 or .net.

Can the gurus on this site validate my understanding of this subject and provide their insights please ...

There are 3 ways to develop windows GUI apps with C++:
  • by calling win32 API directly 
  • using MFC
  • using .NET 

My understanding is ...

1- Using direct API calls is obsolete and is not being done nowadays.

2- Most of the existing apps are probably developed using MFC. However, this technology is gradually and officially phased out in favor of .net

3- For a starter like myself and when developing apps from scratch, is there any reason why I should NOT abandon win32 MFC projects. In other words, what does win32 offer that .net does not?

4- If I do go for C++ .net, my next dilemma is why? C++ is not, by design, optimized for the .net. I should as well just go to C#. Can anyone think of any reason why I should look back to C++ to develop my app in respect to using C# directly.

5- Almost all books I read stated that apps written in C++ .net vs. win32 compare (if not faster) response-wise and are more stable. There are, however, a very limited number of apps on the high end of industrial performance that will always benefit from win32. Is is true if my scope is simply DK development, I should NOT be concerned about any stability or performance issue developing in .net?

6- Finally, can you by looking at an app on your DK tell if it was developed via win32 vs. .net? And how? For example, are there controls that can only be used via one and not the other?


Thank you all

« Last Edit: August 06, 2007, 12:50:16 PM by cnewtonne »

Gothi[c]

  • DC Server Admin
  • Charter Honorary Member
  • Joined in 2006
  • ***
  • Posts: 858
    • View Profile
    • linkerror
    • Donate to Member
Re: C++ Development: win32 or .NET?
« Reply #1 on: August 06, 2007, 01:14:42 PM »
Use wxWidgets. Not only is it a very nice and complete API to work with, it will also allow your programs to be compiled on different platforms other than windows.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 36,412
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: C++ Development: win32 or .NET?
« Reply #2 on: August 06, 2007, 01:15:47 PM »
what is DK?

if you are going to do .net from scratch, i'd say go for c#.
the only time i'd recommend c++ .net stuff is for legacy code.


cnewtonne

  • Honorary Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 117
    • View Profile
    • Donate to Member
Re: C++ Development: win32 or .NET?
« Reply #3 on: August 06, 2007, 01:28:16 PM »
what is DK?

Sorry ...
Desktop...

Mouser,
- what about c++ win32 vs. C# .net?
- How is FARR developed? Is it a win32 project? What IDE did you use?
« Last Edit: August 06, 2007, 01:30:00 PM by cnewtonne »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 36,412
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: C++ Development: win32 or .NET?
« Reply #4 on: August 06, 2007, 02:24:00 PM »
FARR is built using Borland's C++ Builder, which is basically c++ and an added layer of visual components for windows gui stuff, and a nice IDE.  It's a commercial product but you can use the new version (Turbo C++) for free if you don't need to install 3rd party components.  Its 100x nicer to do gui programs using c++ builder vs. mfc or native win32 api, in my opinion.

I'm a long time c++ coder (20 years), and it's hard to break old habits, but c++ is showing it's age these days -- and i never recommend it to new programmers.  you'll have a happier experience and learn better coding technique using a more modern language like C# or Java.

In general though you have to ask yourself what you want to code?  Do you want to do cross-platform stuff? then you can forget c++ builder. and win32 stuff.  wxwidgets could work if you still were dead set on c++.  If you just want to get a little experience coding and learn basic techniques, and windows is your main operating system, then go for c#.

Renegade

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 13,220
  • Tell me something you don't know...
    • View Profile
    • Renegade Minds
    • Donate to Member
Re: C++ Development: win32 or .NET?
« Reply #5 on: August 06, 2007, 05:13:08 PM »
C# (or VB.NET) are really fast to develop in.

The way I see it, development is less and less about making great code from scratch, and more and more about assembling the best components to do that work for you as you design an application to solve a problem and make people's lives easier.

It's rare that you would need very low level languages like assembler to get a job done. Most likely you can just use an existing component that's been around and is proven. So there's no need (usually) to write all that stuff yourself.

The obvious answer then is to go for productivity and speed. .NET fits the bill there.

Also, programming languages are becoming much larger and what there is to know is growing all the time. A single developer can't keep up with everything, so going with those tools that make life easier is a more natural progression. C/C++ are more difficult. They have a place, but that space will shrink over time.
Slow Down Music - Where I commit thought crimes...

Freedom is the right to be wrong, not the right to do wrong. - John Diefenbaker

Lashiec

  • Member
  • Joined in 2006
  • **
  • Posts: 2,374
    • View Profile
    • Donate to Member
Re: C++ Development: win32 or .NET?
« Reply #6 on: August 06, 2007, 06:15:06 PM »
There's also the WTL or Qt as well. The second one is multiplatform, OSS and widely regarded. I suppose .NET will have its space with time, but it has to compete with Java as with all those other "new" languages appearing as lately, and, of course, all the "Web 2.0" craze, which allows you to code a driver using HTML and JavaScript or something... ;D. Also, .NET will only be as good as the people developing for it, and so far I've only see VB6-like software, at least in what comes to user software. And you'll need a helluva lot of memory as well, in theory.

mwb1100

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,522
    • View Profile
    • Donate to Member
Re: C++ Development: win32 or .NET?
« Reply #7 on: August 06, 2007, 10:49:07 PM »
As Mouser said, if you're programming against .NET then go with C#.  Also, if you're doing this for personal enjoyment, then I'd suggest also going the C#/.NET route.

If you're looking for something that'll provide an income, then I'd suggest learning both C++ and C#, probably with a leaning toward C++.  I think that in most markets you'd do well to be conversant in both.  If you're looking for a web-based career direction, then I might switch that to learning both C# and Java.  As languages C# and Java are quite similar, what you'd be mostly learning is the frameworks they work in.

f0dder

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,029
  • [Well, THAT escalated quickly!]
    • View Profile
    • f0dder's place
    • Read more about this member.
    • Donate to Member
Re: C++ Development: win32 or .NET?
« Reply #8 on: August 07, 2007, 05:34:44 AM »
If you're going to use C++, do direct Win32 API calls masochist-style, or use some crossplatform framework/toolkit. MFC is imho out of the question, you're better off with dotNET and C# - I wouldn't do C++ dotNET.

ATL/WTL, ho humm. Sorta similar to MFC but with less bloat, but it still means learning a framework/tookit and being locked to windows development.

Personally I do C++/Win32, since that's what I grew up with, and as mouser said: it's hard to break old habits. I haven't found a GUI toolkit that I really like, and dotNET/BCB/Delphi/etc. are too bloated for my liking.
- carpe noctem

cnewtonne

  • Honorary Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 117
    • View Profile
    • Donate to Member
Re: C++ Development: win32 or .NET?
« Reply #9 on: August 07, 2007, 08:39:08 AM »
Thank you all gurus. Your insightful remarks are priceless since I can never find them in books. What I read in books and on web site is all one dimensional and lacks the real-life perspective.

My interest has been to develop DK apps for commercial reasons. I also have a particular interest in developing for the Palm OS on a small scale. I wanted to learn a language were I can leverage both interests. To this purpose, C++ was the way to go. I assume learning C# to start with should help a lot learning C++ as well. At least for the DK, I can now rule out mfc and native api in favor of .net.

I will be doing some research this week on the Palm OS side at PDN. I have already installed Turbo C# and will be playing with it throughout this week.


Thank you all.

f0dder

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,029
  • [Well, THAT escalated quickly!]
    • View Profile
    • f0dder's place
    • Read more about this member.
    • Donate to Member
Re: C++ Development: win32 or .NET?
« Reply #10 on: August 07, 2007, 08:48:34 AM »
At least for the DK, I can now rule out mfc and native api in favor of .net.
Unless, of course, you want to target low-end machines - dotNET is still somewhat heavy: initial startup-time of the dotNET runtimes after system boot is *slow* even on high-end systems, and the memory impact of dotNET apps is large too. Once started, it runs pretty well though (for normal desktop stuff anyway).

I will be doing some research this week on the Palm OS side at PDN. I have already installed Turbo C# and will be playing with it throughout this week.
Might also want to get Microsoft's own environment, since the Express editions of Visual Studio are free (and afaik they're not crippled crap, but pretty full-featured apart from some of the heavy-end enterprise stuff you probably won't be needing anyway).
- carpe noctem

jah

  • Honorary Member
  • Joined in 2007
  • **
  • Posts: 15
  • i->c();
    • View Profile
    • Donate to Member
Re: C++ Development: win32 or .NET?
« Reply #11 on: August 09, 2007, 07:54:41 AM »
C++ & Win32 API!
FTW!

Edit: Heres a good reference: http://www.winprog.org/tutorial/

wasker

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 52
    • View Profile
    • Donate to Member
Re: C++ Development: win32 or .NET?
« Reply #12 on: August 09, 2007, 06:55:10 PM »
C++ and .NET -- I'd better stay out of this combination. The code in C++.NET is sorta clunky. If you plan to develop for .NET, then C# is what you want to use.
For Win32 C++/MFC is very good.

Eóin

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 1,401
    • View Profile
    • Donate to Member
Re: C++ Development: win32 or .NET?
« Reply #13 on: August 09, 2007, 07:09:00 PM »
I'd say WTL is the way to go if you want clean C++ coding under windows. It's not perfect, not by a long shot, but it's the best attempt I'd dare say.

cnewtonne

  • Honorary Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 117
    • View Profile
    • Donate to Member
Re: C++ Development: win32 or .NET?
« Reply #14 on: August 09, 2007, 11:40:08 PM »
I'm now studying Turbo C++. I like it so far. My concern with C# .net stuff is performance. I saw an example of that on an application called DirectAccess which is developed using C# .net. Users were complaining about slow startup time which I know this breed of apps are known for. I also played with the well known KeyPass open source app which is again using same technology. Not as much, but few users are reporting slow startup times. I will further look into this app as well. I will report later with my findings.