什么是编写C#/ XAML主场迎战Windows8的C ++ / XAML的WinRT应用的利弊? [英] What are the pros and cons of writing C#/XAML vs. C++/XAML WinRT applications in Windows8?

查看:162
本文介绍了什么是编写C#/ XAML主场迎战Windows8的C ++ / XAML的WinRT应用的利弊?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想下去移植一个WPF / Silverlight的组件到Windows 8.有点背景的路线,该组件是一个的实时WPF图,它使用WPF / XAML和位图呈现的混合物,以实现高性能。

I'd like to go down the route of porting a WPF/Silverlight component to Windows 8. For a bit of context, the component is a real-time WPF Chart, which uses a mixture of WPF/XAML and bitmap rendering to achieve high performance.

我想该组件是地铁兼容,例如在Metro模式以及桌面模式下使用。我读了很多关于创建 C ++ / WinRT的在Windows 8以及 C#/ XAML <应用/ A>应用程序,但什么是两个框架之间的差异?

I'd like the component to be Metro compatible, e.g. used in metro mode as well as desktop mode. I read a lot about creating C++/WinRT applications in Windows 8 as well as C#/XAML applications, but what are the differences between the two frameworks?

有没有限制,如果你选择了C ++ / XAML C#/ XAML?还可以考虑从C#/ XAML中移植在.NET4.0到Windows8中会容易得多,如果我能坚持到C#/ XAML,但我将能够创造利用这种方法一个全功能的地铁组成部分?

Are there limitations if you choose C#/XAML over C++/XAML? Also consider the porting from C#/Xaml in .NET4.0 to Windows8 would be far easier if I could stick to C#/XAML, however will I be able to create a fully featured Metro component using this method?

您的意见/建议表示赞赏。

Your comments/suggestions appreciated.

编辑:

如果你投票关闭此线程,请发表评论为什么。它是一种有效的问题,有+6票,四个答案和一个喜爱。似乎是合理的随时给我!

If you're voting to close this thread, please post a comment why. Its a valid question, has +6 votes, four answers and one favourite. Seems reasonable to keep it to me!

推荐答案

我看到了差距作为设计选择,不是语言的个人喜好。偏好会更关系到VB VS C#。而且一般是你,你选择C ++或.NET相同差异的任何应用程序。

I see the difference as a design choice, than a personal preference of language. Preference would be more related to VB vs C#. And generally it's the same differences you get in any application where you choose C++ or .NET.

C ++会给你更快的启动时间。 IIRC,.NET 4.5具有自动NGENing能力(不知道它如何与地铁的应用程序),所以这可能有助于减轻.NET应用程序典型的慢速启动时间。

C++ will give you faster startup times. IIRC, .NET 4.5 has auto NGENing abilities (not sure how it related to metro apps), so this may help mitigate typical slow startup times of .NET applications.

C ++会给你较低的总体内存使用情况,因为它不使用垃圾收集器。这将成为越来越多地在资源受限的设备更重要的片等。 IIRC,.NET 4.5有更多的缓解为GC暂停(这可能会导致用户界面studder),他们仍然使用托管代码变成现实。

C++ will give you lower general memory usage as it does not use a garbage collector. This becomes increasingly more important on resource constrained devices such as tablets. IIRC, .NET 4.5 has more mitigations into GC pauses (which can cause the UI to studder), they are still a reality with managed code.

由于.NET和C ++使用相同的WinRT的框架,有可能不会有太大的区别与XAML / WinRT的平台交互(技术上更快地通过C WinRT的对象交互++但命中真的很小),但当然你的用户代码一般会更快与C ++ .NET比。

Since .NET and C++ use the same WinRT framework, there probably won't be too much difference in interacting with the XAML/WinRT platform (technically faster interacting with WinRT objects via C++ but the hit is really small), but of course your user code will generally be faster with C++ than .NET.

的C ++通常更难以逆向工程,即使与混淆.NET代码相比较。虽然狡猾的窃贼可以窃取您的IP不管。

C++ is generally more difficult to reverse engineer, even when compared with obfuscated .NET code. Though sly thieves can steal your IP regardless.

由于.NET首次创建为开发人员和开发人员的生产力的方便,你将不得不在架构您的应用程序更多的便利选择(例如,基于反射的工具,如DI / IOC)。

Since .NET was created first for the convenience of the developer and developer productivity, you will have more convenience options in architecting your applications (eg, reflection based tools such as DI/IoC).

迭代应用程序代码可能会通过.NET更容易为.NET编译比C ++更快,但正确创建C ++项目这可以大大缓解。

Iterating application code may be easier via .NET as .NET compiles quicker than C++, but correctly created C++ projects this can be mitigated substantially.

纯.NET项目可以支持任何CPU,这意味着你的应用程序可以在所有支持WinRT的平台上运行。 C ++你将​​只需重新编译项目,以支持ARM,X86 / 64。如果.NET应用程序依赖于一个定制的C ++组件,你将不得不编译每个架构。

Pure .NET projects can support "Any CPU", which means your application can run on all supported WinRT platforms. C++ projects you will simply have to recompile to support ARM, x86/64. If you .NET application depends on a custom C++ component, you will have to compile for each architecture.

由于WinRT的是从地面建立起来,以支持多国语言,我建议到舒适的arent用C ++开发者是坚持使用.NET但探索从C受益的领域++。微软做的/ CX预测和大多数C#开发者一个伟大的工作,应该能够找到周围的路。我对C ++开发者的建议是坚持使用C ++和获得C ++的所有好处。

Because WinRT was created from the ground up to support many languages, my suggestion to devs that arent comfortable with C++ is to stick with .NET but explore areas that benefit from C++. Microsoft has done a great job with the /CX projections and most C# devs should be able to find their way around. My suggestion to C++ devs is to stick with C++ and get all the benefits of C++.

这篇关于什么是编写C#/ XAML主场迎战Windows8的C ++ / XAML的WinRT应用的利弊?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆