Saturday, March 10, 2012
I've been working on another C++ course for Pluralsight to complement the C++ WinRT/Windows 8/Metro course I did as well as the two-part C++ Fundamentals course (part 1, part 2). It's finished and live!
The topics I cover are:
- Avoid Manual Memory Management
- Use Lambdas
- Use Standard Containers
- Use Standard Algorithms
- Embrace Move Semantics
- Follow Style Rules
- Consider the PImpl Idiom
- Stop Writing C With Classes
I had a real blast writing this - while I was editing it I could hear my own enjoyment of parts of it. I hope you enjoy it too. A Pluralsight subscription is such a bargain - buy one for the topics you simply MUST learn for work, then use it on your own time to learn all those other things that you think you might benefit from. (I recommend Annual Plus - $500 gets you the sample code and offline viewing, all you can learn for a year.) Whether C++ is "must learn for work" or "I hear it's different know, wonder if it could help me" for you, I hope you find it helpful. Please let me know!
Sunday, February 19, 2012
Do you know how to get a command prompt and have its "current directory" be a specific directory in which you want to do some work? Sure you do. In fact, I bet you know at least three ways.
First, the how-hard-can-I-make-this way: Click Start, and mouse around until you see Command Prompt. Click that. Change drives if need be (by typing D: or E: or whatever) and then change directories with the CD command a lot.
Did you know that pressing Tab will autocomplete file and folder names? It even puts the quotes in there for you, since spaces are interpreted as "this is the end of the file and here are some other parameters". But as I said, that's the slow way.
A lot of times, I have a Windows Explorer open to the very folder where I would like the command prompt. I've looked at the files and I know I want to install a service or register a DLL or run an exe or something. Here are some ways to get to that command prompt more quickly in those cases.
First, get yourself a command prompt, and get on the right drive (eg D:). Then, type "cd " in the command prompt, and click on the Windows Explorer address bar so it becomes plain text. Copy the text with Ctrl+C, and then in the command prompt, bring up the system menu, choose Edit, and then Paste:
This is really the long way though. First, you can do a cool drag and drop trick. In the command prompt, get on the right drive and type "cd " , but then in the Windows Explorer click the folder image next to the path, and drag that into the command prompt window:
Not bad, but try this. Close that command prompt, and shift-right-click in the background of the Windows Explorer folder:
That's quicker, right? Sure it is. But two issues - first, a shift right click followed by mousing down and clicking does take a little dexterity. And second, what if I wanted a certain kind of command prompt - say a Visual Studio Command Prompt? Well, that's where we take a turn into stuff I didn't know until just a few days ago.
Go back to that Windows Explorer, click as though you were going to overtype the address in the address bar (you did know you could do that, right?) and type cmd, then press enter:
It even changes drives (to D:) if you need to. Wow! Now, what else can you type there? Well, I've tried notepad foo.txt, for example, and it creates a file in that folder for me and opens in it notepad. Do you know how many times I've done right-click, New, Text File, type the new name, enter to accept that, enter to edit it? This is way quicker. (It doesn't seem to worker for newfangled apps like WinWord, unfortunately.) Or, how about this:
You need the pairs of double quotes at beginning and end - you might have this string in a handy text file on your desktop, or you might move that batch file to somewhere with a shorter path. Because that particular string gives you a "Visual Studio Command Prompt" in the folder - perfect for installing services and whatnot.
Just goes to show you, there's always something new to learn. I use the cmd trick almost every day. And my thanks to whoever coded that, whether it was 20 years ago or more recently.
Wednesday, February 08, 2012
I've been excited about C++ AMP since it was first announced
back in June. What's C++ AMP? It stands for Accelerated Massive Parallelism and it's about harnessing thousands of cores on accelerators like GPUs. You can speed up some applications by a factor of 10 or more. Not 10%, 10x. And you don't have to learn some C-like language, you get to work in C++. It's done almost entirely with libraries, which means you can use C++ AMP from a variety of applications, including Metro apps for Windows 8.
If you check my Concurrency category
you'll see I've been writing code (and words) for months now. I just haven't been putting those words here on my blog. Instead, they're going into a book, for Microsoft Press! Soon, I will have some chapter drafts available for review. If you're interested, I've set up a page with some details
, and some links for those who want to learn more.
There's increasing media coverage, including Peter Bright at ars technica
and Darryl Taft at eWeek
, and last week the spec
was released to the public
under the Microsoft Community Promise license. This means other compiler vendors can implement C++ AMP in their own compilers, allowing even more developers access to heterogeneous hardware and massive speedups for data parallel calculations. Herb Sutter mentioned it in the Day 2 keynote
at GoingNative, the Visual C++ Blog
included a link, and Soma blogged about it
Dive in! There's a lot to learn. And plenty of samples to play with. I'll post updates here as I go.
Tuesday, February 07, 2012
The minute this was announced, I knew I had to go.
Two days of "C++ today and tomorrow" with the bright lights of C++ today? Just try and keep me away! I'm so glad I was there - it was AMAZING and FANTASTIC and just generally wonderful. For me, personally, seeing so many old friends was a big part of it. The C++ team, other C++ MVPs, people I went to university with, and so on. It was also wonderful to see so many young people - including speakers, but also attendees, who were clearly in their 20s (and a few who were obviously in their teens.) After Chandler's talk I told someone "we can retire now: the future of C++ is in good hands." The speakers were not "the usual suspects" at a Microsoft event either. At a panel at the end of the second day, someone asked about C++ and the cloud and one of the answers was to indicate three speakers sitting next to each other: "Microsoft guy, Facebook guy, Google guy. Where isn't C++ in the cloud?" While that was a great cloud answer, I think it also highlights how inclusive this was - it was a C++ conference held at Microsoft, not a Microsoft conference.
Some fun quotes I happened to write down:
- “if it’s that ugly, it must be good” - Bjarne, on why some newbies imitate horrible code written long ago by their heroes
- “write C-style code, expect C-style errors” - Bjarne again
- “we know where bugs hide” – Bjarne (they hide in large tracts of complicated code)
- "dot dot dot is where the fun begins" - Andrei
- "real code is not supposed to fit on slides" - Andrei
- "this is legal" - Andrei (we needed to be reassured since it rarely looked legal)
- "if you're using new or delete, you're doing it wrong" - Herb (it's true!)
And Chandler's talk was very much a 2012 talk, with lolcat-like interjections and Simpsons references and even a how-agile-is-this update with a picture of Oscar Wilde in reference to Andrei's earlier off-the-cuff description of some template error messages (aka template barf) as being "a small novel by Oscar Wilde." The humour level was very high, much of it self-deprecating - no-one, not even the coiners of the terms, thinks RAII or SFINAE are great names, but what the heck, they're the names we use.
Even the little things here were so well done. Herb opened the conference by dedicating it to Dennis Ritchie, which I found extraordinarily touching and appropriate. He opened day 2 by celebrating the 20 year anniversary of Microsoft C7 which was C++ 1 for them, with Visual C++ appearing in the next release. There on the podium was the two foot long, 44 pound box, with multicoloured plusses all over it, in which it shipped.
And what was inside? A lot of books, and a lot of 3.5" floppies (I took this picture earlier, before the box headed to campus):
There are 5 or 6 floppies in each bag and apparently each bag had a part number of its own.
This conference was far more than a trip down memory lane, of course. It was a two-day Valentine from Microsoft to the C++ community, a demonstration of the "new growth" in modern C++ and the power and capability that is there for those who are prepared to start using the new features, and a chance for all of us to accelerate the learning we have to do. I so hope you were able to be there, or to catch the energy by watching it live and following tweets from those of us who had to share the bon mots and the fun. But if not, the on-demand videos are almost all there now. Here are the links:
Threads and Shared Variables in C++11
T. Lavavej: STL11 – Magic && Secrets
Variadic Templates are FunadicPanel:
The Importance of Being Native (Bjarne,
Andrei, Herb, Hans)
Herb Sutter: C++11, VC++11 and Beyond
Clang - Defending C++ from Murphy's Million
Alexandrescu: Static If I Had a Hammer
Stroustrup and Andrew Sutton: A Concept Design for C++Panel:
Ask Us Anything! (all
Fair warning: both of Andrei's talks, and the Concepts talk, are hard. This is cool new stuff that we are all learning about. There is no shame in pausing, rewinding, and giving something a second listen. Look, Chandler was running through pitfalls and problems that Clang catches, and showed some code with a problem I couldn't spot. A few minutes later in the Q&A, Bjarne asked him to clarify just what the problem was. Made me feel better!
Chances are you won't be able to watch any of these on fast forward, or skip any of them. So I'm asking you to invest 12 hours of your life to watch all of them. Do it! You won't regret it!
PS: They gave us shirts (it's all about the shirts for developers) with real code on the back and this on the front:
Highly appropriate. Of course, it's not a comeback for those of us who never left. But still...
Thursday, January 12, 2012
Perhaps not a great surprise, but today the precons for Tech Ed North America
were announced and mine is there too. It's well described in the previous blog post
and I'll be doing the same material at both events. So if Orlando, June 10th works better for you than Amsterdam, June 25th, terrific and I'll see you there! Registration
is now open.
Monday, January 09, 2012
Yay! Today I got news that registration is open for Tech Ed 2012 in Amsterdam, and with it confirmation that my preconference
has been accepted! This is great news for anyone who loves C++, because it's a C++ all day preconference! The title is C++
in 2012: Modern, Readable, Safe, Fast
and here's the abstract:
is gaining momentum as a development language, so whether you’ve never used C++
or stopped using it a decade ago, it may be time to brush up on your skills.
With a new standard release providing new keywords and capabilities, C++ is a
featured language for many of the new Microsoft technologies and enables
some amazing speed-ups of your application using libraries like PPL and C++
AMP. What’s more, Visual Studio offers tools to native developers that have
only been available for managed developers in earlier versions. This all-day
session will show you what all the fuss is about and give you the skills you
need to understand the advantages of C++ today and how to start applying those
benefits to your application.
Now, if you're an experienced and current C++ developer, you may not need to come to this session. But if you were thinking you needed a refresher, here's a great way to get one, and at the same time look at some of the cool new stuff that is available to you once you know C++. If you've never written a line of C++ code in your life, but you're solid in C# or Java so you know the basic syntax (if, while, etc) you should be able to follow this session, though it won't teach you all the fiddly bits of C++ syntax and make you a C++ developer from scratch. It should, however, give you the inspiration you might need to go and learn all that fiddly syntax, and understand why we have it. I am also hoping there will be a number of relevant breakout sessions you'll want to attend after getting a taste of what C++ developers can do, though we have to wait a little longer to find out about those.
I'm still working on the exact content, but my first draft outline looks something like this:
- Modern C++ with the Standard Library (demo of strings, shared pointers)
- Application Lifecycle Management for Visual C++ 11
- Leveraging Lambdas for the PPL and C++ AMP
practices for C++ developers today
This is 9am - 5pm (all day) the Monday before Tech Ed Europe starts, June 25th. You can register for the precon and Tech Ed now. And tell your friends! I would love to see a TON of registrations to ensure continued C++ content at Tech Eds around the world.
PS: Yes, I know that Tech Ed US is a few weeks before Tech Ed Europe. You didn't miss the US announcement; you shouldn't have to wait much longer for it though.
Wednesday, December 21, 2011
Work is underway on settling the agenda for Tech Ed, even though it's almost 6 months away. As Brandy explained
a week ago or so, it starts with asking "the usual suspects" for session submissions. Tech Ed is a fairly closed conference - the call goes out to MVPs, RDs, some Microsoft employees and previous speakers. (How do you become a new speaker? Do a great job somewhere else first -Tech Ed is not a beginner's conference. The people who get the call for content can propose great speakers who didn't get the call.) Now they've announced the technical tracks
, which gives you an idea of what you can expect to see covered. There are no huge surprises here: I'm most interested in Architecture & Practices, Developer Tools, Languages & Frameworks, Windows Client and Windows Phone.
What will be next? Announcing the precons. They've already announced the price: $400 if you're attending Tech Ed, and $500 if you're not. They'll say what the precon topics are in early January. But by then, the super early bird discount will have expired. That discount will save you $300. So registering now is like paying only $100 for the precon! If you can decide in January or February, when the precons are announced, you'll still save $200, so it's like your precon is half price. Either way, it's a great deal for a full day of deep training on something relevant to the kind of people who come to Tech Ed.
To be clear, I don't know what the precons are going to be. I will blog as soon as I know. But if you think there's a chance that spending a whole day with someone who really knows their stuff on a topic you need to know (especially one you never got around to learning and feel you should) would be worthwhile, then why not make it official, register for Tech Ed
, and see what gets announced in January?
Saturday, December 17, 2011
Pluralsight, for whom I've done a lot of courses
, has revamped their website recently. That includes having drawings or sketches in a lot of places where you might expect photographs. Here's the one they've been using for me, next to the photo it was made from:
I definitely like the sketch better, but lots of people recognize the photo because it's one of the few I use in the various places people want pictures. I also have this one I use on my public Facebook page
I am not sure any of these will help you find me in a crowd. That's one of the reasons that on my business card (and my Twitter profile
) you'll see this one:
More than one person has had an "oh, that's who you are!" moment when I hand them my business card. Yup, that's me!
© Copyright 2019 Kate Gregory
Theme design by Bryan Bell
newtelligence dasBlog 2.3.9074.18820
| Page rendered at Monday, October 21, 2019 11:51:34 PM (Eastern Daylight Time, UTC-04:00)
On this page....
Pluralsight Free Trial
Click Start a FREE 10-Day trial