If only COM and C++ would die. No such luck though. We get more of it from Microsoft. And security holes for the foreseeable future.
@Jon: That's your opinion. I'd encourage you to watch this presentation and learn about WRL, then post something intelligent here, if you must post anything at all.
@Charles While I will admit that I didn't watch the video in it's entirety, I think I saw enough of it to know that it's not something I'm interested in using. Exceptions aren't even allowed? I don't see how this is a step forward. Honestly, I can't understand why there is such a push by Microsoft for people to start coding in C++. If you were already using C++, then fine, I'm sure the improvements are great, but, I seriously doubt developers using .NET are going to jump ship and start programming in the new COM. I guess it all depends on the application. If you are writing standard GUI apps, I don't see what the point is. I would rather see Microsoft focus on making managed languages and .NET more efficient. I thought Microsoft had it right back in 2003 when they were saying that 95% of the UI in Vista was going to be in .NET and that new APIs had to be in managed code. Then they back pedaled and released a hugely bloated OS even without managed code. There has to be a better way than COM. It is really strange how a non-Windows specific apps such as MySQL can install in a matter of seconds and something like SQL Server which presumably heavily uses COM takes forever to install. I know that SQL Server probably has far more features, but, something seems wrong with how Microsoft has been doing things. Also, I think C++ means continued vulnerabilities. Sure, you can write secure code in C++, but, that isn't what happens as is proved every other Tuesday when Microsoft releases new patches.
@Jon: COM isn't the problem. C++ isn't the problem. Humans write software and it's humans who make mistakes in implemenation of software that can cause security vulnerabilities when the software executes... Sure, some tools make it easier to make mistakes if you don't have enough experience using them, but you can't blame the saw for removing your finger - it just did what you did with it... It's way too simplistic to blame tools for problems that emerge as a side effect of their misuse.
WRL is a library tool for C++ developers who want to author C++ components for WinRT using a familiar ATL-like development pattern. I encourage you to watch this video if you are a C++ developer (it doesn't seem as though you are...).
I don't really want to have this debate on this thread... Perhaps we could move it to the Coffeehouse forum. This thread is to be about WRL.
@Charles Thanks. I'm in the process of watching Herb Sutter's video on Windows Runtime. He said he recommends using C++/CX instead of WRL. It seems like it might be less horrible.
@Jon: Yes. By all means, use C++/CX to consume and author WinRT components in a C++ Metro style application. That's the idea. Herb will explain this in the keynote (good for you for watching it - you should have started there... ). WRL is an advanced topic. Typically, you won't have to use WRL directly. It's for experienced C++ developers who really understand COM and need to program at the ABI level (this talk explains when you'd want to use WRL, of course, and when you wouldn't)...
Watch all of the sessions, if you can. You'll have many of your questions and assumptions addressed.
Hey Charles, I really appreciate all the content that you provide for us! I have watched most of your EtoE series and usually find talks with Eric Meijer the most informative and easiest to digest.
I would be interested in some of the motivations behind this library. I have used COM a bit and never found it to be an elegant programming paradigm (and the different threading models certainly take time to get used to).
In particular, it seems very odd that people have decided to go 'back in time' and just ignore a lot of the lessons we have learned about what makes developing code efficient and error free.
In particular, COM code for one reason or another always seemed to have extremely high levels of repetition and boilerplate, making its efficiency on functionality-per-lines-of-code basis very very bad as well as the possible bugs per line of code rate quite high. In a lot of situations it felt like trying to program a sophisticated application in assembly.
Would it be possible to get an EtoE--type interview with someone who could perhaps explain some of the motivations behind WRL and perhaps more fundamentally COM and why it is a good idea to continue this practice? It is difficult not to criticize COM and WRL because they just feel so clumsy.
Thanks a lot for your work and your willingness to explore and produce so much spectacular content!!
My understanding of it is that WRL is a handy way to bring legacy COM libraries forward to be used in Metro style apps without needing to rewrite them completely. It's also a way for people whose companies forbid the use of exceptions (I personally don't know why people do this, but there are places that do it and I'm sure they have their reasons) to write new Metro style libraries and apps without violating their company's internal policies.
C++ developers should default to using C++/CX to write WinRT components and Metro style apps. The reason for that is that, as you pointed out, WRL (like COM) has a lot of repetition and boilerplate code. But there are those situations where some people will want/need to avoid C++/CX (whether for portability reasons or for exception avoidance or whatever) and in those cases there's WRL.
"Exceptions aren't even allowed? I don't see how this is a step forward." - you realise this is partly designed to be called from C code and similar that do not support exceptions.
"Honestly, I can't understand why there is such a push by Microsoft for people to start coding in C++."
Because C++ is a lot more efficient than .NET, Herb Sutter told us that Microsoft's analysis showed the majority of dtaacentre costs is power, and on mobile power (ie battery) is very important. .NET failed to give us very efficient systems, being designed for massively powerful desktop systems with more RAM and CPU than could be consumed by a single user. When you have a million users accessing a cloud service, you do not want .NET to suck up all the resources. This is why C++ is back in fashion.
"I seriously doubt developers using .NET are going to jump ship and start programming in the new COM"
Too bad, .NET is already legacy, your new C# and VB.NET apps will have to use WinRT, albeit via a thin wrapper.
@Chris: Thanks for the kind words, Chris. In terms of COM/WRL C9 conversations, have you watched these? ->
I'll try to see if we can get Erik to interrogate (in a nice way) somebody who actively maintains COM in the Windows division. No promises, though. Erik really likes COM, by the way (at least in principle).
@AndyB: .NET is not legacy... Just as C++ and JS aren't.
1 day ago, Charles wroteI'll try to see if we can get Erik to interrogate (in a nice way) somebody who actively maintains COM in the Windows division. No promises, though. Erik really likes COM, by the way (at least in principle).
Getting people from WinDiv to talk, huh, yeah..... so MoCom is a WinDiv thing.