为什么 WPF 不像 WinForms 那样支持 C++.NET?
作为一个坚持 C++ 的人,这确实困扰着我。 我一直很喜欢微软大约十年前提出的“独立于语言的框架”的想法。 为什么他们放弃了这个想法? 有谁知道其背后的原因?
As a C++ stickler, this has really been bugging me. I've always liked the idea of the "language-independant framework" that Microsoft came up with roughly a decade ago. Why have they dropped the ball on this idea? Does anyone know the reasoning behind it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
部分原因是 C++ 支持实际上是两种语言合而为一——本机语言和 CLI 变体; Visual C++ 团队承认额外的开发负担是正确的 MSBuild 集成落后于其他语言的原因(滞后?我在 2008 年或以后没有检查过)。
另一部分将涉及编译期间的代码生成,该代码生成在 C# 构建中进行,以支持例如绑定“魔法”; 我发现即使在 F# 中,你也不会“突然发生”。
Part of the reason will be that C++ support is actually two languages in one -- the native and the CLI variants; that extra development load has been acknowledged by the Visual C++ team as the reason that proper MSBuild integration lagged (lags? I haven't checked in 2008 or later) behind other languages.
Another part will be to do with the code generation during compilation that goes on in a C# build to support e.g. the binding "magic"; I've found that even in F#, you don't get it "just happening".
如果是我,我的理由是 C++.Net 不应该用来编写 GUI。
我并不是想在这里尖酸刻薄,也许有人可以告诉我我的方法的错误,但我认为这不是一个好主意。 我现在正在摆弄一个,开发速度比用 C# 编写应用程序要慢得多。 我的感觉是,如果应用程序需要 C++.Net 或仅常规 C++ 中的功能,那么似乎更好的想法是创建一个 DLL 来完成繁重的工作并可以与 C# 交互。
If it were me my reasoning would be that C++.Net should not be used to write GUIs.
I'm not trying to be snarky here, maybe someone can show me the error of my ways but I don't think it's a good idea. I'm messing around with one right now and development much much slower than if the application had been written in C#. My feeling is if features in C++.Net or just regular C++ are required for the application it seems like a better idea would be to create a DLL to do the heavy lifting and could interface with C#.
这也让我烦恼,如果他们支持它,我们就能够将 C++ 代码迁移到新的 GUI,比基本上用 C# 重写所有内容更容易、更便宜。 我们花了一大笔钱来重新设计我们的应用程序,这正是我们在经济衰退时期想要的。
我想原因是 C# 很流行(不像 C++ 那样跨平台),所以他们决定将开发工作保持在最低限度。
It bugs me too, if they had supported it, we'd be able to migrate our C++ code to a new GUI much easier and cheaper than basically rewriting everything in C#. Its costing us a fortune to rework our apps, just what we wanted in a recession.
I imagine the reasoning is that C# is popular (and not as cross platform as C++) so they've decided to keep their development efforts to the minimum required.
您可以使用托管 C++ 来执行 WPF。
原因是现在几乎所有新的应用程序编程都是用 JavaScript、Java、VB.NET 或 C#(所有 GC 语言)完成的。 重点是为较低的技能组合提供更高的质量,而 C++ 对开发人员的要求太多,公司希望人们在第一天就编写日志错误代码。
用于应用程序的C++主要用于维护现有应用程序或需要极限性能的地方。 设备驱动程序和操作系统仍然经常用 C++ 编写,但即便如此,情况也在发生变化(Coyotos 是 Cbit,E#,Cosmos/Mosa 是 C#,Singularity/Midori)。
You can do WPF with managed C++.
The reason is that nearly all new application programming is now done in JavaScript, Java, VB.NET or C# - all GC languages. The emphasis is on higher quality for a lower skill set and C++ demands too much from the developer, companies want people to write log bug code on their first day.
C++ for applications is mainly for maintenance of existing applications or where extreme performance is needed. Device drivers and OS are still frequently written in C++ but even that is changing (Coyotos is Cbit , E# , Cosmos/Mosa are C#, Singularity/Midori).