We all know that Windows 8 is coming out in October. We also know that developers are hard at work trying to ready their apps for Windows 8 when it is finally released. However, if you're new to WinRT or have a big amount of experience coding using C++ or one of the .Net languages like C#, there are some things you have to watch out for.
Compared to C++ which allows mutable strings, the .Net languages consider strings to be immutable. WinRT has taken the route of strings being immutable (even in C++), and the use of NULL or (nullptr) with strings is now frowned upon. Any string which is set to NULL is treated as an empty string (with 0 characters).
In Data Structures, we have a big change. Arrays normally are reference types, pointing to a "group" of same-type values (or objects) as part of one big memory chunk. In WinRT, arrays are now value types. I am not sure how the memory management actually works yet (whether it's still one big chunk for the group or not).
For events, you handle them the same way that you normally do in your language of choice (for example, in C#, you add event listeners using += and remove event listeners using -=, so you still continue this practice when developing WinRT programs).
For method overloading, WinRT changes how this works. Normally in method overloading, you can either use a different number of parameters for each declaration of a function, different types of parameters for each declaration of a function (for example, the function displayMessageOnScreen(string message) and displayMessageOnScreen(char message)), or a combination of the two approaches. In WinRT, method overloading is determined by the number of parameters, so something like the example I gave above would throw an error in WinRT.
As far as Collections go, many of the collection types found in .Net have a couterpart in WinRT. As far as specific changes go, the WinRT Vector type resembles arrays and the array syntax is used to consume them and the WinRT Map type is a key/value pair collection, and is projected as Dictionary in .NET languages.
Regarding asynchronous functions, all functions taking more than 50 milliseconds to complete is deemed an "async method.
For information, please see http://channel9.msdn.com/events/BUILD/BUILD2011/PLAT-876T. I hope this is helpful to you in some way, shape, or form when developing WinRT programs.
If you have any thoughts or comments of
your own about this,
feel free to share them via the comment box below or e-mail me at email@example.com.You can also find me
(twitter username is @rctechgeek). Feel free to subscribe to my rss feed too. I am now on Tumblr now as well (link to Tumblr is http://www.tumblr.com/blog/catholictechgeek), so please follow me on Tumblr too.
If you're feeling thirsty while using the computer or can't quite stay
awake while using one, drink (or give someone you care about)
some tasty Mystic Monk
Coffee (use this link or click on the picture below to access
the store and
purchase). Trust me, it's good coffee (in most instances, much better than
coffee) and you won't regret buying some (just keep it away from your
computer keyboard or laptop/tablet). For the summer, they are also
Iced Coffee as well. If you like tea more than coffee, they also offer
tea. Using the link (or
picture below) to buy the coffee (or tea) helps the monks out and helps
me with college expenses as well.
Feel free to try out my apps for Windows
Phone: Mobile Media Manager, a media player app I made which has some
which (I feel) are missing from the system Zune player, and BSA Eagle
an app that boy scouts can use to track their progress to Eagle Scout
scout handbook isn't always handy). The update for the paid version of
Mobile Media Manager is out, but my last submission update for the free
version in Microsoft Apphub
certification failed, so release of the update to the free version will
be a few days (< 7). BSA Eagle Tracker is also
getting a bug fix
for an obscure bug I noticed recently.
BSA Eagle Tracker download: http://bit.ly/Mm1Upo
Media Manager (paid version) download: http://bit.ly/y3rf6V
Mobile Media Manager (free version)