Which platform should I use : native C++ or C#?(我应该使用哪个平台:原生 C++ 或 C#?)
问题描述
我想开发一个 Windows 应用程序.如果我使用本机 C++ 和 MFC 作为用户界面,那么应用程序将非常快速且小巧.但是使用 MFC 非常复杂.此外,如果我使用 C#,那么应用程序将比本机代码慢,并且它需要 .NET 框架才能运行.但是使用 WinForm 开发 GUI 非常容易.你更倾向哪个?
I want to develop a windows application. If I use native C++ and MFC for user interface then the application will be very fast and tiny. But using MFC is very complicated. Also If I use C# then the application will be slower than the native code and It reqiures .NET framework to run. But developing GUI is very easy by using WinForm. Which one do you prefer?
推荐答案
快"和慢"是主观的,尤其是对于今天的 PC.我并不是说故意让事情变慢,但编写托管应用程序的开销并不像您想象的那样几乎.JIT 等可以很好地使代码执行得非常快.如果您确实需要,您还可以使用 NGEN 来提高启动速度.
"fast" and "slow" are subjective, especially with today's PC's. I'm not saying deliberately make the thing slow, but there isn't nearly as much overhead in writing a managed application as you might think. The JIT etc work very well to make the code execute very fast. And you can also NGEN for extra start-up speed if you really need.
实际上,如果你有时间学习它,你可能想考虑 WPF 而不是 winform - 这是一个不同的技能组合,但可以让你很好地利用图形硬件等.
Actually, if you have time to learn it, you might want to consider WPF rather than winform - this is a different skill-set, but allows you to make very good use of graphics hardware etc.
另外 - .NET 框架附带新的操作系统安装,并且在那些早于它的操作系统中仍然很常见.所以对我来说,使用 C#/.NET 开发将是一个相当明确的选择.开发一个强大且经过全面测试 C++ 应用程序(没有泄漏等)的时间(至少对我而言)比使用 C# 的时间要长得多.
Also - .NET framework comes with new OS installs, and is still very common on those that pre-date it. So for me it would be a fairly clear choice to develop with C#/.NET. The time to develop a robust and fully tested C++ app (with no leaks, etc) is (for me at least) much greater than the same with C#.
这篇关于我应该使用哪个平台:原生 C++ 或 C#?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:我应该使用哪个平台:原生 C++ 或 C#?


基础教程推荐
- 为什么Flurl.Http DownloadFileAsync/Http客户端GetAsync需要 2022-09-30
- c# Math.Sqrt 实现 2022-01-01
- 如何在 IDE 中获取 Xamarin Studio C# 输出? 2022-01-01
- SSE 浮点算术是否可重现? 2022-01-01
- 将 Office 安装到 Windows 容器 (servercore:ltsc2019) 失败,错误代码为 17002 2022-01-01
- 将 XML 转换为通用列表 2022-01-01
- MS Visual Studio .NET 的替代品 2022-01-01
- 如何激活MC67中的红灯 2022-01-01
- 有没有办法忽略 2GB 文件上传的 maxRequestLength 限制? 2022-01-01
- rabbitmq 的 REST API 2022-01-01