# Thursday, 01 December 2011

I'm in the middle of writing a number of SUPER COOL things that I will blog about as they finish. But interesting things happen even when I'm too busy to blog, and an interesting one happened today.

You know you should have a Pluralsight subscription, don't you? All the training you can watch (some of it by me) for as little as $29/mo? You can't go wrong. And if you're an MVP, or an RD, or a member of BizSpark, you don't even have to pay that! But if you don't have a free subscription and haven't paid for one yet, taking a free course is a great way to see what all the fuss is about.

Well, starting right now, you can do just that! Pluralsight and the Visual Studio folks are providing my Using Visual Studio course completely free. Just visit the Learn Visual Studio page at Microsoft and use the links. And if you like the course, consider getting a subscription - there are scores more that you will like.

Thursday, 01 December 2011 13:56:22 (Eastern Standard Time, UTC-05:00)  #    Comments [1]
# Saturday, 17 September 2011

Oh my goodness. What a week that was!

Here's how I thought I would do my first summary. Links to videos, discussions of sessions I either went to or tried to go to (more on that in a moment) along with my tweets from the ground, as it were.

My first real tweet Tuesday morning (8:37 California time) was announcing that my PluralSight C++ Fundamentals course had gone live. Then the keynote started. Here are my tweets and retweets along with the time into the keynote I said them:

  • 6 minutes: #bldwin totally dominating my stream SS doing a good intro to lean back computing
  • 37 minutes: RT @dseven WinRT API'S are natively built into Windows and built to reflect in different languages - C/C++ and .NET. #bldwin
  • 42 minutes: Starting at 8PM today, Seattle time, you can download all of the code that attendees at BUILD received. t.co/nuTuwga
  • 43 minutes: RT @wkrwk Did anyone notice the UI during the VSE 11 demo is the classic Windows UI? #bldwin
  • 48 minutes: #bldwin VS vNext demo is breaking twitter = no hope of following it all
  • 50 minutes: RT @andrewbrust Expression Blend is still Grey on Black. It could use a little "fast and fluid," frankly. #bldwin
  • 51 minutes: Store menu in VS?? #bldwin #wholenewworld
  • 58 minutes: RT @rhundhausen Desktop (#x86) apps can be listed in the #windows8 store as well #bldwin
  • 61 minutes: RT @ayus :))) RT @timheuer The Red Shirt is dominant even when not present. #bldwin @scottgu
  • 79 minutes, @EdgarSanchez retweeted @rickasaurus asking "I'm interested in hearing more about this new GPU offloading API. Any links? #bldwin" and I answered "Check my blog as the week goes on for GPU stuff"
  • 80 minutes: RT @marypcbuk Sinofsky: that gaming PC looks like ice. Angiulo: more like lava, it converts 700w of power to 4.7 teraflops like 3,500 Cray XMPs #bldwinPlatform for Metro style apps
  • 87 minutes: RT @Pete_Brown Dude just cracked open a laptop on stage and showed the electronics. Can't beat that #bldwin #geek
  • 100 minutes: RT @andrewbrust When will we admit Sinofsky's doing a great job? He's working hard, not just presiding. #bldwin
  • 120 minutes: RT @ronnipedersen If you have an iPad, don't watch the build keynote… It'll make you feel like you have bought a C64 #bldwin
  • 127 minutes: RT @jonbrasted It is a great day to be a Windows developer. #bldwin #trbbuild

The download surprised me, I didn't think it would be ready for people to try on any old hardware. And the hardware demo was very very good. And sure, I was on instant messenger back to the office saying "it's official" when the rumour was finally confirmed that we were getting tablets. But mostly, I really liked what I saw and wanted to know more, which is what keynotes are all about.

After eating something completely unmemorable, I found my way to the overflow room, always a little more casual and a good place to find "the cool kids". I had already met a number of old friends in the huge keynote session and before it, but here were more. I'll just give you the links to the Big Picture sessions. They are all very good.

  • 8 traits of great Metro style apps - a truly excellent session by a presenter who cares deeply about the topic. I tweeted a lot less during this one because it required more active listening.
  • Platform for Metro style apps - another very good session during which I just retweeted some other people's "Hey, this stuff is C++" reactions and a link to the session planner app for the phone, which I used heavily.
By this time people were starting to "get it" (including me) and the excitement level was rising. Here's just what I retweeted:
  • @coridrew #bldWin is really, really, really making me want to //BUILD/ Windows apps #BestConferenceNameEver #WhoKnew
  • @briannoyes Add ref from js project to C++ library - really empasizes this is running native #bldwin
  • +@fignewtron iPad limited in many ways to consumption - Windows 8 is production and consumption on many devices. Sales numbers decide winner. #bldwin
  • @mcakins Wow, the silence from Apple's camp is deafening! Windows rocks once more! Its 1995 all over again! #bldwin

One more session: Tools for building Metro style apps - I was getting tired at this point. It was a lot to take in. People were lined up the length of the convention centre for tablets. I knew there were enough for all of us, so I went back to my room to edit my pointers module for the PluralSight course so it could "tack on" to the end of the published course. While videos rendered, I had a little back and forth on Twitter with people who had noticed how much fun I was having, and others who were playing with their tablets already. I slipped out to pickup the tablet about 7:30 but didn't open it till the module was done. Then:

  • 10:48 pm: got major piece of work done ... yielding to temptation ... tablet here i come #bldwin
  • 10:57 pm: How's that for fast setup? Everything's installed.... Trying visual studio next
  • 11:11 pm: Just wrote a Win8 C++ app on the tablet with touch keyboard. Built and ran first time. #winning
That's right, I didn't even set up the bluetooth keyboard. People cite Visual Studio as an app you couldn't possibly use with touch. I wouldn't want to do it all day, but I did it! Then I played a bit more.

Day 2 started with another whole keynote. C++ was front and centre here. Some tweets:
  • 17 minutes: RT @seesharp 3D graphics debugging at the pixel level in DirectX. Unreal. #bldwin
  • 33 minutes: RT @bgervin killer strategy for MS to help developers make HTML apps for iOS and Android #bldwin
  • 34 minutes: RT @tpdorsey RT @EisenbergEffect […] in C++, you can write your own WinRT library, which when built, can be used by C++, C#, VB and JS.
  • 34 minutes: RT @jmorrill This new COM and C++ version is not _anything_ like what you think it is. From what I can tell so far...effing amazing!!!!
  • 49 minutes: Loved it RT @MichaelDesmond Zander shows off the new image editor in VS11 as he works on a C++ DirectX game.
  • 54 minutes: RT @shycohen Moving a VHD while the machine is running is cool. Moving a live VHD is even cooler! :) Will enable amazing things in the future. #bldwin
  • 82 minutes: most tattoos ever in an MS keynote
  • 95 minutes: RT @seesharp WOAH. Did not expect Steve Ballmer today. Everyone was starting to leave already. Woah! #bldwin
  • 97 minutes: RT @carafone 500,000 downloads of #win8 already! #bldwin
  • 98 minutes: RT @LACanuck And #Win8 was downloaded 500K times in 12 hrs RT @mashable: RIM Has Sold Just 490,000 PlayBooks - on.mash.to/nEu0dU #bldwin
  • 102 minutes: That's what these keynotes were missing! Turns out it's a great time to be a developer. I was worrying, no-one had told me yet #bldwin
  • 105 minutes: I've been paid to program since 1979. Keynotes tell me at least once a year it's a great time to be a developer. And they're right. #bldwin
Then it was time for simultaneous breakouts, and that meant choices. You can search the sessions list as well as I can. The C++ ones are not to be missed. These are happy people who are delighted to tell us what's been going on, and they're proud of it, too. At 3:13 I tweeted "Went quiet because i am massively engaged with C++ content in packed rooms. Small break between sessions to say "wow!" #bldwin #happycamper". The remainder of the afternoon was super confusing. People were jumping to conclusions, correcting each other, having opinions about the death of this that and the other. Because C++/Cx (the language extension you use to call WinRT) looks a lot like C++/CLI, people thought it was managed, but it's not, it's all native code and C++ Metro apps get a perf boost from that. The understanding that something amazing and powerful still has COM at the core began to grow. People were reporting trying to use Windows 8 gestures on their iPads and on nontouch screens, showing that the team has made some very intuitive choices. One tweet of mine I want to repeat: "Big props to Aleš Holeček for joining in the Q&A in the last C++ talk of the day when the questions got really Windows-y. Impressed. #bldwin". Even if you're not a C++ developer, download that session and watch the Q & A.

Day 3 started with being turned away from a C++ session, and so going to a different C++ session that was on at the same time. Several people from the C++ team made the trip with me, giving me a chance to tell them how impressive all this was. Meanwhile on mailing lists, people who weren't onsite and were 12 - 24 hours behind as they waited for session videos to go live were echoing the confusion and dismay of yesterday. It was hard to be patient with them. It's going to make sense, I wanted to tell them. Just hang in there! I took a small break from sessions to watch (and help with) the C++ part of Channel 9 Live (I am still waiting for links to the recording, because I couldn't hear everything they said and I want to) and then to Herb's second talk - again the room jammed full and dozens turned away, Don Box (who had earlier reminded us COM is still love) blurting out his admiration for Herb as a speaker and the great content, and the terrific line, "We protect against Murphy, not Machiavelli". What a time to be a C++ developer!

Day 4 kicked off with kind words from Daniel and a chance to hand out paper copies of the whitepaper I recently blogged. I got some quiet time with various smart people who told me their thoughts on all this. I'm still synthesizing it all. I also was downloading videos like a mad thing. I came home with 22 hours of video to watch and since then have grabbed another 15 or so. Some people began to realize they had over-reacted. Some excellent blogs began to appear - Doug Seven, for example, had several sensible things to say.

And then it was time to go. Glenn Ferrie tweeted "Writing C++ in the airport #bldwin #WinRT" and that summed up the week for me. I have a lot of watching, coding, thinking, reading and talking to do so I can establish what all this means. But hey, why not join me? It's a great time to be a developer!

Saturday, 17 September 2011 16:42:01 (Eastern Daylight Time, UTC-04:00)  #    Comments [1]
# Thursday, 15 September 2011
Word is starting to get out about C++ AMP, which appeared out of nowhere at a conference remarkably few Microsoft developers were paying attention to, because it was a hardware conference. There was information available in June, enough to get some of us excited:

I got into this right away and have been playing with code and doing a little writing. This is the kind of technology that changes things more than you might think. By leveraging the GPU, your code might run 10x faster, 50x faster, or even 100x faster. And for you to be able to do that from C++, using familiar C++ constructs, and a debugger and profiler in Visual Studio? That means everyone can do it.

Well, not quite everyone. You do have to learn how to parallelize your algorithms. The syntax of using the GPU (or some other heterogeneous computing resource) is not hard at all. The computer science of knowing your work is data parallel can be hard. But let me show you "not hard". Consider this code to add a pair of one-dimensional array:

void AddArrays(int n, int* pA, int* pB, int* pC)
    for (int i=0; i<n; i++) 
            pC[i] = pA[i] + pB[i];

Compare that to this:

#include <amp.h>
using namespace concurrency;
void AddArrays(int n, int * pA, int * pB, int * pC)
    array_view<int,1> a(n, pA);
    array_view<int,1> b(n, pB);
    array_view<int,1> c(n, pC);
        [=](index<1> idx) restrict(direct3d)
            c[idx] = a[idx] + b[idx];

It's all C++ and it's all pretty readable. And this code runs on the GPU and can be WAY faster (and use less power, meaning your data centre is cheaper or your battery lasts longer) just like that.

Recently Daniel Moth has published ten blog posts drilling into some details. They will help if you've decided to start using AMP and want to know how. But before you do that, you might like to read a little background on why heterogeneous computing matters, what other options you might have for doing it, and why C++ AMP is what you want to use. I've done a small whitepaper on just that and would love you to read it and let me know what you think.


Thursday, 15 September 2011 09:15:16 (Eastern Daylight Time, UTC-04:00)  #    Comments [2]
# Tuesday, 13 September 2011
I've been writing a course for Pluralsight that covers the fundamentals of C++ - types, expressions, basic syntax stuff, templates, pointers, polymorphism - and it has gone live! During BUILD access to it is free. It uses Visual C++ Express, so you don't need to buy any tools to follow along. Lots of buzz at BUILD about C++, so if you want to see if it's a language you could use, here's a great way to find out.

I have more material coming on this, and some Windows 8 - specific material. This is just background. If you think you need to get up to speed on C++, here's how to do it. Let me know what you think.


Tuesday, 13 September 2011 12:41:14 (Eastern Daylight Time, UTC-04:00)  #    Comments [4]
# Monday, 29 August 2011
For a long time now, whenever anyone asks me about support for particular C++0x (oh sorry C++11 :-) ) features in a given compiler, I've sent them to the list Scott Meyers maintains. The format is kind of strange because it's exported from a spreadsheet, but the information is invaluable.  If you'd like to see more compilers covered, try the wiki at apache. Scott does gcc and Microsoft Visual C++; the wiki adds compilers from Intel, IBM, Oracle, and so on. You  might be surprised to see the variations in coverage. Expect new versions to continue to add support as soon as possible.


Monday, 29 August 2011 16:08:39 (Eastern Daylight Time, UTC-04:00)  #    Comments [0]
# Saturday, 27 August 2011
I was poking around on CodeProject looking at some developer interviews (they've started these up again with some interesting subjects, so check the recent links) when I spotted An interview with Microsoft's new Visual C++ .NET community liaison - and in March 2002, nearly a decade ago, that was Herb Sutter. Isn't the Internet a handy attic? Check out some of these quotes:

I hope to make a noticeable mark in the product.

C++ continues to be relevant, dominant, and in widespread and still-growing use. The C++ standard and standardization process also continues to be relevant [...] all the vendors, including Microsoft, are there together actively working on the next-generation C++0x standard whose work is now getting underway.

[...] the best numbers I keep seeing put the global developer community at something like 9.5 million people, and those using C++ at about 3 million of that. That's well ahead of Java in nearly all studies I've seen, by the way, usually by a factor of 1.5-to-1 or 2-to-1. [...] The reports of C++'s demise have been, well, "exaggerated."

C++ developers need power and know how to use it. I've always said you should use the best language for the job, and I've used dozens of languages professionally. Depending on how you count languages, I've probably used a dozen professionally in the past year. People who want to write efficient, tight, fast code often tend to choose C++ because it lets you get the job done with powerful code but without sacrificing efficiency. 

People who want mature, stable compilers and tools often tend to use C++ because it's been around a while and the tools and libraries are plentiful and solid. Commercial client-side application development with more than a few screens, most kinds of server-based software, and most kinds of libraries are all done more often with C++ than with other languages, according to the best numbers I've seen and according to my own experience as a developer and as a consultant who shows up at other developers' shops.

Nine and a half years later, I see nothing but good stuff there. I hope all my interviews stand up as well (though I already know they wouldn't) and I'm impressed at the ability to set a goal and meet it. What will the next decade bring?


Saturday, 27 August 2011 15:53:50 (Eastern Daylight Time, UTC-04:00)  #    Comments [0]
# Thursday, 25 August 2011
The cone of silence that descended this summer is starting to fray a little. The Visual C++ Team Blog has an entry talking about Productivity features in the IDE. They're willing to talk about:
  • Semantic colorization - this is actually as much font face as it is colour, but anyway function parameters look different from locals, constants you #define'd look different from everything else, and so on.
  • Reference Highlighting - you've seen this in other languages I'm sure - when the cursor is in a variable name, other places in the code with that same variable name are highlighted for you. It can be very helpful.
  • Replacement Solution Explorer - I'm a huge Pro Power Tools fan, and if you've used Solution Navigator, you won't be surprised when you meet the new Solution Explorer. Combination Solution Explorer and Class View is the best way to explain it to a C++ developer.
  • Aggressive IntelliSense - something else you may be familiar with from other languages. I like it.
  • Snippets - oh, yeah!
Apparently there's still plenty more to come! Looking forward to it.

Thursday, 25 August 2011 15:43:15 (Eastern Daylight Time, UTC-04:00)  #    Comments [0]
# Tuesday, 23 August 2011
C++ is a great language for writing applications that will run on a number of platforms. There are compilers for many different platforms, and some powerful libraries you can use. Still, in the end your code needs to talk to the operating system, and that means that most cross platform applications have at least a few little corners where platform-specific code lives. The challenge is how to ensure that your Windows code runs on Windows, your Linux code runs on Linux, etc, without maintaining a number of different branches or hand-merging and splitting every time you deploy.

Being C++, an unspoken requirement in solving this problem is "be as fast as possible". Putting everything through a library and paying for extra indirection, looking up something that cannot change once the program has started executing, is not as fast as possible. You also want developer convenience and productivity. If you support five platforms, and something is the same on four and different on one, copying that code around for the four that are the same is not a productive way to behave. You would like a default behaviour, and then special code for special cases.

Michael Tedder has an intriguing approach using templates. As he says:

Instead of declaring a base interface class with virtual functions then deriving each platform with a different implementation, we declare a class with one template parameter — a platform ID — then specialize it to provide a different implementation for each platform.  The template class is then typedef‘d to expose the specialization for the platform ID being compiled to the application, allowing the implementation to be used without any virtual functions and also allow for inlining of functions as well.

He has some pretty convincing armwaving about using this not for just Windows/Linux/Android but for any hardware differences even on the same operating system - like what kind of graphics architecture you have or anything else that can't change at runtime. It's a good example of how the power of templates makes things possible that would always incur a runtime cost in any other language, or a significant burden on a developer to move code around building custom versions of an application. Worth a read!


Tuesday, 23 August 2011 14:55:55 (Eastern Daylight Time, UTC-04:00)  #    Comments [0]