{"id":169,"date":"2017-05-10T18:16:20","date_gmt":"2017-05-10T18:16:20","guid":{"rendered":"http:\/\/securitycurve.com\/?p=169"},"modified":"2017-05-10T18:16:20","modified_gmt":"2017-05-10T18:16:20","slug":"kill-win32-who-are-you-kidding","status":"publish","type":"post","link":"https:\/\/securitycurve.com\/?p=169","title":{"rendered":"Kill Win32?  Who are you kidding?"},"content":{"rendered":"<p><a href=\"https:\/\/securitycurve.com\/wp-content\/uploads\/2017\/05\/images.jpeg\"><img decoding=\"async\" class=\"alignright size-full wp-image-172 lazyload\" data-src=\"https:\/\/securitycurve.com\/wp-content\/uploads\/2017\/05\/images.jpeg\" alt=\"\" width=\"225\" height=\"225\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 225px; --smush-placeholder-aspect-ratio: 225\/225;\" \/><\/a>I saw an <a href=\"http:\/\/www.zdnet.com\/article\/why-windows-must-die-for-the-third-time\/\">article today about some of the changes being discussed by Microsoft<\/a> in regards to future Windows application development and their plans for Windows over the long term. \u00a0It&#8217;s an interesting \u00a0article &#8212; mostly focusing on the history of the Win32 API, what the future of that might be under <a href=\"https:\/\/www.theverge.com\/2017\/5\/2\/15506378\/microsoft-windows-10-s-os-operating-system-announced-features\">Windows 10 S<\/a>, and speculating about some of the reasons why it is that there are still so many Win32 apps lo these many years later. \u00a0I do suggest you read it since it really does a great job I think about explaining why that matters in general, the significance of the announcement made by MSFT last week, and the general context surrounding the discussion in the first place.<\/p>\n<p>The tl;dr version though is that Windows 10 S (like the Chromebook but with Windows) doesn&#8217;t let you run any app that interfaces directly with Win32 without going through\u00a0<a href=\"https:\/\/en.wikipedia.org\/wiki\/Universal_Windows_Platform\">UWP<\/a>. Only those apps that can get loaded via the windows store (ergo, UWP) can land on the 10 S. Eventually.<\/p>\n<p>This is a big deal&#8230; because, let&#8217;s face it, as the article points out, most everything uses Win32 . \u00a0You know how you can tell that this is a fact? \u00a0If you use Windows 10, you&#8217;ve probably noticed that there are some applications with the regular-old interface you&#8217;ve been seeing for the past decade &#8212; and then there are a few really-slick looking ones with a more modern-looking interface. \u00a0You&#8217;ve noticed that, right? \u00a0Like the built-in &#8220;news&#8221; or &#8220;mail&#8221; apps that look and behave a little different? \u00a0The ones that say &#8220;Trusted Windows Store App&#8221; on them? \u00a0If you haven&#8217;t noticed, pay attention as you use Windows 10 and you&#8217;ll notice: a few apps look just a little different in terms of button layout, window framing &#8212; even position and style of the title bar sometimes. \u00a0That&#8217;s UWP. \u00a0The regular old clunky stuff? \u00a0Win32.<\/p>\n<p>What&#8217;s interesting to me about this article is that I don&#8217;t quite think the author of the article really understands why developers use Win32 in the first place&#8230; \u00a0which is unfortunate, because this is exactly what makes the impact of Windows 10 S to the app ecosystem (should it be broadly adopted) so significant. \u00a0The article attributes the ubiquity of Win32 in part to &#8220;developer laziness&#8221; &#8212; I guess something along the lines that developers are all old school folks\u00a0who aren&#8217;t interested in learning how UWP works. \u00a0Which, (while I thought this article was generally well informed and astute and no offense intended) kinda makes it clear that the author isn&#8217;t now &#8211; or probably wasn&#8217;t ever\u00a0&#8211; a serious Windows developer. \u00a0Because, laziness isn&#8217;t the reason. \u00a0It&#8217;s not even close. \u00a0UWP is wicked easy compared to Win32 &#8230; no really. \u00a0Go try it. \u00a0It is. \u00a0Compare for example creating a\u00a0<a href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/uwp\/get-started\/create-a-hello-world-app-xaml-universal\">hello world under UWP<\/a>\u00a0compared to doing<a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/bb384843.aspx\"> that same thing under win32<\/a>. \u00a0The &#8220;lazy choice&#8221; is clearly the UWP option that Visual Studio aggressively pushes into your face. \u00a0The Win32 option you have to look for, change defaults to select, and results in something pretty ugly.<\/p>\n<p>So why do people use Win32? \u00a0The reason why IMHO is versatility. \u00a0Here&#8217;s what I mean. \u00a0UWP is pretty powerful, right? \u00a0It lets you do most things you might want to do for most apps. \u00a0So that&#8217;s great. \u00a0But there are things Windows can do &#8212; and that are implemented in the Win32 API &#8212; that UWP won&#8217;t let you touch. \u00a0Which makes sense because UWP is designed to encompass the subset of functionality that is portable between devices. \u00a0Win32 gives you it all. \u00a0So if for whatever reason your app needs to know <a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/windows\/desktop\/aa366589(v=vs.85).aspx\">detailed information on the memory status<\/a> of the machine, you can do that. \u00a0 <a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/windows\/desktop\/aa372683(v=vs.85).aspx\">Change the power management wake status<\/a> of a specific device? \u00a0Don&#8217;t mind if I do. \u00a0You can do pretty much everything the OS can do.<\/p>\n<p>And unless you can be sure &#8212; before you write any code &#8212; that you won&#8217;t need some service that UWP doesn&#8217;t offer (either now or down the line), Win32 is always the better choice from a versatility standpoint. \u00a0And who knows every function call an application might make before it&#8217;s written? \u00a0Not even the most detailed designing process lays that out nowadays. \u00a0Literally none. \u00a0If a product manager is able to tell you every service some new application will use (down to the function call) &#8212; before developers write code&#8230;. and they also promise not to change their mind ever&#8230; then UWP could be a good choice. \u00a0Although at that point, it&#8217;s arguable how much the developers are even needed (for debugging or production support maybe.)<\/p>\n<p>In all seriousness, an analogy to this would be that your family has two cars: a Ferrari and an old beater. \u00a0The Ferrari is in otherwise good condition but has so little gas in the tank that the empty fuel light is on (assuming Ferraris have a fuel light) &#8212; the beater has a full tank. \u00a0You need to drive to the store but it&#8217;s a holiday so you don&#8217;t know if the gas station on the way is open or not. \u00a0It probably is&#8230; \u00a0But do you risk it? \u00a0The Ferrari is a much better ride: more fun to drive, all around a preferable experience in every possible way. \u00a0But the gas thing could be a big deal. \u00a0It&#8217;s the difference between a quick and easy trip vs. a huge hassle that could take hours and may or may not get you to the end state successfully. \u00a0And because you don&#8217;t know ahead of time whether the station is open or not, it&#8217;s pretty risky &#8211; and the consequences pretty dire &#8211; should things go south.<\/p>\n<p>But here&#8217;s the real clincher&#8230; \u00a0by writing for Windows in the first place, you&#8217;ve already limited portability. \u00a0What are you trying to be portable with? \u00a0Nobody cares about Windows phone&#8230; \u00a0XBox developers have their own black magic anyway. \u00a0So what&#8217;s the value of UWP? \u00a0Because UWP is prettier? \u00a0So you can put your app in the App store? \u00a0That&#8217;s far from compelling when the alternative is so much more flexibility and potentially the difference between solving the problem your app tries to solve vs. not.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I saw an article today about some of the changes being discussed by Microsoft in regards to future Windows application development and their plans for Windows over the long term. \u00a0It&#8217;s an interesting \u00a0article &#8212; mostly focusing on the history of the Win32 API, what the future of that might be under Windows 10 S, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"categories":[4],"tags":[37,129,130],"class_list":["post-169","post","type-post","status-publish","format-standard","hentry","category-security","tag-development","tag-win32","tag-windows"],"_links":{"self":[{"href":"https:\/\/securitycurve.com\/index.php?rest_route=\/wp\/v2\/posts\/169","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/securitycurve.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/securitycurve.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/securitycurve.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/securitycurve.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=169"}],"version-history":[{"count":0,"href":"https:\/\/securitycurve.com\/index.php?rest_route=\/wp\/v2\/posts\/169\/revisions"}],"wp:attachment":[{"href":"https:\/\/securitycurve.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=169"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/securitycurve.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=169"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/securitycurve.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=169"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}