Universal Windows

I have to start thinking more about supporting the Universal Windows profile at work, but it is rather difficult.  Let’s start out with that Universal Windows actually is.  Since the dawn of Windows, programmers have interfaced with the operating system using the Windows API (sometimes referred to as Win32, but this is only one version of the API).  The API is written in C, and has maintained backwards compatibility since version 1.0 (many many years ago).  Microsoft decided it was time for an upgrade so they could attempt to modernize the OS API.

And so, Windows Runtime was born with the release of Windows 8.0.  It built on top of the Component Object Model which allowed multiple programming languages to interoperate in the same program.  It stores the metadata to allow this in a nearly identical fashion to the .NET framework (which has the bonus of reducing the overhead in marshalling between managed and unmanaged code).  After a few years, and an update to 8.1, Microsoft realized they were creating too much fragmentation between desktop, tablet, and phone and decided with Windows 10 to create a Universal Windows Platform which would support all of them under the same application.

However, when using the new runtime, only a subset of the original .NET APIs are available as is.  Some have been removed, some have been modified, and some exist as they did before but simply in a different namespace.  This has been improved but still contains a large amount of friction.  In particular, things that traditionally take a long time have been forced asynchronous (such as network calls and file I/O).  This is a significant refactor to accommodate for by itself, but take into account (at the moment) that Couchbase Lite has support for .NET 3.5, and Unity3D (which for the time being is somewhere between .NET 2.0 and .NET 3.5) which doesn’t have the fancy asynchronous support that .NET 4.5 and WinRT has and this becomes an insufferable problem.  I’m hoping that in the future Unity3D will be updated and we can drop support for .NET 3.5 and focus on purely .NET 4.5+ but for now the only choice is to do what every reasonable developer will tell you to NOT do…mix async and sync.

Wish me luck!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s