3

I heard here a lot that MFC is outdated, and wraps Win32 in bad OOP.

But Microsoft released MFC 10 with VS2010, and it has latest tools like ribbon interface, so should one use it for simple apps?

yolo
  • 2,757
  • 6
  • 36
  • 65
  • This question has been asked several times before, and was best answered here: http://stackoverflow.com/questions/121184/is-there-still-a-case-for-mfc – Aidan Ryan Sep 07 '11 at 12:46
  • If you have plans of porting to multi-platform environments (Apple, Linux, Unix, etc.), do not even begin the first line of code! I recommend to use QT or Mono instead! – sergiol May 06 '16 at 14:03

3 Answers3

2

MFC is widely considered to be poorly designed but it has been updated recently and appears to be alive and well. You may decide not to use it for other reasons, but you should not reject it for being outdated.

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
  • 7
    Given the constraints of the C++ language and, in particular, Microsoft C++, at the time, I think the MFC team did a remarkably good job. If Microsoft were to do it all again now, would they come up with MFC? Probably not. But it's not poorly designed, *given the context*. – Roger Lipscombe Sep 07 '11 at 12:34
  • @roger that's a fair point indeed – David Heffernan Sep 07 '11 at 12:36
2

MFC doesn't look bad if you understand it. Otherwise you consider it as poorly designed.

MFC is not outdated: a lot of complex applications use MFC, for example MS Office. And you even can find in samples how to make office-look application.

Also for simple apps you can use ATL.

Sergey Podobry
  • 7,101
  • 1
  • 41
  • 51
  • What, exactly, do you think MS Office uses MFC for? While Raymond Chen [wouldn't go on record in 2007 regarding this](http://blogs.msdn.com/b/oldnewthing/archive/2007/01/15/1471731.aspx), I can *assure* you they don't use it. – HostileFork says dont trust SE Nov 20 '12 at 12:10
  • Maybe you are right. But there is an SDK sample that looks exactly as a typical ms office application: c:\Program Files (x86)\Microsoft Visual Studio 10.0\Samples\1033\VC2010Samples.zip\C++\MFC\Visual C++ 2008 Feature Pack\MSOffice2007Demo – Sergey Podobry Nov 21 '12 at 14:41
1

I have seen MFC applications are noticeably faster, particularly they load faster compared to C#. The compelling arguments I have heard from C# guys are it is very fast to development in compared to MFC. In terms of performance MFC wins hands down.

You can make a call on what kind of application you are developing and what features do you need. The trend unfortunately is moving away from MFC though I personally can't justify it. I know couple of companies who are planning to migrate MFC applications to .NET My friends there old me mainly it's the faster development time and it is easy to develop in.

If you are bold you can still start new application with MFC and do better than those who would with C#. If you just want to go with trend than use new easier tools and take a little hit with performance.

Overall I would definitely not sideline MFC as it might be the only fit for certain high performance applications. For example I love the GUI threads in MFC which don't exist in C++ but are very powerful if used properly. I don't know if they exist in C# or newer languages but I wouldn't like to give up on them.

zar
  • 11,361
  • 14
  • 96
  • 178
  • Nowdays, after having used C# extensively and MFC a bit, I would recommend using a C# .NET base application and calling to external DLLs for performance. – afarley Sep 04 '19 at 23:03