推荐使用MFC吗?
我在这里听到很多人说 MFC 已经过时了,并且将 Win32 包装在糟糕的 OOP 中。
但是微软在VS2010中发布了MFC 10,并且它有像ribbon界面这样的最新工具,所以应该将它用于简单的应用程序吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
MFC 被广泛认为设计不佳,但它最近进行了更新,并且看起来运行良好。您可能会因为其他原因决定不使用它,但您不应该因为它过时而拒绝它。
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.
如果你理解MFC的话,看起来还不错。否则你会认为它设计得很糟糕。
MFC 并没有过时:很多复杂的应用程序都使用 MFC,例如 MS Office。您甚至可以在示例中找到如何制作办公室外观的应用程序。
对于简单的应用程序,您也可以使用 ATL。
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.
我发现 MFC 应用程序明显更快,特别是与 C# 相比,它们的加载速度更快。我从 C# 人员那里听到的令人信服的论点是,与 MFC 相比,它的开发速度非常快。就性能而言,MFC 毫无疑问胜出。
您可以拨打电话询问您正在开发什么类型的应用程序以及您需要什么功能。不幸的是,这种趋势正在逐渐远离 MFC,尽管我个人无法证明这一点是合理的。我知道有几家公司正计划将 MFC 应用程序迁移到 .NET。我的朋友们都老了,主要是开发时间更快,而且很容易开发。
如果你有胆量,你仍然可以用 MFC 启动新应用程序,并且做得比那些愿意使用 C# 的人。如果您只是想追随潮流,而不是使用新的更简单的工具并在性能上受到一点影响。
总的来说,我绝对不会放弃 MFC,因为它可能是唯一适合某些高性能应用程序的方法。例如,我喜欢 MFC 中的 GUI 线程,它在 C++ 中不存在,但如果使用得当,它会非常强大。我不知道它们是否存在于 C# 或更新的语言中,但我不想放弃它们。
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.