C# or MFC?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi, there
I am building a case that will decide if our new project will be using MFC or C#. MFC is a mature technology, and is used extensively in most of the major applications. C# is new, and I am not sure if it has all the features that MFC supports. I was wondering if you guru can shed some light on this by pointing me to some good articles comparing MFC and C#. Or if any well known cases of C# usage
Thanks very much for your help

Michael
 
Hi,

Before using one of them, consider also using Java.
C# and java are very similar, but java runs on most of platforms.

I'm sure that some guys won't like my suggestion, but I have done same way
as you consider.
Mfc -> c# - > java (finally I'll use java).

Michael said:
Hi, there,
I am building a case that will decide if our new project will be using
MFC or C#. MFC is a mature technology, and is used extensively in most of
the major applications. C# is new, and I am not sure if it has all the
features that MFC supports. I was wondering if you guru can shed some light
on this by pointing me to some good articles comparing MFC and C#. Or if any
well known cases of C# usage.
 
Before using one of them, consider also using Java.
C# and java are very similar, but java runs on most of platforms.

But if i only plan to use the application on the windows platform it will be
at bad bad choice. Using swing you will gain _nothing_ compared to
MFC/winforms. If you consider using it on other platforms java would be a
good choice. But sonce he considers MFC i dont think this is the case.
I'm sure that some guys won't like my suggestion, but I have done same way
as you consider.
Mfc -> c# - > java (finally I'll use java).

Soudsn like you always use Java. Isnt a little narrow only to consider one
launguage / platform when developing softeaer.

Regards
Anders
 
only plan to use the application
Today windows, tomrrow never knows - may better to leave door open for this
and java the way to go.
Soudsn like you always use Java
No. First I started mfc 6.0 (used 2.5 years), then converted all stuff to c#
(all current applications work in .NET at moment),
few month ago (in January) started with java (poritng all applications to
java).
Using swing you will gain _nothing_ compared to
MFC/winforms.
What you mean by this ? You can make exactly same UI as with windows forms.
Only little swing problem is that it's little slower.
See: http://www.lumisoft.ee/stuff/untitled-2.gif , this UI is same as with
windowsforms.
(I have ported all controls(tab,grid, ...) to java, they look just same as
with windows forms)
Isnt a little narrow only to consider one
launguage / platform when developing softeaer.
Maybe, but probably you know that supporting multiple launguage / platform
is very expensive, because of it you need to choose only one what does all.
 
Ivar said:
Today windows, tomrrow never knows - may better to leave door open for this
and java the way to go.

1. There are .net implementations for other platforms
2. Sometimes portability simply doesn't matter
...
What you mean by this ? You can make exactly same UI as with windows
forms.

Java is portable because it doesn't offer all the features that are
available on a Win32 platform - Or could you show me a semi-transparent
window in Java? Are your java apps usable by disabled people
(accessibility)? Can they use multiple monitors? Do they have taskbar icons?
Can they use the OLE clipboard?
At least on the client side, there are dozens of good reasons to stick to
MFC or C# - if portability doesn't matter.
...
Maybe, but probably you know that supporting multiple launguage / platform
is very expensive, because of it you need to choose only one what does
all.

Using the best language for the current task is usually the cheapest
solution.
Or are your database queries written in Java, too???

Niki
 
Hi Michael,

First of all MFC is a class library, C# is a language. I assume you are
considering MFC vs Windows Forms (WF)
The first version of WF implements only a subset of whats available in MFC.
MFC has been around a great number of years, so it is not surprising that
Microsoft hasn't managed to get all the functionality into WF in the few
years it has existed.

All the basic stuff is available in WF, the more advances stuff is still
only available in MFC if you limit yourself to Microsoft code only.
There exists a great number of companies that sell .NET controls that gives
you the functionality that is currently available in MFC.
These controls typically cost a couple of hundred dollars, a lot of them
also come with sourcecode.

Depending on the length of your development process, Visual Studio 2005
includes some controls that give you more advanced features. This should be
out in about a years time.

If I had to make your choice, I would choose C# and WF for the following
reasons.
1. GARBAGE COLLECTION!!!!, no more need to hunt down those horrible memory
leaks.
2. C# is a far more elegant language than C++.
3. There is a great number of classes available for non-ui operations. XML,
ADO.NET, WebServices etc.
4. How many types of string types is there in C++/MFC? In .NET there is only
one.
5. Added support for localization, new language versions can be created by
external people without needing access to source code.
6. Everything Microsoft is doing is aimed towards .NET. MFC will not be
discontinued in the near future, but all the new fancy stuff from MS will
only be available in .NET.

Hope this gave you some answers.

Chris


Michael said:
Hi, there,
I am building a case that will decide if our new project will be using
MFC or C#. MFC is a mature technology, and is used extensively in most of
the major applications. C# is new, and I am not sure if it has all the
features that MFC supports. I was wondering if you guru can shed some light
on this by pointing me to some good articles comparing MFC and C#. Or if any
well known cases of C# usage.
 
Flare said:
But if i only plan to use the application on the windows platform it will be
at bad bad choice. Using swing you will gain _nothing_ compared to
MFC/winforms.

Well, except a more MVC-like approach, arguably. Of course, there are
alternatives to Swing as well - such as SWT.
Soudsn like you always use Java. Isnt a little narrow only to consider one
launguage / platform when developing softeaer.

So why discourage the OP from considering Java?
 
Thanks for all the replies. Chris is right on what my intension was.
We have an old application written for Windows 3.11. All UI is written in C and most of the code is written in C and some new C++ dialogs and dlls. What we are planning to do is to move UI from C to either MFC or WinForm using C#. I need to gather enough information to make the design decision. The information I am look for is
(1)Performance comparison between C++ and C#
(2)Feature comparison between MFC and WinForm
(3)Has C# been used successfully in major brand name product
(4)How easy is it to use functions that were written in C or C++ in C#
(5)How easy or if is it possible at all to use dialog box that was written in C++?
(6)Reliability comparison between C++ and C#

We will not consider Java for performance reasons. Since high performanace and reliability are the keys to our success, this is something that I worried most in C#

Thanks all for your help

Michael
 
Michael said:
...
(1)Performance comparison between C++ and C#.
My mesurements showed that C# is quite comparable, sometimes even a little
faster, at least with the 1.1 version of the framework. But of course this
depends on what you are doing exactly, and of course you can do the
time-critical parts (the 10% of the code that take 90% of the time) in good
old optimized C++.
(2)Feature comparison between MFC and WinForm.
As Chris said, MFC does have more features, but this is hardly comparable:
Is it better to have some ugly set of precompiler-macros (MFC) that can do a
job that can be done with just a few lines in C#? (thanks to garbage
colection, events, reflection, custom attributes...)
If your application is big, the advantages you get in software design can
save you more time than some command-maps ever will.
On the other hand, the .net framework offers lots of (non-ui) things MFC
doesn't.
(3)Has C# been used successfully in major brand name product?
Parts of visual studio are build using .net.
(4)How easy is it to use functions that were written in C or C++ in C#?
C# can import C DLL functions and use COM objects. Also, the managed C++
compiler will produce managed code that is directly callable from C#.
(5)How easy or if is it possible at all to use dialog box that was written
in C++?
WinForms are HWND's too - of course they can interact with "plain" windows
or ActiveX controls.
(6)Reliability comparison between C++ and C#?
I'm not sure what that means: You can create bugs in both languages :-)

Niki
 
Michael said:
We will not consider Java for performance reasons.

Really? Eclipse seems to manage pretty well for performance. Have you
actually looked at Java closely (including toolkits other than Swing)
and discovered it to be lacking, or are you going on hearsay?
 
Back
Top