Description

Welcome to GoingNative!

GoingNative is a new show on C9 dedicated to native development and native developers, with an emphasis on modern C++. In our inaugural episode, we keep things light and easy as we introduce you to what we're doing, why we're doing it, and how it will go down. The most important thing to realize right off the bat is that we want you to join us in the cockpit and help us fly this plane.

The main goal of episode 0 is to introduce the cast of characters, including your hosts Charles and Diego, and to present some ideas of how we think this show will be organized and executed. For example, Diego Dagum and I will typically construct the show, iterate through some code demos of varying complexity, converse with native developers from Microsoft and across the industry, and then destruct the show. We're not sure if we should add a news component—you tell us. We're not sure how much rambling you want hear from me and Diego—you tell us. And we're not sure how advanced we should make the programming section—you tell us (do we provide both intro and advanced topics?).

Now, of course this first episode isn't just a "Hey, we have a new show. Yay! Tell us what you want for next time" type of affair! We do talk about and demo a few new C++ features (shared_ptr, lambdas, auto) and have a conversation with Ale Contenti - development manager of VC's front-end compiler, libraries, and IDE.

[You can play around with the demos in this episode by downloading the free VC++ Express IDE]

Table of Contents(click time code links to navigate player accordingly)

[00:09]Charles and Diego construct the show and talk about modern C++ (how 'bout that set, eh?)[07:27]Diego demos shared_ptr (Please see STL's incredible C9 lecture on shared_ptr for much more detail)[10:01]Charles and Diego chat briefly about C++ lambdas[10:32]Diego demos lambdas[12:13]Charles and Diego chat briefly about C++ auto keyword (seen in the lambdas demo)[13:30]Charles and Diego talk about the audience and how you can help us fly this plane[15:32]Charles interviews Ale Contenti[26:35]Charles and Diego destruct the show ( it won't usually take this long )

The Discussion

Hey Charles! it seems like you're going with the saying: "If you want something done well, do it yourself" You've been doing a lot of shows with people from the "Managed" world, and always asking about the "Unmanaged side of things". It's nice to see you having a show of your own and "Going Native" Good luck with the show, and I hope to be able to watch it when I "Go Native" myself

@Jules.dot: There are apparently 9 million professional developers (how is this number calculated, anway?). 3 million of them are C++ developers (how is this number calculated, anyway?). That's what the spirits tell me. So I listen.

YAY! Downloading now. Sounds like you are following the format of the .NET show!

The 9 million/3 million numbers sound too low to me. Maybe the catch is that it doesn't count all of the non-"professional" programmers churning out code out there. Still, for C++ to hold 1/3 of the market these days is a noteworthy number.

I'll be back later with comments after I watch the show. (I'm falling way behind on my C9 viewing lately ... too many good videos and too much real work to do...)

If the show will be monthly I would ask(if possible)to make available a transcript, it would greatly facilitate the understanding and might even be able to translate into other languages​​(it is a desire to have since from the first episode of the STL ).

Hey that's really good think, I think that the complete series for devellop application end to end one for games and data access all this with multiple stuff like the efficient Design Pattern for save time elegant code and usuability because the syntaxe is here but why to applied in very complcated stuff, that's the question i think the series for same theme like c# can be very very good think

Remove the wobbly sea-sickness background and it'll be the 2nd best show on C9 right behind "Going Deep" that's how much potential this should have. But the intro background animation is amazingly horrible even though I don't get sea-sickness but If it's on other shows... I already pity the viewers.

Also the only thing able to match this in awesomeness is C9::Functional ; a show focusing all about functional concepts and best practices and functional styles beyond syntax and how to do functional work in imperative languages and functional data structures. This way the complete contrast can be covered and can help all 9'ers grow as true programmers and not just a C++, JavaScript, Ruby, Erlang, C#, F#, Java or Haskell dev.

After see the flow in twitter, if you guys will talk about COM or COM-like interfaces I highly suggest an introduction to _com_ptr_t, its an amazing wrapper I found on few MSDN Direct2D examples and it really simplify wrapping COM/COM-like, acting like a smart pointer.

@HeavensRevenge: Fair enough. We thought broadcasting from inside a machine was an awesome idea. Perhaps we can remove the wobble, but leave the graphic? We like sitting next to a processor geeking out on native code. Something poetic here. C

@Charles:Oh yea the bubbles, any matrix-like power surges along the geometry is all cool so long as its mainly stationary; that wobble on there right now is just funky and distracting. I guess a super slow change of angle 1/5th - 1/10th that speed wouldn't be too bad, but atm that wobble is a little too fast.

Native development is the way to build great and powerful softwares. C++ is the language for power and performance. So it is necessary to make more and more promotion of C++ and native development. Great !

Hi! Very interesting episode. I develop C# code, but I was a native developer before. I plan to go back to native soon. This renascence movement is inspiring me to so. A side note: you could get rid of the moving background. It makes me dizzy! Eduardo

@spivonious: Umm. There is no hidden agenda.... Shining light on native does not mean we won't continue to focus on managed, too... We've had this conversation before. We've neglected native over the years and we aren't going to anymore. Period. That's the news.

@l3igmike: Great idea. You won't find a "C++ for C# developers" article on MSDN, though you could reverse the concepts put forth on the published MSDN guidance for "C# for C++ developers", I guess, though C++ is not the mathematical dual of C#.....

The best way to learn, as always, is to code. So, download some free tools and start coding!

If the show will be monthly I would ask(if possible)to make available a transcript, it would greatly facilitate the understanding and might even be able to translate into other languages​​(it is a desire to have since from the first episode of the STL ).

Agreed. With Diego and plenty of other guests we've had on Channel 9, I sometimes need to give my full attention to understand them. Microsoft is very diverse! I don't know if it's the video format, the mic used for recording, my speakers, or just an inability on my part, but a transcript would be really helpful.

@PhrostByte: Great suggestions. We love Stephan. His expertise, however, is STL. We'll want to explore more than that. We will of course have STL as a special guest. He's an incredible native dev, regardless of his specialization! A true legend around Microsoft.

In terms of transcription, we'll need to figure that out. We've not done this before on C9. Added to our list of items to consider. It's a fair and good suggestion we should address.

I will echo a lot of the previous comments. A few things that came to mind that might be appropriate for this show:

- Overview of new C++ language features and how they can be used to improve one's code. (Follow Herb around a lot.)- This show is about native code, not just C++, so show some other native languages (maybe feature a different one for each show), discussing their advantages and disadvantages for different tasks, and how they compare to C++.- Visit with MS native programmers to see how (and why) they are using native code to solve their problems (why native is a better solution for those cases).- Showcase other libraries/APIs/etc. that are of value to native programmers, e.g.: Boost, graphics (DX, OpenGL), computation (C++ AMP, OpenCL), UI, XML, math, etc.- Portability is an important aspect of C++ code for a lot of us. Show is methods of handling portability issues.

I have a feeling that there will be plenty of new material for the show after Build.

(And wandering off topic ... Heavens' suggestion for a GoingFunctional series would be another great idea!)

One subject you might take up is how to (best) develop code addressing DirectX, or Windows, the C++ way.

The pain is that as soon as one starts writing code that uses DirectX (or Windows) one is confronted with very many (how many?) typedefs and macros (e.g. #define). Also, the documentation shows C programming, not C++ or OO. What I would appreciate enormously is you guys leading the way in C++ programming DirectX (or Windows, but without MFC or ATL). Just C++, STL and the like, and a minimum of typedefs and macros. To quote Stroustrup: "Almost every macro demonstrates a flaw in the programming language, in the program, or in the programmer".

Suggestion, bring someone to fast talk about the backstage of the .Net microFramework, it would be an example of how the native is used to leverage the managed in an constrained environment.

[off-topic/clarification]@spivonious, @PhrostByte: hehe, funny,in this case I understand the accent of Diego better than the normal speech of Charles, I think because I got used to hear that accent when I went to lectures in the faculty (my accent is not much different)

The suggestion on transcript is because I highly recommend this site for my friends and students, but unfortunately,not all are proficient in English language.

@Virgil - The STL gives you some of the power of Linq, but without the composability. I've been looking at the Boost Range library, particularly the range adaptors, which seem to provide most of the advantages of Linq. I haven't done much with it myself, but I've been considering playing with it by making a Linq to XML inspired library based off of ranges to see how far it could take me.

@ryanb: Great suggestions. I can tell you that C++ AMP is the story for C++ and DirectX, as you learned in Herb's ADFS keynote on the topic. We will cover other native languages, but C++ will be the emphasis for the most part. Would be great to focus on a new C++11 feature per episode (including new library stuff). Visiting native devs is the plan, as you've seen with this first episode. Portability is on our radar an in our list of topics to cover. We're on the same page!

@OlManMarc:We are leading the way here. It's called C++ AMP and we will cover this in detail once it ships in some form (telling is not as useful as showing - that's our motto here). Fear not, you won't always have to program in C to work with DirectX!

@Marc - Thanks for the info Marc. I just hope something like LINQ will be available for C++ in the near future, I think it's not impossible to do. To me LINQ was the greatest improvement to c# in the last years, also it would improve productivity for C++ a lot.

I expect you will see LINQ for C++ (or something equivalent) in the very near future. All of the leaked information suggests that we are in for a merging of platforms. MS seems to be moving in the direction of being able to access all of the technologies from any language, managed or native, on any of the device platforms. If things really play out that way, we could be in for one of the most exciting times for software development in many years. (Though the thought of some updated version of COM being at the heart of it all brings a cold shiver of fear.)

I think that "Alex C" was reading "MyType ^ ptr0" instead of "MyType * ptr0". The first is potentially valid if MyType was a CLR type and we were compiling with the C++/CLI switch (/clr). Thus his use of the term "handle" and "plain C++ pointer".

@MichaelPrice: This was filmed in HD and the code segment is screen capture. The bluriness is due to Smooth Streaming and your local bandwidth conditions (SS automatically determines stream quality based on detected network conditions and sends down low or high res accordingly....).

In general, I recommend that you download the HQ version (WMV of MP4) and watch offline (unless you are on a reliably fast network - streaming into our SL player *should* be fine then).

I would be interested in how Native code could be sandboxed in a safe and platform independent environment. I am thinking about something like Googles Native Client technology, that compiles C++ to one binary, that can then be run in the browser on every OS platform and can only access those libraries provided by its host, in this case, the Chrome browser. Such kind of technology would also solve the problem of public marketplaces for phones and other os, that cannot trust native code(thats why WP7 marketplace is managed code only), so how about sandboxing it? How do you see the future of native on the web and on the phone not only as a engine everything is running on top of, but also as a dev platform for third parties?

While I do appreciate all the efforts to pop the native ANSI C++ back to the foreground, I must admit I am a bit sceptical about all the enthusiasm you guys are spreading... I have been working with native C++ for many years and I was going through all the ups and downs of the language evolution. Today, I must admit, the standardized language starts to connect up to the current (increasingly concurrent, functional and framework-based) way of writing software.

However, in my humble opinion, the biggest progress made in software business during the last decade is the level of abstraction introduced by managed execution environments. It completely changed the way of writing and deploying reusable and extensible software libraries. For those stuck with native C++ exclusively, this part remains hard (Not taking the open source way of deploying software into account here - which is not easy either, take a look at boost and the way it is configured for the various supported platforms - hats off to the boost configuration team...).

Remember Ale Contenti's remark on dozens of string implementations in all the "foundations" and libraries around? One could continue with all the Lists, Arrays, Threads, etc. in Qt, POCO, boost and of course those available from Microsoft via COM, ATL, MFC, or the PPL (which I'd love to see standardized, by the way...). Of course, we all use the standardized C++ library which is a most valuable tool set to use but because of the lack of compatibility between the implementations and no guarantees with regard to binary compatibility it is banned to "internal usage" only.

Long story short: If you are a library writer (you target other developers which reuse you products for their own development) you end up with some kind of own (mostly COM-like) infrastructure which wraps your algorithms and data structures PLUS a plethora of various layers on top of it to make your libraries usable for those who have chosen to use one of the "foundations" mentioned above. This is an annoying and, sort of, fragile part of developing in native C++ and the one which - to paraphrase Mr. Contenti - makes me envy the colleagues from the "managed" world.

One remark yet about the increasing number of native C++ developers mentioned above: Right now I am looking at the question tags at stackoverflow.com and the statistics tells me the following: There are currently 200757 questions regarding C#, 144340 questions tagged with Java, PHP: 132764, Javascript:116829, JQuery: 100957, iPhone: 91398, .Net: 86186, ASP .Net: 85003, android: 84286, and 80666 question tagged with C++. The proportion of C++ tagged questions was continuously falling over time. The interpretation is left to the reader, but taking into account that the complexity of the language and it's "libraries" is increasing the conclusions are obvious.

Have been trying to learn C++ for a long time ago, but I allways go back to C# xD If Microsoft could add the ItelliSense and the colors which is added to classes in C++ like it is in C#, it would be a lot easier to code =D

To be quite honest, I've been a bit skeptical of the "C++ Renaissance" idiom floating at Microsoft. Sounds a little too much like cute press copy, and MS promolingo has an infamous reputation already, though I'm sure it creates goodwill (or is that confusion?) in the Windows-only dev crowd.

Face it;1. C/C++ is *already* (and has been for a longggg time) VITAL for the core internals of Windows (and as the underlying platform for Java, .NET, Python, Ruby, ...). That's not going to change overnight, so you already have that going for you as a show.

2. If you choose to program in C/C++ you do it for one reason: because. PERFORMANCE. period. Otherwise, it's a bit too painful to fight with all it's ugliness as a language--both in syntax, and what with all the "clubs, knives, and guns" lying about. But, if you need bare-metal, it's there 4u.

3. If there is truly going to be a "C++ Renaissance", I believe it will happen only because a very significant portion of the entire global hacker community embraces it, not just MS-only developers.

But, to this last point, C++0x has some truly elegant enhancements to the language that make it a real pleasure to code with, compared to old ARM/98/03 stuff. But education is the key. If universities will adopt the new paradigms in their curricula, then there's some hope that Noobs can learn C++ early enough to *actually* understand how their computers work. The current state of CS education is generally abysmal for undergrads, in this regard of imparting true hardware understanding. I *do* appreciate what Stephan is doing to help explain the STL.

And one more thing, heterogeneous parallelization is absolutely vital moving forward...GPU. is. King. You ignore this topic at your own peril. While NVidia has made some amazing advances (and tip of the hat to AMD also), programming these devices is too painful and messy at this point, though NVidia Thrust is pretty interesting...

Herb Sutter's presentation on Microsoft AMP was pretty inspiring, I must admit. If you can do 2 things, 1) drop the "Microsoft" part (and PLEASE don't go the same route you did with ECMA and C#/CLI--just *give* it away, free and clear with no mumbo-jumbo. Straight ISO-standards body. Hey, Herb chairs right now!).2) use your mighty warchest to actually put it out there for the whole world to use on *any* platform. I mean serious R&D invested directly with the HW vendors, creating standards-compliant interfaces--not DirectX.

As I say if you can do these 2 things, you can incredibly accelerate the rate of increase in performance of computing for the whole world--with dramatic benefits for all--and you will actually gain some respect in the broader dev community for the groundbreaking work.

Sorry to be expansive, I wouldn't invest my time here if I didn't think what you're doing with the show Charles was important. So, my advice is simple-focus on modern C++0x and lose the horrible old syntax of C and all the MACROS SHOUTING AT ME. Whenever AMP is RTM, wield all the power you can muster there at Microsoft to make them give it to the world, and teach your friends to do the same...

Really hope there will be more directx content, both in the form of AMP and "regular" directx programming

Also, i'd really like some more content around managed c++ and interoping with native and managed code using that. maybe if more light is cast on managed c++ the VS team will finally fix the intellisense in mc++..

@aL_: This show won't really focus on C++/CLI, aL_... We'll stay pure native for the most part, but we realize we live in an interoperable world so when you need to play with the CLR, then C++/CLI is the language you want to use. That said, we want to dig into C++11 (aka 'Modern" C++) on this show! Sounds like you also want some C (eg., "classic" DirectX...).

Native C++ in a web browser seems like the next logical step. We all really always knew that managed languages is a dead-end, you must run naively, and the only efficient tool with high level of abstraction is native C++. And C++0x made it clear, there are no other contenders. Now, Google is moving full throttle putting Native Client into Chrome, targeting their Chromium Linux. This is a very attractive concept, which no doubt will entice a lot of software developers. I don't think MS has a choice, they must put native C++ client in Internet Explorer. The one who does it first the right way will have a dominant role in this new round of browser wars. Google is still stuck with very limited C and C++ support, and primitive tools. MS having one the best C++ compilers, very comprehensive native API, and some of the most competent C++ people, can easily win, unless they waste too much time. So, Go Native and Go Faster!

@shanefarris: Don't worry! Filming a new episode this month (then, after Build, we hope to go out more often! FYI I'm attending C++ and Beyond and have been filming some great native content for this show (and C9, generally)!! Really nice to see how many C++ devs here know about C9)

They don't seem useful for C++ developers, and they don't seem useful for non-C++ developers. I'm also not completely sure what the content is meant to be. Just seems like jumping around all over the place.

My biggest problems with C++ is NOT the language, it is the piss poor compiler/linker output and what I broadly call the "ecosystem." The libraries are far too complex and you gain nothing for this complexity.

The reason C# is good has nothing at all to do with it being managed. Any idiot can learn how to deallocate memory or how pointers work. The reason C# is good is that it doesn't have all of the junk C++ has due to its legacy.

Microsoft wants people to use C++? Then re-write it from scratch, dump every library it ships with, get rid of the linker step and then build it up again from scratch. Or more realistically give me managed C# instead - I'd LOVE it.

I honestly think managed C# would end C/C++'s lifespan on the Windows platform.

@Charles Hi, although I can clearly see that ManipUni has lots of <your opinion here> in fairness, his question: "who those video are aimed at: isn't bad at all. Actually it is quite important to clearly state and define your audience so would you mind and do that?

Are they for beginners? Advanced? etc, you get my gist.

Charles could you please answer to that?

Thanks

By the way, it's Knowing me knowing you, a-ha, I just couldn't (for some reason) sign up with that nick.

@KMNY_a_ha: We answered this in the video. This show is for native developers of all skill levels. We will try to ensure we deliver content that is useful for both novice and expert native programmers. For example, the demos in this episode are clearly targetted at those will little to no experience with C++11... For those with more experience, we have a series of more advanced pieces by STL (Stephan T. Lavavej). We'll continue to fine tune the show based on what viewers want to see.

Great timing on the show Charles, C++0x voting is now completed, unanimous approval! http://herbsutter.com/2011/08/12/we-have-an-international-standard-c0x-is-unanimously-approved/

Congratulations to Bjarne Stroustrup, Herb Sutter, Lawrence Crowl, John Lakos, David Abrahams, Daveed Vandevoorde, Pete Becker, P. J. Plauger and so many others for all their hard work! Though it was a [very] long wait, this standard is incredibly important.

@ManipUni: "I don't understand who these videos are aimed at." Well, based on what you wrote (are you serious?), the answer is not you.

If not me, then who?

I'm not completely serious about the "Managed C#" bit, but I am about C++'s ecosystem and general compiler/linker output being the worst part about the language.

I measure success by how much time I spend actually writing code compared with, for example, fiddling with the project's settings, or googling for solutions to issues that have nothing to do with the language/code its self.

C#/ASP.net/PHP are extremely good in this regard, and you spend almost no time at all googling obscure problems that aren't code related. C/C++ and Java to a lesser degree you spend tons of time doing what I call "screwing around."

How many different incompatible string formats does C/C++ have anyway? A dozen? More?

@ManipUni: Managed C# is redundant as C# is, well, managed... I just don't understand what you mean in this regard. At any rate, since you said you were not serious, then I can now comment on your concerns/perspectives that are perhaps more serious.

Indeed, C++ has many non-standard libraries to choose from I'm certain the number of string implementations out there far exceeds 10 or 12 as many folks roll their own for their specific purposes (not always by choice, mind you...). This is not to say that it's a good or bad thing. Simply, it is what it is. C++ is also a general purpose library language, after all. Still, the numbers of ways to do similar things is a bit daunting. You're right and string is a good example of this...

Yesterday's C++ has some warts. I think all C++ developers would agree with this notion and I think it's true of most general purpose languages in wide use today. Today's C++, on the other hand, is really like a new, fresh-faced language, a C++++, if you will. This is what we will focus on here: Modern C++. We will also discuss C and D, as well (you tell us), but C++ is the bread and butter of this show so our base audience are C++ developers. Does that answer your question?

I encourage you to learn more about modern C++ and see if it suits you. Write some code, use the new features, explore, take some risks . Ask questions.

Do a search on "C++0x" and you will find several sources of very useful information.

cout/cin are still heavily used... I'm not sure what you're talking about re library removal. At any rate, do some surfing. The Bjarne slide deck from a recent talk is useful and his lecture is worth your time.

@ManipUni wrote: The reason C# is good has nothing at all to do with it being managed. Any idiot can learn how to deallocate memory or how pointers work. (*)

A managed (execution environment) or language, if you will, is not equivalent to having automatic memory management (garbage collection) or to not having pointers. Proof: there are several garbage collectors available for native C++ and there are pointers in C#. Managed execution environment means that the code you write is compiled for (and executed by) a virtual machine. Programs written for a VM are much more descriptive and "self-aware" than natively compiled programs. You can build simple-to-use and easy-to-configure environments, it is easy to build binary compatible and easily deployable frameworks. That's why you don't have to deal with piss poor compiler/linker output and what I broadly call the "ecosystem" (*) and far too complex libraries (*) which I'd rather put as "libraries which are far too complex to configure and build correctly".

Although @ManipUni's opinion was expressed a bit too radically, I basically agree with her/him. Simply put: IMHO, adding even more complexity to C++ language could be counter-productive, if the "ecosystem" (= compilers, linkers, build environments, libraries + standardized support for deployment of components, etc...) is not evolving at adequate pace.