(e-mail address removed)>,
(e-mail address removed) says...
On Apr 17, 5:00 am, "Alf P. Steinbach" <
[email protected]> wrote:
[ ... ]
Are you referring Microsoft is not following C++ Design Pattern
rules?
No, what he's referring to is the fact that it has "Microsoft" in the
name, and therefore is widely viewed as am embodiment of evil.
In reality, MFC does use a general design that's generally considered
outdated in C++ circles (most of the classes belong to a single,
large hierarchy). It has a number of other shortcomings as well, such
as including more implicit conversions than some people prefer.
Nonetheless, the "~all possible wrong ways to do things" is an
serious exaggeration.
What is the reason why MFC should be avoided? I have heard
that MFC does not improve performance.
Almost no framework improves performance -- they generally make
development easier at some cost in performance. In the case of MFC,
the reduction in performance is pretty small (smaller than with most
alternatives).
Exactly how much it eases development is open to some argument (and
has been argued, incessantly, for almost two decades now. The system
as a whole (MFC in conjunction with Visual Studio) clearly improves
productivity compared to programing for the raw API. The question is
how much of that is really due to MFC, and how much to the other
"stuff" they provide that they don't provide for the raw API. From a
practical viewpoint, that doesn't matter a whole lot: you're
comparing what IS available against what people imagine could be made
available if somebody (e.g., Microsoft) wanted to. Regardless of
whether MFC is a major contributor here or not, if you want to use
those, you're pretty much stuck with MFC.
At least if you use Microsoft's development tools, you're also stuck
with the fact that while they provide alternatives (WinForms, WPF,
..NET in general), they take pretty much the same situation even
further: even worse-designed frameworks, only rendered marginally
usable by *lots* more support in the environment.
If you decide to use other tools, you have a few choices: wxWidgets
was originally designed as essentially a clone of MFC, and that's
pretty much still the case. It includes pretty much all the same
problems as MFC, but without the wizards and such that let you ignore
most of the cruftiness in MFC. There are a few IDEs oriented toward
wxWidgets, but at least when I've tried them, they've been rather a
mixed bag. None I've found really competes with VS/MFC.
Qt is a rather nicer design, but unless the software you develop is
free, open source, the price is *quite* steep. At least in my
experience, its advantages are also mostly theoretical -- using it is
more enjoyable, but not really any faster. Qt does *much* better than
most portable frameworks at following the native look and feel in
each platform -- but it's still well short of perfect. There's still
a *bit* of an awkward, foreign feel compared to an MFC application.
There are quite a few others, but you get the general idea. There are
always at least a few qualifications associated with any "better"
framework; it's better for some purposes, but not as good for others.
If you want to use WIN32
programming, WIN32 API functions are recommended instead of using MFC.
Recommended by whom and for what?