by flohofwoe · 9y ago · 0 comments
UWP is in many ways worse than Win32, it requires much more boilerplate code to get stuff done, and requires a proprietary dialect of C++ which is not quite compatible with standard C++ (good luck trying to compile most existing C/C++ code on UWP, it's even worse than the Objective-C situation on OSX/iOS).
The baffling fact that UWP manages to be even more complex and less pleasant to write code for then Win32 (which was also a pretty bad API to begin with), coupled with the suicidal closing-down of an once open platform is what really concerns me about the future of Windows. That's not how you win back the hearts and minds of developers.
The main thing limiting C++ code in UWP is sandbox, not the compiler. C++/CX is a glue language between proper C++ and the rest of the OS - you can freely mix it with proper C++ (11, 14, etc) within the same binary. I successfully compiled many open source cross-platform libraries for UWP without any serious issues.
As for complexity and generally APIs, UWP is way better than old Windows APIs. It is fairly consistent, predictable, and modern. I'm guessing you are really used to the old ways, but I don't really understand how can one prefer WndProc / manual message handling or message maps to clean approach of XAML; or think it was better.
Another API and framework the good 16 year old DotNet never replaced Win32 either. All process that ship with and runs by default in Windows XP/Vista/7 or Office 2003/2007/2010 are Win32 and non is DotNet based. (you can verify with ProcessExplorer)
5 days ago MS declared DotNet a legacy thing. ASP.net 2 will only be compatible with Dotnet.core 2 (which is incompatible to DotNet and Dotnet.core 1). You can read about the outcry there https://news.ycombinator.com/item?id=14297974
The only thing that keeps people in general as well as enterprise companies on Windows is Win32 compatibility and Office. MS is now just milking their products with little QA and hostile to end users privacy "the user and his data is the product".
MS really missed the chance in 1999 to refresh Win32API with an improved Win64API. Like they did before - remember Win16API. Win16API got refactored and improved overall while keeping almost code compatibility - only a few tweaks and a re-compile were necessary back in 1994/95, and Win32s layer got backported to Win3.11. But MS went full in with their failed DotNet vision in 1999 and abdomened Win32API ever since. And never upgraded the Win32API, in fact the 64bit Windows still have the same Win32API and MS completely missed the opportunity window that was open for them. So much stupid management decision, it hurts.
C++/CX is a dialect of C++ that has refcounted pointers (like COM). It is much better than the (also proprietary) extensions for COM to C++ MSVC had decades ago, and it is also much better IMO that managed C++ and C++/CLI. Of course, in a way it is still a hack. But I read that MS is also working on a way of doing managed components in modern C++ (i.e. 11/14/17). MS is doing a lot of great work in the area of modern C++ lately (surprisingly to me).
And UWP is yet another incompatible version of XAML/WPF/Silverlight/.... I don't like the castrated nature of it, it is incredible simple things are hard or impossible (like cross process drag and drop, which is not supported even in MS Office store apps. Or any kind of IPC, or networking with localhost). But things are getting better, as MS removes the worst pain points and developers learn to circumvent the missing parts.
One thing that seems great in UWP is it's async-first approach. I learned to appreciate that paradigm with Python/Twisted and JS.
So it's not all bad. If Microsoft had UWP 10 or 15 years ago (in their "Avalon" phase) it would have been great. Now, it's just "meh".
Depends on the language. In C# it’s straightforward. In C++ yes it could be cumbersome. But that’s a language limitation, C++ lacks async-await so some boilerplate code is required to consume asynchronous APIs.
> good luck trying to compile most existing C/C++ code on UWP
Did that more than once. The largest problem is slightly different CRT, i.e. not all CRT functions are available.
For the language however, C++/CX is merely a syntactic sugar on top of regular C++ compiler that compile your stuff into native code. You can enable/disable “Consume Windows Runtime Extensions (/ZW)” for individual C++ source files inside a single project. The linker will happily link everything together.
Also, if you don’t like C++/CX you don’t even required to use it. You can compile your C/C++ code into a UWP DLL that’s not windows runtime components, but expose C-style API instead. You’ll be able to use that in UWP apps just fine.
C/C++ is good for people who have existing C++ codebases or skills, which they want to bring into the UWP world.
C#/F# for new app development.
JavaScript to bring in electron/web guys on board.