# Thursday, 25 July 2024

Day 2 at CppNorth started with Lightning Talks! But first I had to walk to the venue. When I drive around, I'm used to a flagger making cars stop from time to time to let a construction vehicle proceed. But this was my first sidewalk flagger:

The lightning talks were terrific, as they so often are. Funny, helpful, educational, often all 3. Pier-Antoine Giguère was our high-energy MC and really shone. I don't have any pictures because I was paying attention to all the talks!

Then it was Chandler Carruth, one of my fellow Carbon leads, with How Designing Carbon with C++ Interop Taught Me About C++ Variadics and Overloads, a talk I definitely enjoyed. There was plenty of code in both languages.

The audience seemed to enjoy it, too. After lunch I went to Hiding your Implementation Details is Not So Simple by Amir Kirsh, who has a gentle teaching style I really like. Then it was Mitigating the Intellectual Anxiety Associated with Learning the C++ Programming Language by Emmanuel Danso Nyarko from CppAfrica. If you've ever worried about C++'s reputation for being "the language for smart people" this talk will show you just how real it is. The reality of what jobs are available in Africa controls what languages people will learn. With no high-paying fintech or envy-of-your-friends gamedev employers, why would someone take on something they think is incredibly difficult?

This also applies to what is in the standard library. Seasoned C++ developers with lots of community folks to talk to can figure out how to build a UI. Different projects will make different choices - use Qt or some similar C++ framework, put a not-C++ frontend on a C++ engine, or some of the other choices of various age and success. But how does someone without that community navigate those choices and get started? Why doesn't the standard library help with that in any way at all other than "console apps" with keyboard input and text output?

Then I went to see Sohaila Ali, a very poised 17 year old with years of experience in hackathons and other contests and conferences, talk about career from that youth perspective. The audience was very engaged and the conversation after the talk was lively and enlightening.

Alas, as that talk wrapped up I had to do as I mentioned in my keynote and accept my own limitations. After a very full day of interesting talks I needed to cut the input for a while so I did not see Eric Wastl's keynote. I look forward to the recording, because I heard it was good.

One more day to go!

Kate

Thursday, 25 July 2024 19:59:18 (Eastern Daylight Time, UTC-04:00)  #    
# Wednesday, 24 July 2024

Monday morning started with a short walk to the venue. The first few minutes were against the flow of Toronto commuters pouring off a GO train and walking to nearby offices, which was quite an experience. But on reaching the 44th and 43rd floors, the reward was an amazing view!

I was worried about whether this year's food would be able to match the wonderful food we had our first two years, at a hotel. Well, it's been just as good and even better at times. Here's the morning pastries and fruit:

I had the opening keynote again this year. Here's the empty room after my tech check:

My talk went really well. This was the first time I had ever given it. I really wanted to reach the younger people, and I believe I did, to make sure they are aware there are things they can do early on to build up resources that will help you have a happy and healthy old age, and program for as long as you want to. I'll blog a link to the recording when it's live. Here's a picture from Twitter:

After my talk, I attended "C++ is a MetaCompiler" by Daniel NikPayuk. He had terrific outlining on his slides.

I urge everyone who is doing a talk to bake all their highlighting and "notice here that" into the slides themselves. Show the code, then advance or build or whatever you call it in your slide tech, so that the thing you want to show people is highlighted in some way. A coloured background like this works fine. Talk to it, then advance to the next thing. This is quicker than anything you might do with a mouse or other tool on the fly, it looks neater, it is guaranteed to be on the recording (pointing with your hand or a laser pointer never is), and the slides themselves remind you of the things you wanted to point out on them! I learned a lot from Daniel this week, starting in this talk but not ending there.

Then I watched Beginner's Mind, Expert's Mind by Dawid Zalewski. This talk was literally about minds in a way I wasn't expecting and it was very good. Highly recommended.

After lunch (spent mostly goggling at the amazing views, but the food continued to be very good) I went to "Software Engineering Completeness : Knowing when you are done and why it matters" by Peter Muldoon and "Meandering Through C++ to Create ranges::to" by Rud Merriam. I really enjoyed both of these, one for having no code at all but understanding how code fits into the big picture, and the other for having a lot of code and opinions about that code.

Then I went back to the hotel for a nap so that I could attend the Belonging Dinner in the evening. Negar Farjadnia talked about living as your authentic self and how even if there are a lot of barriers to that, putting in the effort to overcome those barriers and reach a place where you can live authentically brings huge rewards, not just in being happier but in many other aspects of your life.

What a first day! Super pleased with how it went!

Kate

Wednesday, 24 July 2024 11:32:40 (Eastern Daylight Time, UTC-04:00)  #    
# Tuesday, 23 July 2024

Sunday I travelled to CppNorth in Toronto. It started for me with a bus trip:

After the bus, I had an hour on the train and then a 5 minute walk to the conference hotel, the Royal York. I waited for my room to be ready and was pleased to be able to see the venue from the hotel:

It's the blue glass building with the diamond shapes on the side. Going back and forth between the venue and the hotel is quick and easy.

That evening we had a small reception to pick up our badges. I liked these pronoun pins:

I also enjoyed the Northern Lights image on the badges. I met people who were here in previous years, new speakers, and old friends I am happy to see many times a year. Everyone was eager and ready to learn. It's a great start to the week for sure!

Kate

Tuesday, 23 July 2024 15:01:08 (Eastern Daylight Time, UTC-04:00)  #    
# Tuesday, 21 May 2024

I really enjoy speaking at NDC Techtown in Norway. The airport is pleasant and easy to navigate, the trains are reliable, and it's a quick walk from the train station to the hotel, which is right at the venue. Plus the other speakers are always amazing, so I have a jam-packed two days of sessions to attend. Many years ago I decided to only speak at conferences where I would want to watch sessions, and it improved my life tremendously!

This year I'll do The Aging Programmer. This is a new talk that should be helpful for even the youngest programmers amongst us, because when it comes to planning for a happy old age doing what you enjoy, it's never too late, and it's also never too soon.

See you there! You've got three more days to order Early Bird tickets!

Kate

Tuesday, 21 May 2024 11:07:23 (Eastern Daylight Time, UTC-04:00)  #    
# Monday, 13 May 2024

I am really starting to look forward to CppNorth. We're in a new venue this year, the Microsoft Canada offices! They have a lovely suite of presentation rooms that they make available to community groups like ours. The program is chosen, and we're working on the schedule. In the meantime you can see the speakers and their talks. If you're ready, register now! You can also book a room at the conference hotel, the Royal York. It's an easy walk from Union Station to both the conference and the hotel as you can see from this map showing all three.

For those who would fly to Toronto, there's a train called the UP between Union Station and YYZ. You should plan to come a little early so you can do some sightseeing before the conference. There's a see-and-do channel on the conference discord that will give you some great ideas.

I'm honoured to do the opening keynote again. This year's topic: The Aging Programmer. Eyes, wrists, memory, stamina ... so many things we rely on can get weaker as we age. That doesn't mean you can't keep going if you want to. I'll talk about it.

See you there!

Kate

Monday, 13 May 2024 16:39:01 (Eastern Daylight Time, UTC-04:00)  #    
# Thursday, 09 May 2024

On January 8th, 2004, I got an email from the MVP Lead for Visual C++ at Microsoft, asking if I would like to be an MVP. After checking to see what that meant, I said yes, and was accepted into the program. I was renewed every year, and at some point after half a year, making just over 20 years coming up at the end of June. I'm still the only MVP called Kate.

I went out for MVP Summit that first year, and some RD stuff at the same time. Here's a production still from "Red Chair Green Wall" - the plan had been to greenscreen in some image related to where we each were from, but then in the end, we didn't. I'm including it to show how much younger I was then!

I've decided not to renew this year. Usually, people making this announcement do so because they're no longer doing the sorts of things MVPs do. But I'm still teaching, speaking, helping folks online, writing the occasional book, helping to run a conference, and all the technical things as well. What's changed isn't so much me, it's the program. I always valued my connection to the Visual C++ team very highly. These days, the team maintains those connections with developers whether they are MVPs or not. Events like Pure Virtual C++, among other things, can keep me informed as well or better than the program can. The MVP program is all Azure this and AI that and exciting details and announcements about conferences that just aren't relevant to me. I'm sure they are useful and exciting tools and events, for someone. I am focused on my little piece of the world and don't need more information on the stuff I've decided to ignore.

Joining the program was definitely life changing. I had some wonderful times, learned things I really needed to learn in as quick and enjoyable a way as you can imagine, met terrific people and raised my professional profile. I would do it all again in a heartbeat. I'm just not going to keep doing it, because for me personally the benefits are dwindling.

I'm truly grateful to John Perry, for bringing me into the program, to Karen Young for inspiration and funny stories, to Sasha Krsmanovic for everything, to Sim Chaudhry for cheer and support, and to Betsy Weber for being the last one standing. Most of all, I'm grateful to my fellow C++ MVPs, and the Canadian MVPs from all technologies, for being great people to spend time with and learn from. There are too many to mention -- I hope you all know you really made a difference.


Sure, I could have cropped it a little tighter, but then you wouldn't see the picture in the background of me with Bill Gates :-) What a marvelous pair of decades!

Kate

Thursday, 09 May 2024 15:02:29 (Eastern Daylight Time, UTC-04:00)  #    
# Thursday, 31 August 2023

During CppNorth, I took a few minutes away from the conference to do an interview for Pluralsight. The host was my dear friend Julie Lerman and we had a great time. We talked about my courses, #include <C++>, CppNorth, Carbon, and a lot more.

I thought you might like to see a few "production stills" of how I set up the space to do the recording. It's always a challenge in a hotel room to get good light, keep the bed out of frame, and be reasonably near an available power plug. I did it!

Yes, I have my ring light clipped to a lampshade. And I brought the light, my good mike, and my mike stand to Toronto with me in my suitcase. Getting the laptop up high enough and at the right angle involved a little foraging in the room :-)

This was the view from my chair. (That desktop background is the view out of the Bridge of Sighs, in Venice.)

And here's the final video.It's about seventeen minutes; please do share the link with others.

Kate

Thursday, 31 August 2023 11:04:11 (Eastern Daylight Time, UTC-04:00)  #    
# Sunday, 27 August 2023

The recordings from ACCU have been appearing over the last few weeks and now both of my talks are up:

  • C++ And Beyond: Discussion is a panel discussion with Vittorio Romeo, Kevlin Henney, Nico Josuttis, and me, moderated by Bryce Lelbach. The fun starts just six minutes in when Nico declares C++ "fundamentally broken." Still, there is some positive and hopeful content. We should think about the languages we use and what we want from them. C++ is a language that changes, which has consequences, both good and bad.
  • Become a Better Programmer by Using Words and Ideas From Casual Gaming is my closing keynote. Not a lot of syntax in here, but a new way of looking at some of the things you do at work, and how to approach those, that you may find helpful.

Going to conferences in person has many advantages, and I'm glad we're solidly back to doing that. But for the ones you can't attend, you can at least watch the sessions, and I highly recommend that you do.

Kate

Sunday, 27 August 2023 11:57:22 (Eastern Daylight Time, UTC-04:00)  #    
# Friday, 18 August 2023

The agenda for the Qt World Summit has now been released.

I'll be doing a half-hour version of a talk I've given only once before, "Am I a Good Programmer?" Many people have told me this is something they worry about pretty often.So at the end of November, we can discuss it together.

I've been lucky enough to speak in Berlin at several different conferences and I'm looking forward to being back there again. Would you like to join me? You can even get a discount of 10% if you use the code QtWS23_Kate -- register here.

Kate

Friday, 18 August 2023 12:32:58 (Eastern Daylight Time, UTC-04:00)  #    
# Thursday, 20 July 2023

Day 3 began with a terrific keynote from Jessica Kerr, I can write the code. But getting something done is another matter. I was so thrilled when she agreed to come and do a keynote, and this one didn't disappoint. I took pictures of several slides, always a good sign.

After a break it was time for Tony Van Eerd with Value Oriented Programming Part V: Return of the Values. There was plenty of pop culture here but also some darn good advice about making good abstractions, and what's good about them. Then out for lunch again ... I deliberately chose something different on my second trip to the market.

The afternoon started with Conor Hoekstra and New Algorithms in C++23. Conor makes these things look easy -- perhaps they actually are? Then the closing keynote, from Timur Doumler, called Contracts, Testing, and the Pursuit of Well Defined Behaviour. We sure have plenty of undefined behaviour to deal with:


I enjoyed this keynote too -- they were all good.

And then it was time to say goodbye to this lovely venue and this lovely conference for another year.


Being all on a single floor this year made it super easy to meet people, have chats, enjoy the breaks, and so on. One thing I noticed this year was that some people brought their children. This was just lovely! Parents are quite capable of knowing if their child can sit quietly and be in a session, and it was great to see that in action. I hope bringing children to conferences is something I see more often in the future.

Kate
Thursday, 20 July 2023 16:26:00 (Eastern Daylight Time, UTC-04:00)  #    
# Tuesday, 18 July 2023

Another amazing day in Toronto! Let's talk about what sessions I went to so far.

I started with Patrice Roy's Moving an Existing Project to C++ 20 for Fun, Beauty… and Results!. The first part set up a problem and showed some C++17 code to handle it. I was a little impatient during this part, because it was a lot of code and I would have done some of it differently (because I am doing C++20 which is the point of the talk) but I did notice that it was carefully written to be fast and readable. Then the fun started as things got shorter, simpler, and (proven with some measuring) faster using C++20 goodies.

Next was Ben Deane with Calendrical C++: std::chrono, History, Mathematics and the Computus. This very entertaining talk took a problem few of us really face in code (when is Easter next year?) and used it to show off what chrono can do with dates. Probably my favourite slide was the one to show when Thanksgiving is. When you get to it, you'll see why.

The first break of Day 1 was the "Canada Snacks" -- see the published menu for details. I've never put a blackberry on a Nanaimo bar, but they certainly were delicious.

I enjoyed And Then() Some(T) by Victor Ciura a lot, even though I had to duck out early. If you would say no to "are you using higher order functions today?" this is the talk for you. Because you almost certainly are, and knowing that will make a lot of things easier to understand.

For the last talk of Day 1 I had planned to attend Rud Merriam's A Journey into Ranges, Views, Pipelines, and Currying but some last minute schedule juggling as speakers ran into travel problems put it up against Timur Doumler with C++ and Safety. Safety is a timely topic, so I'll wait for the video to watch Rud's talk. Timur did an interesting review of what the word "safety" even refers to, why governments are starting to have an opinion, and whether C++ can ever be proven safe -- and why you should care.

We wrapped up the day with the conference dinner, a nice mix of old friends and new, speakers and not, and good food. I enjoyed the conversations a lot!

Day 2 started with a keynote from Ben Deane, Optimizing for Change. Some excellent advice in this talk even if I did find the dark background a bit of a challenge on some of the code slides.

I had an online meeting I couldn't miss, so I didn't go to another morning session. After my call I walked over to the St Lawrence Market to get some lunch. I wish more conferences were fully in the towns where they are held, and made it simple for attendees to walk out and experience a little sunshine and access a wider variety of food options.

The afternoon had more tough choices, but I went to Why Good Code is Relative by Daniel Withopf. A good summary of why you can't "just write it the fast way" and some solid code samples about how to actually follow advice like "avoid heap allocations."

Then I went to Get() into Retroactive Static Reflection by Vincent Tourangeau. This was a slideless talk, bopping around in a lot of surprisingly-readable code that showed how to get properties, introspection, and a lot of other things you think C++ doesn't have -- and all with C++11. I know I'll be watching the video when it's out because there were a few moments where I wanted to rewind and see something again!

For my last session of Day 2 I went to Writing C++ to Be Read by Vincent Zalzal. I really enjoyed this talk! It's the sort of talk I would give, but Vincent included a number of excellent points I had not made or heard before. He also had fantastic slides, with highlights to point out the parts he wanted to draw attention to, and good examples.

That left the Lightning Talks. Wow, these were so good! As always, some were funny, some showed something we needed to learn, and some were highly personal. I've seen a lot of lightning talks and I always get a lot from them. But I don't remember lightning talks from student volunteers and members of the organizing committee anywhere else. Worth staying up for!

Next, one more day!

Kate



Tuesday, 18 July 2023 07:03:11 (Eastern Daylight Time, UTC-04:00)  #    
# Monday, 17 July 2023

So great that the second year of CppNorth has really happened, and started so darn well, too!

We started planning year two even before year one had happened, with a "next year" folder, and never really stopped. If you thought it was challenging to plan and host a conference with a pandemic still underway, that's nothing compared to doing the same thing during -- what are we calling it? -- an "economic downturn"? Getting attendees and sponsors took a lot of work, and luckily a pile of people who aren't me did that work.

Me, I showed up on Day 1 and did a keynote. I really enjoyed it, too. I'll post again when the video is up ... if you're an attendee you should be able to get the slides any time now.

This is 90 minutes of "stuff I've learned" like "Take Notes in Meetings" and "Always Take a Moment to Check" (aka Shift Left but for people) and the like. Many people told me it was helpful, which is very reassuring.

Kate

Monday, 17 July 2023 11:34:57 (Eastern Daylight Time, UTC-04:00)  #    
# Saturday, 15 July 2023

I had a lot on my plate when the MVP renewals appeared July 6th, but I'm delighted to number myself among this illustrious group again. I'm never worried that I haven't done enough for the C++ community, but I do sometimes worry if the C++ community is the target audience for the program any more. Still, I suppose it must be, since they renewed me.

I updated my profile on the MVP site a little.

Kate

Saturday, 15 July 2023 10:10:05 (Eastern Daylight Time, UTC-04:00)  #    
# Saturday, 17 June 2023

From time to time I think it's wise to summarize the courses I have on Pluralsight. There is a link on the side you can use to get a free trial if you want to take any of these. Because I redo most of the courses each time a new version of C++ becomes widespread, there are quite a few courses with similar names. Here's a quick summary.

If you are using the latest version of a major compiler, you are on C++20. These courses have been updated for C++20:

  • C++ 20: The Big Picture This is an overview covering "what is C++?" and "what is it used for?". If someone has suggested you learn it, start here to understand why you might want to. The title means that it's up to date to C++20, not that it only covers C++20. The actual content is equally applicable to older versions of the language.
  • C++20 Fundamentals is more properly "the fundamentals of C++ including things that were introduced in C++20". This is an introduction to the ideas, syntax, and standard library. At seven and a half hours it can't cover absolutely every corner of the language, but it does cover what you need to call yourself a C++ programmer, and get started writing real code. This course assumes you already know how to program. If you don't, try Learn to Program with C++ 17 which will cover the building blocks of programming languages like loops, functions, and objects while teaching the C++ syntax and library. Afterwards, you can take Fundamentals to fill in any gaps.
  • C++20 Algorithms Playbook again covers up to and including C++20, so plenty of things that have been around for decades, but it does have a lot of content that is C++20 only, because ranges made such a big difference here. If you're not on C++20 yet, take the C++17 version, listed below. Both versions are designed to convince you to stop writing raw loops and start using the many useful functions provided in the standard library. I demystify iterators and show you the benefits of using library code instead of rolling your own.
If you're not on C++20 and are wondering if you should be, try What's New in C++20. It will show you what you have to gain by updating to the latest version of your compiler (and how to try things out if your compiler doesn't support something yet.)

If you're on an older version and can't move, you should still use the latest iteration of Fundamentals. There's very little C++20 only material in there, and it's all signposted, so you can just move past that part if you need to. For the algorithms course, Beautiful C++ 14: STL Algorithms is the older version that doesn't have all the ranges additions.

Some of my courses are really not version specific, but apply to particular kinds of work you might need to do.
I plan to update everything for C++23 when the compilers have support for the new features. There are a few things coming I'm really looking forward to!

Kate

Saturday, 17 June 2023 14:51:47 (Eastern Daylight Time, UTC-04:00)  #    
# Friday, 16 June 2023

Time for an update on the conferences I'm doing in 2023.

In April I did the closing keynote at ACCU, Grinding, Farming, and Alliances How words and ideas from casual gaming can make you a better programmer. My idea here is that certain things you are fine with in games, like "daily housekeeping", don't feel the same in your job. If you could feel better about them, you might be happier or more successful. Also, games pull on strengths like altruism and responsibility to get you to do things -- can your job do the same? Can your harness that to be more successful (however you define success) or happier at work? This talk was recorded and I expect it on the ACCU Youtube channel some time in June.

Next up will be "my own" conference, which is to say the one dearest to me as well as geographically nearest, CppNorth. There's still time to register for this: it will be in Toronto at the King Edward Hotel. July 17th and 18th are preconference workshops, and the 19th, 20th, and 21st are three jam packed days of sessions with evening activities Sunday, Monday, and Tuesday. If you live in and around Toronto this is your chance to see famous speakers (and discover some new ones) without having to fly a long way. I recommend you get a hotel room though, so you can truly immerse yourself in the conference while you're attending. My keynote is Steps To Wisdom: some tips I want to share with you that I earned through hard experience.

In September I'll be returning to NDC Techtown, this time to deliver the closing keynote on Day 1. These days I choose conferences based on many factors and small friendly ones like CppNorth and NDC Techtown really appeal to me. Both attract very good speakers and I expect to learn things -- I know I did last year!

In November I'll be doing something I haven't done before -- I recommend doing something new at least once a year no matter how old you get. In this case it's Qt World Summit in Berlin, where I will have a small keynote. I look forward to new people and new ideas from this experience, and hope to reach some people who haven't heard me speak before.

It's not too soon to think about the 2024 season, for me anyway. If you'd like me to speak at your conference, you can see many of my previous talks on my YouTube playlist. Please check my Speaker Kit for the details of my preferences.

See you at a conference, I hope!

Kate

Friday, 16 June 2023 16:00:49 (Eastern Daylight Time, UTC-04:00)  #    
# Wednesday, 03 August 2022

I've been working away for the last few months completely overhauling my C++ Fundamentals course at Pluralsight. Of course I updated everything for C++20, but I also added a module on error handling options, tweaked most demos, and lightened the overall look and feel. I'm really happy with how it turned out.

Here's the table of contents:

Leaving pointers almost till the end may seem like a shock, but this is how I teach C++ these days and it really works well.

As always, if you need a trial code, look for the image in the sidebar here to get a free trial and give it a whirl! I had a great time writing and recording it and hope you enjoy watching it.

Kate

Wednesday, 03 August 2022 11:18:49 (Eastern Daylight Time, UTC-04:00)  #    
# Friday, 25 February 2022

Maybe you hadn't heard? There's going to be a C++ conference in Toronto this summer. It's very exciting! I'm helping to arrange it. We've got a great venue (the King Edward) and are busy building a program right now that includes breakouts, workshops on concurrency, generic programming, and game development, plus entertainment in the evenings and plenty of special extras. I want to see Canadian C++ programmers well represented, and hope we attract people from further afield as well. Toronto in the summer is warm, fun, and light well into the evening.

Toronto downtown

Right now, the early bird price of $925 is in effect. After we announce the full program in April, the regular price will be $1250. So you can save a lot of money if you trust us to put together a great conference program for you (and we will!). You'll save enough to be able to pay for the speaker dinner, a conference Tshirt, and so on. And you'll let us know that we'll get the attendees we need to put on a great show.

Registering early helps us do things like make deposit payments to our vendors. We don't have a surplus-from-last-year, because this is our first year. So support from the community will really help. Why not check your schedule for the third full week of July (the conference is the 17th to 20th, and there are two-day workshops over the weekend of the 15th/16th) and arrange now to join us?

Kate

Friday, 25 February 2022 15:31:14 (Eastern Standard Time, UTC-05:00)  #    
# Monday, 21 February 2022

I have missed conferences for a long time now. I did a few online talks, but it's not the same, not at all. This year, ACCU are holding their conference as a hybrid event. This means while many will gather in Bristol for all the networking, friendship, serendipity, and other benefits of being in person, others will join us online. I think that is great: for many people traveling to a conference is not an option -- for reasons of money, physical limitations, visa restrictions, and so on -- and being able to attend online is terrific for anyone who can't travel to the conference. For me, it feels safe now to travel. I have traveled twice during the pandemic: to Singapore in Feb 2020, when it was underway but hadn't really reached Canada yet, and to Singapore again in Nov 2020 for urgent family business, complete with two 14 day quarantines and multiple tests. I'll be taking all possible precautions, and I think it's going to be safe.

The schedule has been published and my talk will be Friday afternoon. I've booked my plane tickets and hotel room, and am starting to build out the list of talks I plan to attend and people I want to meet. By the way, Guy Davidson will also be there (doing a keynote, in fact) so if you're hoping to get your copy of Beautiful C++ signed, that's a good opportunity! I think there will probably be a table for #include <C++> but even if there isn't, watch our for our shirts and say hi!

I'm going to talk on Abstraction Patterns: things I've learned to spot in code that show a missing abstraction. Unlike the sort of "business objects" that you design at the start of a greenfields project or a major expansion, you don't need deep business knowledge and a long meeting with a business analyst to design these: the code will show you what to do. Come and see what I've found and if it can help you.

Kate

Monday, 21 February 2022 17:00:30 (Eastern Standard Time, UTC-05:00)  #    
# Friday, 05 November 2021

It's true! I helped to write a book! Another book! (Do not ask me what this brings the total to, I truly do not know.) This one is about some of the C++ Core Guidelines.

Opinions vary on when it will be available: maybe the last week of 2021, maybe early 2022. You can pre-order from the publisher if you can't wait. There will be both an ebook and a paper version.

It's Guy Davidson who wrote it really; I have been a sort of editor and suggester and inspirer most of the time. If you liked my CppCon 2017 talk, 10 Core Guidelines You Need to Start Using Now, you will love this book, and not just because it's three times as many guidelines. Guy has included explanations of the 30 guidelines we chose, along with plenty of examples, the occasional diagram, and stories that put them into context and show you why it matters how you write certain constructs and why you should avoid some aspects of the language entirely. We are delighted that both Bjarne Stroustrup and Herb Sutter, who edit the Core Guidelines, reviewed the book, gave us helpful comments on the text, and wrote a foreword and an afterword for us as well.

I learned things writing this. You will learn things reading it. It may well change the way you approach code. That is one of our goals. The other is to get you trusting the guidelines and dipping into them when you have decisions to make about how to implement something. If these 30 are useful and good (and they are!) then imagine what else is waiting for you when you're ready!

 Please spread the word far and wide.

Kate

ps: the full title is quite a mouthful. We're thinking of RainbowFlower as a nickname for the book. What do you think?

Friday, 05 November 2021 13:40:38 (Eastern Standard Time, UTC-05:00)  #    
# Tuesday, 31 August 2021

This summer has featured a lot of personal busy-ness and not a lot of work things to announce. One nice thing that has happened is my renewal as an MVP.

According to various "kate bio.txt" files kicking around my hard drive :-), I was first awarded in January 2004. So it will be a while yet until the blue 20 year marker arrives. The program has changed a lot over the years, but it's still relevant to me and a great source of information from the Visual C++ team.

Kate

C++ | MVP
Tuesday, 31 August 2021 17:12:05 (Eastern Daylight Time, UTC-04:00)  #    
# Monday, 17 May 2021

In April, I did my Naming is Hard talk at ACCU 2021. I'm getting better at doing talks online and handling interactions, at least I think I am :-). The recording is now online, so if you weren't at the conference, you can watch the talk. Being there is still better, even when it's digital - being able to chat to other attendees and the presenter is always going to be better than just watching a recording.

I added the talk to my youtube playlist of conference talks, so if you like that one and want some more, take a look!

Kate

Monday, 17 May 2021 20:19:53 (Eastern Daylight Time, UTC-04:00)  #    
# Thursday, 06 August 2020

At the start of the lockdown, Pluralsight made its huge curriculum free to help those who were suddenly needing new skills to find a new job during the pandemic. I saw a huge number of views of my C++ course for those who don't already know how to program. It was ironic, because I was busy updating that course, a process that is finally complete.

Please check it out on Pluralsight. The new course is called Learn to Program with C++. (The similar-but-not-the-same Learn How to Program with C++ is the old one.) Here's what I did to the 6+ year old course:

  • redid all the demos in the latest compilers (Visual Studio Community Edition on Windows; Clang on Ubuntu and Mac)
  • added more Ubuntu and Mac versions of demos and tested EVERYTHING on all the compilers
  • moved content to slides and then just demonstrated it in the demo, instead of trying to explain concepts during long demos where there's no typing or other "demo" action
  • took a more "modern C++" approach wherever I could
  • improved the names in my sample code, trying not to have a,b,c and the like if I could
  • added some explanation of "make" and removed rather a lot of "how to get Visual Studio to be nicer" because it does that itself now

Plus I just generally tweaked samples, slides, and demos throughout the whole course based on comments I've had from new learners since the original publication. It's a better course.

People often say that C++ cannot possibly be taught as a first language, but that's wrong. Modern C++ is not that hard. This course is a little over 5 hours long and covers most of the syntax and punctuation you need, functions, classes, type safety, using templates from the STL like vector and string, and even touches on const and RAII. If you want to learn C++ for whatever reason, don't let someone else tell you that you must go and learn some "scratch" or starter language first before coming back to what you really want to learn.

If you already know one programming language, and concepts like "if" or "loop" then you don't need this course. C++ Fundamentals Including C++ 17 is for you. It covers even more syntax, punctuation, library, and design aspects of the library.

As always, if you don't have a Pluralsight subscription, you can get a ten day trial by clicking the big white square on the blue sidebar of this blog. Enjoy!

Kate

Thursday, 06 August 2020 13:50:16 (Eastern Daylight Time, UTC-04:00)  #    
# Tuesday, 09 June 2020
This year is very strange, but conferences are still happening. And they aren't all free, either. Perhaps there's a conference you'd like to go to, and being online makes it almost feasible for you, but you can't afford the conference fee? If you're a member of an under-represented group in C++, you might win a scholarship to C++ on Sea in July or CppEurope in just two weeks. (I'm speaking at C++ on Sea, so if you win, you'll hear my talk.) The scholarships are arranged by #include <C++> and the application process is pretty easy. Please let us know a little about your background: perhaps you're part of a gender minority,  a racial minority, or in some way you feel that there are less people like you in C++ than there are in the world. If you work somewhere that pays to send you to conferences, this isn't the program for you: this is for people who maybe aren't working, or who are working somewhere that sends other team members to conferences, but not you. Your application should show us that, so we can decide to send you.

More details, including a list of conferences we've sent applicants to in the past, and testimonials from recipients, are on the scholarship page.

Want to contribute? We're ok for these two conferences. But when face to face conferences start again, we'll be raising money for admissions, plane tickets, hotel rooms, and all the other costs that keep people away from the life changing and career changing benefits of conferences. Remember our site for when that is necessary.

Kate

Tuesday, 09 June 2020 18:22:16 (Eastern Daylight Time, UTC-04:00)  #    
# Thursday, 28 May 2020

Lately a lot of people have been asking me for help as they write C++ code. I’m usually happy and able to help. There are times, though, when I either cannot help, or choose not to help. I thought it might be helpful to explain some of these a little. It’s quite likely that other members of the community have a similar set of guidelines in their heads for when they do and don’t help people with code.

Warning: this is long. I think it's worth reading it all. You want a TL;DR? It’s this: if you want free mentoring and consulting from successful people, you can have it! All you need to do is ask. But if you expect your helpers to do most of the work in helping you, and to take instruction and direction from you, you’re going to get a lot less help than if you know how to be helped effectively.

The first choice is where and how you ask. People often email me, message me on LinkedIn, DM me on Twitter, DM me on the #include <C++> Discord, and so on hoping to get personalized, instant, one-on-one help from me. That’s not a good use of my time. I prefer to help in places where others will see the question and the answer. That helps more people. It also enables more people to help – so it produces better advice as well as helping those people learn and grow. Often, I learn from the times when other people chime in. So I encourage you to post on StackOverflow (if you have the sort of just-one-question, just-one-right-answer problem that fits there), or on the #include <C++> Discord, or some other public place where a number of people can see the question and the answer over time.

The rest of the issues have to do with how much work the person expects me to do, or how much they save me. Think about how you ask the very first thing you ask. Compare “here is a zip of all the files in my project can you tell me what’s wrong with it?” to “here is a link to an online compiler (Godbolt, wandbox, etc) showing a compiler error on line 43 that I don’t understand. Can you tell me how to fix that error?” Expecting someone to install things, trawl through multiple files, guess your question, and then solve your problem and explain it all to you is really too much. At least tell people what your problem is! Often people ask for help saying something like “it’s not working” or “what’s wrong with this?” and I don’t even know if it’s a compiler error or a runtime error or running fine but calculating the wrong answer. So before you post on the discord, for example, try to have a single crisp question, not just “help, it’s not working.”

  • Show us your code, and your errors. And not as screenshots! You can copy the code into an online compiler like Godbolt or Wandbox, or if it’s less than 20 lines or so, paste it into the chat window – but please learn how to format it as code when you do that. Copy and paste the errors as text. That makes them much easier to read, and lets us copy and paste parts of them while explaining things to you. If you can’t show your real code because of how big it is or because it’s work-related, create a tiny example that shows the same problem and show us that. Stack Overflow has some tips on how to do that.  Whatever you do, do not free-type some code into the chat window that you think is the same as your problem, and then whenever people point out missing semi colons or undeclared variables, reply “oh yeah, that’s not really my code it’s just something I typed to give you the general idea.” Compilers (and runtimes) are picky and asking for help with something that’s vaguely like your real code (but not really) is pointless.

Now let’s assume you manage to get a conversation going with someone who is trying to help you. They solved that compiler error, for example, but now you have another one. As part of this process, I often make suggestions to people that they reject. I think they believe the suggestions are to make things easier for themselves in the long run, because they say things like “I can do that once it’s working.” I then have to spend a lot of effort explaining that I want them to do these things so that I can help them get it working. These suggestions include:

  • Write good variable (and function) names. If your variables are all called i, n, c, r, s, and so on – I don’t know what they represent. If I ask you to change those to words like next, rate, total, and so on, or to words you think of yourself, that’s because I can’t understand your code (I don’t know the problem you’re trying to solve) without some help. Good names aren’t a someday thing that you paint over working code once it’s all good. They are how you make code other people can read. And you’re asking me to read this code. Make it readable.
  • Use a debugger. When I ask “have you looked in the debugger to see the value of a before the loop?” an answer of “I don’t know how to use the debugger and I don’t have time to learn that today” is a great way to end our conversation. Real programmers use the debugger. We don’t have some magical compiler-simulator in our heads that can read code and tell you if it compiles or not, and we don’t have a magical runtime-simulator either. Sure, maybe I can tell at a glance that a is 0 before the loop and that’s why it’s not working, but in that case I would tell you so. It’s more likely that I want you to quickly check and see if it’s 0 or not. When you refuse to debug, you’re making it so much harder to help you. You need to learn to use whatever debugger is available to you, and you will probably save enough time today to make up for the time it takes to learn it.
  • Add some tests. You don’t have to go learn a whole unit testing framework. But if you’re writing a function to do whatever, work out by hand what it does for simple values, and write a test harness that passes it those simple values. Then you can debug the test harness and see what the function returns and confirm whether or not it works for simple values. Whether you’re reversing a string in place, calculating the Fibonacci sequence, calculating sums of things, whatever, you should be able to think up simple test cases and test your code with them. And eventually, you should be writing tests as you write your code. It’s a good habit you can build now.
  • Break up big things. You don’t have to embrace full OO or write functional programs, but don’t give me 1000 lines of code and ask me to load it into my head. Write some functions. Heck, throw in some comments and some blank lines. Show the structure of your code so it’s not a wall of text.
Some other good behaviours that will take you a long way:

  • Try the substitutions people tell you to try. A lot of times, people who are having a hard time don’t want to learn a new thing. I run into that situation all the time myself. I’m already frustrated and I’ve spent longer than I meant to and I can’t understand any of it, I don’t want you to tell me to go learn yet another thing right now. I have gained some wisdom over the years though, and it includes this: sometimes jettisoning all that half-understood not-really-working mess and doing something simpler is the best way forward. If someone tells you that vector would be better here, and offers you a few lines of code to use, just digging in your heels and refusing to try it isn’t going to lead you into learning. If you’ve got a problem because you’re trying to manage memory yourself by hand but you forgot about copying and so on, then using a smart pointer, or dropping the pointers altogether and using an object on the stack, is going to make a whole pile of work just fall away. The person advising you to try this knows how much effort it will save. You don’t, that’s why you came for help. It’s really frustrating to see a beginner insist on doing something the hard way (for no benefit), do it wrong, and refuse to accept any help other than “here is the precise and exact code to do that thing the hard way.” I don’t want to do things the hard way any more: why would I type out all the code for you?
  • Try things that don’t matter to you, if the person who is helping you tells you that your code is harder to read the way you have it. Things like initializing member variables in a constructor with the : syntax, not between the braces, or adding some using statements – these may not matter to you, but making things too hard for a busy helper may mean that helper is too busy to help today. Or ever. I don’t want to teach you bad habits, I don’t want to teach you to “pretty things up” only once it’s working, and I don’t want to exhaust myself reading difficult code to spare you the trouble of doing the right thing. Also, when a person asks for advice but never takes any of it because they’re sure it’s not actually relevant to their problem, eventually the advice-giver will stop giving it. It’s pointless.
  • Write your own code. If I tell you “the problem is that you’re not initializing x” don’t ask me to edit your code for you or paste in the new version of the function or whatever. You need to understand what you’re doing and that comes from writing the code yourself. If you don’t understand how to fix a problem that someone has told you about, ask them “how do I fix that?” If you can’t understand their answer, say “I don’t know what [whatever] is, can you explain it or show me?” Don’t just ask “what would that line of code look like?” That feels like you’re asking me to even do the typing for you.
  • Work with whoever is talking to you. Maybe when you first ask, one person has a couple of thoughts, and those are good, but while you’re changing your code to see if that works, someone else chimes in. That’s great. It’s a group chat. Don’t tell them that you’re working with the first person or anything like that to reject their help. Consider all the suggestions you get. If you’re talking to someone and then they stop, that’s cool too. Many people pop into chat for 5 or 10 minutes waiting for a conference call to start, or while they’re eating lunch, and don’t stay long. People get called away from their keyboards. Don’t start pinging the person trying to bring them back or ask if they have any more thoughts or saying you’re still stuck. You can tell the room or channel as a whole that you’re still stuck. Maybe someone else will have some ideas. Your problem may end up solved over an hour or so with three different people. That’s a win!

I know, that’s a lot of advice. Thing is, you can get a lot of help from strangers on the internet, if you ask the right way. If you ask the wrong way, most people will just shrug and say “looks like you have a problem” and move along. They won’t even tell you why they’re not helping you! To get the marvelous free help, and to truly join the community, you have to put in a little effort. Trust me, it’s worth it!

Kate

Thursday, 28 May 2020 16:26:40 (Eastern Daylight Time, UTC-04:00)  #    
# Wednesday, 08 January 2020

Every once in a while, I make a big change in how I plan and manage my speaking engagements. Early in the last decade, I decided to speak only at conferences I would happily pay to attend, and that improved my life dramatically. Instead of trying to justify a week away from home and the office in which I would try to keep up on emails from a hotel room or a hallway couch, while surrounded by people who didn't care about the stuff I cared about, I started looking forward to a week of learning and growing, of coming home knowing more than when I left, and of meeting my heroes and getting to see my friends.

While this was an important change, it was only a change in my decision criteria, and not in my overall process of deciding where to speak. I would get an email, or see a tweet, or otherwise become aware that a conference was going to happen, and then I would decide, on a case-by-case basis, if I wanted to submit to that conference. Sometimes I would have to decline because I had already submitted to another one at roughly the same time, without realizing the overlap. In mid 2019, I changed that. I listed out all the C++ conferences I knew of, and roughly when they happened. Then my partner and I went through the list, noting when various family events are happening, when we want to go on vacation, and other "big rocks" that conferences have to fit around. We talked about how many conferences I wanted to speak at, and whittled down the list to that many.

Now, as each conference opens a Call for Papers, if it's on my list, I submit, and if it's not, I don't. Of course, my talks aren't always accepted. I set myself a goal to speak at two non-C++ conferences in 2020. I was invited to one, but after I agreed they changed their dates and that conflicted with something else I had accepted. I submitted to another and they declined my talk. But one has accepted, and I have accepted another invitation, so I will be speaking at two non-C++ conferences for sure.

Expect to see me at:

  • January, Montreal: CUSEC 2020 (Canadian University Software Engineering Conference) - keynote (and a Meetup while I'm in town, come ask about technical speaking)
  • March, Bristol, UK: ACCU - Naming Is Hard, Let's Do Better
  • May, London, UK: SDD - Naming and Emotional Code
I have submitted to some for June and onwards, but haven't heard, so I'm not mentioning them, nor the ones I've decided not to submit to. That's not fair to anyone. I might do as many as 7 conferences by the time the year is over, and that's a lot. Plus user group talks whenever I can.

So is there any point inviting me to speak at your conference? Well, sure. It might match up with something else (at least one conference I added to my list because I could combine it with another trip that was already planned) or be so compelling that I will find a way to fit it in. Or it might end up on my list for next year -- I like this advance planning so I'm going to keep doing it. As always, remember that I do have requirements for any speaking engagement, so if you invite me, please let me know you've read that and meet them.

If you're at any conference I am speaking at, please do find me and say hi! It's one of the most important parts of any conference for me.

Kate
Wednesday, 08 January 2020 13:25:46 (Eastern Standard Time, UTC-05:00)  #    
# Thursday, 28 November 2019

I'm thrilled to announce my latest Pluralsight course:

Here are the modules:

  • Course Overview
  • Modern C++
  • Standard Library Containers
  • Lambdas
  • Standard Library Algorithms
  • Move Semantics
  • Exceptions
The course picks up where C++ Fundamentals Including C++ 17 leaves off and puts you in a good place to take Beautiful C++: STL Algorithms or other C++ courses. As always, if you want a free 10 day trial, click the large white box on the side of this blog page.

Hope you enjoy it!

Kate

Thursday, 28 November 2019 10:22:03 (Eastern Standard Time, UTC-05:00)  #    
# Thursday, 25 July 2019
CppCon is approaching again and my calendar is FULL. The schedule may change and there are things still to be added, but the current plan is:
  • On Sunday, I am doing a preconference workshop (you can still get a spot) with John Lakos and Andrei Alexandrescu
  • After the precon I hope to relax at the TShirt dinner. Pack a Tshirt that says C++ (or bring your badge, or a piece of paper on which you wrote C++ yourself) and choose a restaurant from the list that should be published by the time we all get to Colorado. When you arrive, ask where the other C++ Tshirt people are, and make some new friends! I'll be tweeting my plans just before I head out.
  • Then it's back to the shiny new venue for the Registration Reception. Even if you're on East Coast time like me, make an appearance, see some friends or some of your heroes, there will probably be treats, and you'll be all set for the morning. Knowing the venue a bit is going to make you sleep better, and having your badge already will let you sleep longer.
  • Monday I will be attending talks and spending time at the exhibitor table for #include<C++>, an organization working to make the C++ community more welcoming and inclusive. Come by and get a sticker! Buy a shirt! And you know, attending talks and hanging at the #include table is what I'll be doing all 5 days.
  • If I manage to stay awake, I'll go to The Committee Fireside Chat after dinner. If there is something you always wanted to ask the people who create the C++ standard, here's where that happens.
  • Tuesday and Wednesday it's talks, talks, talks! I predict I will go back to my room for a nap at least once. It's a strategic choice that lets you actually experience the post-nap talks instead of drowsing through them and needing to watch the recording in the end.
  • Wednesday night is the #include<C++> dinner and panel! You can register for this on Eventbrite as part of registering for the conference. I'll moderate a discussion about some of what we've achieved in just two years, and what some of us would like to see next.
  • Afterwards it's Lightning Talks. Everyone loves the Lightning Talks, they're always fantastic. I will try my best to stay up for them.
  • If I can, I'll come super early on Thursday and Friday for recordings of CppChat. And stay all day for talks, of course.
  • Thursday night is the Speaker's Dinner. And there's a planning meeting after that. But I might need an early night, because...
  • Friday morning I have my one breakout session: Naming is Hard: Let's Do Better. And like last year, a lot of really good content is on Friday. Don't even think of leaving early. Fly home Saturday morning, you won't regret it.

See why I call CppCon an intense conference? 12 or 13 hours a day, every day. And no time for sightseeing! But oh my goodness the things I will learn, the people I will meet, and the fun I will have. See you there!

Kate

Thursday, 25 July 2019 20:02:09 (Eastern Daylight Time, UTC-04:00)  #    
# Sunday, 14 July 2019

On July 14th, 2017, Guy Davidson tweeted what he thought was a passing pun:

But when I saw the tweet, I thought, yeah, why isn’t there?

And in that moment, #include was born. We got together at CppCon and again at Meeting C++ where Guy did a lightning talk on inclusion. We were off and running. At that time we had a channel on the cpplang slack, but that didn’t work out well: a change of owners of the slack to someone who was less interested in preventing harassment and abuse, coupled with slack’s fundamental design tenet that people having trouble with bad behavior on a slack channel can always go to their mutual boss (which doesn’t work on public servers that bring strangers together) resulted in #include being pretty much driven off the slack and forming our own server elsewhere, on discord.

The original channels on the discord were all about the work of running #include. How can we get conferences to have a code of conduct? How can we help employers to write job ads that will attract all kinds of applicants, not just people who closely resemble the ones they already have? But we couldn’t stop talking about C++ so we added a channel for that, and then another for something else technical, and another, … and things really started to grow.

By April 2018 we were about a dozen organizers and very few people who weren’t organizers. But now we have over 2300 members and over 70 channels. People are getting help with C++ problems they face, recruiting helpers for projects, getting advice about speaking or attending conferences, and much more.

Our original goals were pretty low key really:

  • To encourage under-represented people to speak, to apply for jobs, to stay in this industry
  • To get conferences to have a code of conduct (we hadn’t even thought about enforcement)
  • To get employers to value diversity somewhat, and to provide some resources to conferences and employers

We thought it would be nice to have some stickers and Tshirts made, and have a table at conferences where we would urge people to join our discord and try to make our industry more welcoming. Well, that worked! We’ve had tables at major C++ conferences the world over and you can be sure to find a smiling person to talk to, whether they’re officially “working the table” or not.

We’ve seen these shirts at conferences and user groups around the world, at C++ standards meetings, and on a lot of speakers and influencers. We think they send a strong message to attendees that the world is full of friendly and welcoming people who will not exclude you because you are different in some way. If you want one, we have a US-based store and a European store, or you can find us at a conference near you. We try to diffuse the stickers around the world – if you run a user group and are going to be at a conference, get in touch with one of us (the conference channel on our discord would be the best place) to see if you can get a handful of stickers to take home and give out at the group.

Last year at about this time, someone asked if we were interested in partnering with the Women in Tech Fund to get women to CppCon. We sure were! The conference donated tickets at below their catering costs, and we raised $4000 to cover travel and accommodation for our scholarship winners. It was a big success and we keep doing it at conference after conference. Right now we’re raising for CppCon again – this year not just women, but anyone who is under-represented in the C++ community, can apply. If your employer isn’t sending you, why not see if we can?

This is a lot more than we had originally planned to do. A number of us started insisting on a Code of Conduct before agreeing to submit talks to a conference, and suddenly it seems all the C++ conference have good Codes of Conduct now, with real enforcement too. There’s a best practice gaining popularity of introducing the Code of Conduct team at the start of the conference too. We started handing out pronoun stickers to put on badges, and not only do lots of people take them (please take one even if your gender is obvious, it makes life easier for those whose isn’t) but some conferences have even started including a pronouns field on badges. We’ve built this amazing friendly community on the discord where people are learning and growing and becoming leaders in the C++ community at large. We’ve seen talks and demos and forms and web sites changed after we pointed out that a particular wording or example wasn’t welcoming and inclusive. People generally want to be welcoming and inclusive, they’re just not sure how to do it, so our strategy of providing really specific unsolicited advice has worked well. And probably the thing I’m most proud of is the people – actual breathing humans – we have sent to conferences. Going to a conference is career-changing, especially when you’re relatively inexperienced. You can meet your heroes, ask questions, learn a ton, make connections, get advice, and re-energize your connection to this industry and your job. Already I am seeing former scholarship winners on stage, donating to the current fundraiser, and finding their voices on Twitter and our discord. It’s amazing. I want to pinch myself some days.

The people who form the core of #include support and encourage each other. Many of us have given talks we would never have otherwise given. I won’t speak for her, but I expect the jaw dropping and enlightening Deconstructing Privilege talk that Patricia Aas has been giving could be one of them. If you haven’t watched it, you should. A lot of what we’re doing at #include is “privilege lending” – using our positions to ask for things to make people with less privilege feel welcome. We’re also teaching people who’ve been spared some hardships about the realities some other people face. Often this is all it takes for things to change quite quickly.

We’ve also done a lot of lightning talks and internal corporate presentations about #include and what we’re trying to do, but it seems like none of them ever get recorded and uploaded. Rest assured, we’re still working hard to move the needle when it comes to inclusion in the C++ community.

What’s next? Well, we’d love to start seeing child care available at C++ conferences. We’d love to see other developer communities doing some of what we’re doing, and we’re going to keep learning from other developer communities too. We’re seeing things like quiet rooms, pronouns on conference badges, and food labelling becoming the norm. And we’d love to get suggestions from anyone who feels excluded from conferences, training, job opportunities, and online communities. Join the discord and join the conversation, or find us on Twitter. See you there!

Kate

Sunday, 14 July 2019 06:46:26 (Eastern Daylight Time, UTC-04:00)  #    
# Friday, 28 June 2019

I just published a small course on Pluralsight called Advanced Debugging with Visual Studio 2019. It covers IntelliTrace and Code Map, two features that are only in the Enterprise Edition of Visual Studio. Many people don't know about them, so I put together a quick introduction.

Here are some of my other current courses:

  • Visual Studio 2019 Getting Started - what you need as a new user of Visual Studio to start using it. There are a variety of other Visual Studio courses, and pretty much all of the material from my 2017 one is still applicable, so don't take just this one or you'll be missing some really powerful techniques.
  • Beautiful C++: Updating Legacy Code - I really enjoyed writing this course and if you maintain old C++ code, I think it will make your life a lot easier. It discusses both specific patterns to update (and why) and overall strategic approaches (not mechanically replacing every incidence of one pattern with a newer pattern.)
  • C++ Fundamentals Including C++ 17 - this is the go-to course for developers who want to learn C++ today. Whether you never did any, or did some a decade or two ago, this course will cover the syntax, library, and best practices you need. If you've never programmed in any language, try Learn How to Program with C++ instead.
  • Using Stack Overflow and Other Stack Exchange Sites - we all go to Stack Overflow when we're stuck. But a lot of us are bad at it, because it doesn't work like other sites. Take a little time to improve this skill and you'll get better and faster answers. You might even become one of those high-rep users who others admire!
  • Beautiful C++: STL Algorithms - Stop writing raw loops and you will get more readable code with less effort. The library has so much waiting for you and this course will help you make sense of it all.
There are more, but if you take all of these, you'll be in a strong place as a C++ developer. (BTW, only the Visual Studio courses require Visual Studio. All the others work with any development environment you prefer.)

Kate

Friday, 28 June 2019 09:39:32 (Eastern Daylight Time, UTC-04:00)  #    
# Monday, 06 May 2019

In early April I was lucky enough to go to Bristol in the UK for the annual ACCU conference. This has been an aspirational conference for me, one I attended before speaking at and am always delighted to attend. This year I was invited to keynote, and it turned out to be the closing keynote, which meant I was not done with all my talks until the conference was over! Nevertheless I enjoyed the week tremendously.

I flew to England overnight Saturday night. People often ask me how, given the fatigue issues I have left over from the whole surviving incurable cancer thing, I am able to travel. One reason is that when I travel, I only travel on travel days. I don’t try to work at the airport, on the plane, etc. I read a book or listen to music or just relax. On overnight flights, I sleep. I also schedule a few days to adjust to the time zone without having to think hard or meet important deadlines, like finishing my talk. On this trip, I spent two days visiting Cardiff, which is actually where I was born, with my sister who is planning to move there. It was marvelous fun watching a family explore and discover their new home town, and going to places I have seen on TV or in pictures.

Tuesday I did a private corporate talk about #include<C++> and diversity issues. It was very well received and I might offer it to other companies as a result. I always buy a train pass when I go to the UK and it got a good workout on this occasion. Back in Bristol I was able to relax and know I was ready for the conference.

After a lovely opening address by Russel, we had an illuminating keynote from Angela Sasse.  Security can’t be left until the end or handled by a separate group who fight the developers. Afterwards I took some time to meet up with more friends and spend some time at the #include table. After lunch, a very good talk from Jonathan Boccara on reading unfamiliar code.  I loved the map analogy and the way he showed using a call stack to increase your mapped area. Then a workshop from Gail Ollis on Helping Developers to Help Each Other which really brought home to me once again how important tactile artifacts – things you can pick up, put down, wave around, put next to each other and so on – can be to encourage open and complete communication.  The recording stops when the hands on part starts – just one of those things you can only get by attending in person. The talks wrapped up with Lightning Talks and I did one – my first time doing so at ACCU. I was not able to stay up for the evening reception beyond a quick “hey! Great to see you!” to a handful of people. There were plenty of talks I couldn’t get to – recordings for me to watch later!

Day 2 started with a Herb Sutter keynote.   I’ve read the paper but was really happy to hear it as a talk, and to hear the motivations behind enabling more people to use the whole language.  Then I needed some down time before my talk right after lunch. I gave an updated version of “Nothing” and as always at ACCU got some great questions that will go into the next version of the talk – or some other one.  Then I kept to tradition by doing the Pub Quiz, entertaining as always for the don’t-write-this-at-work code and marveling at how some folks know a lot of dark corners! Another round of lightning talks and an early night, meaning I couldn’t attend the Bristol Girl Geeks dinner as I had planned.

The Day 3 keynote was low on code and high on insight as Paul Grenyer talked about growing a community while dealing with the ups and downs of life in general.  Then to a fascinating talk by Dom Davis about communicating, with significant meta content that I really enjoyed.  I spent the lunch break at the #include table, and then dove into a variety of little talks – 15 and 20 minute ones. I was starting to tire and didn’t pay as much attention as I should have, but let me recommend Alex Chan’s reminder that the tech we build can hurt people when it’s being used as designed.  I took a break to be ready for the Conference Dinner where I was able to catch up with old friends and meet a few new ones.

Finally Day 4. I started with Kevlin Henney and a talk with a similar title to my “Nothing” but very different content.  Another break, another lunch at the #include table, and then some down time before my closing keynote. I updated the beginning of this talk since the C++ on Sea keynote, and I think this improves it. More great questions after and I think more material to work in there somehow. Then the close of the conference, a certain amount of hanging around not wanting it to end, and up to my room for another early night and to get ready to go.

Sunday all I did was take the train to the airport, fly home (sleeping a little on the plane) and drive home. A lot to process, as always after ACCU. And when I got home, a lot to catch up on, which is why this has taken a few weeks to write up!

Kate

Monday, 06 May 2019 06:57:37 (Eastern Daylight Time, UTC-04:00)  #    
# Tuesday, 20 November 2018

My latest Pluralsight course is live!

I start by talking about strategy - what parts to update, what general approach to take, and so on. Then I present a number of specific tactics, like using the preprocessor less and the compiler more, actually using C++ instead of just C, and using C++ features that were added in C++ 11, C++ 14, and C++ 17. I show you code examples for the changes I am suggesting, and explain why specific changes produce code that is more readable, understandable, and maintainable.

As always, if you don't already have a Pluralsight subscription, feel free to click the large white box in the margin and start a free trial. I hope you like the course, and tell your friends about it too!

Kate

Tuesday, 20 November 2018 11:39:33 (Eastern Standard Time, UTC-05:00)  #    
# Saturday, 15 September 2018
Oh my, I am doing a LOT at CppCon. Here's a list:
  • On Sunday, I am doing a preconference workshop (I believe it's sold out now) with Scott Meyers and Andrei Alexandrescu
  • After the precon I will relax at the TShirt dinner. Pack a Tshirt that says C++ (or bring your badge, or a piece of paper on which you wrote C++ yourself) and choose a restaurant from the list on that page. When you arrive, ask where the other C++ Tshirt people are, and make some new friends! I'll be tweeting my plans just before I head out.
  • Then it's back to the Meydenbauer for the Registration Reception. Even if you're on East Coast time like me, make an appearance, see some friends or some of your heroes, there will probably be cake, and you'll be all set for the morning. Knowing the venue a bit is going to make you sleep better, and having your badge already will let you sleep longer.
  • Monday I will be attending talks and working a shift at the exhibitor table for #include<C++>, an organization working to make the C++ community more welcoming and inclusive. Come by and get a sticker! Buy a shirt!
  • If I manage to stay awake, I'll go to Grill the Committee after dinner.
  • Tuesday I have a session called What Do We Mean When We Say Nothing At All? and it's at 9 sharp - but you'll have been in the building for Open Content at 8, won't you? Grab a coffee and come find out how nothing can say a lot.
  • Tuesday night is the #include<C++> dinner and panel! Buy your ticket now, everyone is welcome. You do not need to be a CppCon attendee.
  • Then it's back to the Meydenbauer after dinner for Lightning Talks. Everyone loves the Lightning Talks, they're always fantastic.
  • Wednesday I'll arrive early because there are 3 sessions I want to watch at 9 (thankfully all the talks are recorded)
  • My keynote is at 10. I'm a bit nervous, but I'm mostly looking forward to it.
  • Right after that, I have a panel about interop with managed code.
  • Then I'm going to relax and listen to talks for the rest of the day, and go to the Planners Dinner. And more Lightning Talks afterwards.
  • Thursday I have no talks to give, shifts to work, or panels to be on. I'll be a free attendee ... until the Speaker's Dinner. And there's a planning meeting after that.
  • Friday is JAMMED with talks. And if you live locally, come on down and attend some because it's the open day. I have marked 11 talks in three time slots as ones I want to attend. Not sure that's going to work, exactly.
See why I call CppCon an intense conference? 12 or 13 hours a day, every day. But oh my goodness the things I will learn, the people I will meet, and the fun I will have. See you there!

Kate

Saturday, 15 September 2018 12:26:26 (Eastern Daylight Time, UTC-04:00)  #    
# Monday, 03 September 2018

Next year, I'll be keynoting a new C++ conference, C++ on Sea. I'm really looking forward to it. A little while ago, they ran a "tweet why you want to go" contest for a free ticket, and said that if the winner already had a ticket, the conference would help the winner give away the ticket.

Can you guess where this is going? I won the ticket. I already have one, so you can win mine. Here's what you need to do:

  • Choose a way to "give back" to your community before, during and after attending. This might be blogging, tweeting, hosting a local meetup where you talk about what you saw and recommend specific talks for others to watch later, or even activities at the conference like giving a lightning talk.
  • Gather supporting links - to your blog, your repo, your YouTube Channel, the meetup site, and so on
  • If your plan won't fit in a tweet, put it somewhere that it will fit. Include lots of links - I want people to find your blog, channel, meetup etc even if you don't win
  • Tweet me (@gregcons) with your plan or a link to it. I will retweet. Focus on what you will give if you are able to attend the conference.(It's not that I don't care whether you are deserving or can't afford to go or whatever, I do, but I am going to focus on how you will share your good fortune with others.)
  • If you're not on Twitter, post on my public Facebook page. You can't just email me because the idea is to promote those links to blogs, channels, meetups, and suchlike.

That's it! I'll choose someone, probably by filtering to everyone who is offering to do something generous and then randomly choosing one, but I reserve the right to choose the single person who comes up with the most amazing plan. I'll tell the conference that you get my ticket.

Fine print: this is just admission to the conference. Not travel or hotel. Not paid time off work. You'll need to cover that yourself. I suggest that telling your boss you won the ticket because of your community involvement might be quite helpful as far as that is concerned :-). And while I can't force you to keep your promise, I will remember if you do, and that will probably be a good thing for you over and above the rewards of doing those good things for the community.

Good Luck!

Kate

Monday, 03 September 2018 12:32:39 (Eastern Daylight Time, UTC-04:00)  #    
# Saturday, 09 June 2018

Here's what's coming up over the next few quarters:

  • August 27-30: NDC Techtown (two talks)
  • Sept 23-29: CppCon (preconference day; main conference talks not yet announced)
  • Oct 18th-19th: Pacific++ (two talks)
    • Submissions are still open so if you want to join me in Sydney as a presenter, get on that!
  • Nov 15th-17th: Meeting C++ - I will not be speaking here (I just can't fit it in), but I want you to know it's happening
  • Feb 4th-6th 2019: C++ on Sea (keynote at this brand new conference)
  • April 2019 - ACCU (nothing announced yet, but I plan to be there)

I consider it an absolutely marvelous problem that there are so many C++ conferences I can't go to them all! There are a number of smaller conferences that draw primarily from one country or region, and more meetups than I can keep track of. I'm open to talking at a meetup if I happen to be traveling to a city for business anyway, but I don't think I can get up above 5 or 6 conferences a year, especially if some of them involve keynotes, plenary sessions, or workshop days. It's a lot of work!

Hope I get to see plenty of people in these various places,

Kate

Saturday, 09 June 2018 16:24:48 (Eastern Daylight Time, UTC-04:00)  #    
# Tuesday, 08 May 2018

I had a very busy March and April, with travel and with preparing for those trips. So I forgot to mention that my latest Pluralsight course is now live! It's called C++ Fundamentals Including C++ 17 and it's an update of my C++ Fundamentals course. Here's what I changed:

  • I made most of the demos a lot smaller, by breaking them into pieces or by putting some of the material on slides instead
  • I made the slides less text-heavy, again mostly by splitting them up
  • I added diagrams to explain things that needed them
  • I added some C++ 14 and 17 content
  • I switched to a consistent "const after" style (aka east const)
  • I double checked every line of code for good style and consistency

I'm really pleased with the result. If you've already taken C++ Fundamentals you probably don't need to take it again, but I hope you'll recommend to others that they take the new one. I think it makes learning C++ less daunting than some other approaches do.

Kate

ps: don't have a Pluralsight subscription? There's a link over there ------->  for a free trial.

Tuesday, 08 May 2018 17:27:06 (Eastern Daylight Time, UTC-04:00)  #    
# Tuesday, 13 February 2018

The schedule for ACCU has now been released, and the Feb 20th early bird registration deadline is approaching, so I thought it was a good idea to mention my session there.

Simplicity: not just for beginners

Many people say that simple code is better code, but fewer put it into practice. In this talk I’ll spend a little time on why simpler is better, and why we resist simplicity. Then I’ll provide some specific approaches that are likely to make your code simpler, and discuss what you need to know and do in order to consistently write simpler code and reap the benefits of that simplicity. Code samples will be in C++ and some material will be C++-specific.

I'll be joined by dozens of amazing speakers and the topics will be wide-ranging. It's not all C++, and I'm looking forward to a little mind-expanding from some session I didn't expect to do so. The pub quiz and lightning talks will also be good fun. April 11th to 14th in Bristol - will I see you there?

Kate

Tuesday, 13 February 2018 19:07:13 (Eastern Standard Time, UTC-05:00)  #    
# Thursday, 19 October 2017
In 2016 I didn't speak at conferences because I was ill. I really enjoyed getting "back in harness" at CppCon this year (my Guidelines talk has been uploaded already, if you missed it) and I am happily looking forward to my next two conferences.

In Berlin I will deliver one of the keynotes for Meeting C++. It will be one of those opinionated talks with stories in it, plus code of course. I love giving those kinds of talks and they're typically well-received, so I am expecting to have a great time. This will be my first time at Meeting C++ and I know it will be a great conference.

The next week, I will be at the 2017 C++ and System Software Summit in Beijing. 8 tracks and over 500 attendees; this is a big conference. I've never been to Asia before, so I am very excited to meet a lot of new people (and some I've known for a while, the speaker circuit is like that) as well as seeing new places and experiencing a new conference.

I'm still thinking about what I will submit to ACCU for the spring. I prefer to do a new talk for each conference or at least to update existing talks dramatically. I will need to make up my mind before I leave for China!

Kate

Thursday, 19 October 2017 08:08:43 (Eastern Daylight Time, UTC-04:00)  #    
# Saturday, 23 September 2017

This week, I’ve been in Salt Lake City for the Pluralsight Author Summit and the first-ever PluralsightLIVE event. What a great time! This is my first time on a plane in over two years, and it is terrific to be out traveling again.

Pluralsight takes great care of its authors and that started with a lovely box of goodies in my room the first night.

Tuesday we all got together to hear about the past growth and future vision for Pluralsight, and to get a sneak peek at some things that would be announced later in the week. And of course, for Aaron to get a selfie with the authors!

In the afternoon, we had open sessions where we learned from some Pluralsight staff we don’t normally get to meet, and from each other. What makes you a great author in the eyes of your editor and the other people who help to get your material published and live? How can you get your courses recorded faster? Geeky talk about microphones and other tools of our trade, of promo videos on YouTube, and so many other things we all really wanted to talk about.

PluralsightLIVE itself started Tuesday night with a reception in the partner pavilion and an evening event I wasn’t able to stay up for.

That's my shirt being printed on the spot for me!

That's the very popular candy dispenser array.

I’ve been to a LOT of conferences and most of them look pretty generic. Here there was just so much effort showing: the fun activities like huge Jenga, Connect 4, and similar games, the couches everywhere (with power and USB ports so you could charge whatever you needed to charge), the large easy-to-spot-and-read signage, and more. It was clear the organizers were really caring about the wellbeing and happiness of all the attendees.

There were a lot of keynotes. Wednesday and Thursday both had keynotes the whole morning, and Thursday also had an afternoon keynote. These were entertaining, inspirational, educational, and really worth my time. I was especially looking forward to Joel Spolsky on Wednesday morning and he didn’t disappoint. He was funny and open. He also announced that Stack Exchange users will all get 60 free days of Pluralsight training. I hope some of them use it to take my Stack Exchange course! Then he liked my tweet afterwards so that was fun.

(If you want to take one of my courses, and don't have a subscription, there's a grey rectangle over the right that says Author: click it and you can get a ten-day free trial.)

When I wasn’t in keynotes, I was meeting other attendees and Pluralsight authors. Many of the authors are friends I haven’t seen in far too long, so it was tough to tear myself away, but I forced myself, because meeting learners is what this week was about for me. It was especially helpful to talk to managers and team leaders who want to know how their people are using their subscriptions. The Pluralsight IQ announcement [link] was very well received both by learners who wanted to show off their scores, and managers who wanted to track a team’s progress.

I took the C++ assessment, but I zipped through it a little too quickly and some questions needed more thought than I gave them. Still, I did ok:

After I tweeted my results, a whole pile of my C++ tribe also got their scores, and I even outscored a few! (Plus, I think they found a few bugs in the assessment – I’m going to get them fixed.)

The afternoon keynotes on Thursday wrapped up with Michelle Obama talking about diversity, education, children, and much more. I hadn’t heard her speak before other than sound bites on the news, and I was really impressed. She was warm and funny and willing to show irritation or frustration as well as the polished pleasantness I was expecting.

Next year’s dates have already been announced: the week of August 26th, 2018. I’m planning to be there. If you take Pluralsight courses (and come on, you should be taking Pluralsight courses) then consider it too. There was a lot of good content in a wonderful atmosphere, a chance to meet all kinds of interesting people, and a few days to put learning and growing front and centre – time well spent for me.

Kate

Saturday, 23 September 2017 09:50:51 (Eastern Daylight Time, UTC-04:00)  #    
# Monday, 11 September 2017

This year's innovation at CppCon is a Meet the Speakers Dinner Thursday night. It's pretty expensive ($100) because the venue is charging a lot for it, but here's your chance to relax over dinner with many of the speakers from CppCon. If you've registered for the conference but haven't bought a dinner ticket yet, please do! We want to meet attendees and this is a great way to do it. I've been an attendee at speaker dinners at other conferences and I have to say it's always been a highlight of the conference for me. Career advice from Bjarne himself over (excellent) dessert? Yes please!

I can't guarantee you Bjarne (or even me) but you will be asked if there's someone you want to sit with, and the organizers will do their best to accommodate you.

Monday, 11 September 2017 16:01:06 (Eastern Daylight Time, UTC-04:00)  #    
# Friday, 21 July 2017

I am happy to announce that my submission to CppCon has been accepted!

10 Core Guidelines You Need to Start Using Now

The C++ Core Guidelines were announced at CppCon 2015, yet some developers have still never heard of them. It's time to see what they have to offer for you, no matter how much C++ experience you have. You don't need to read and learn the whole thing: in this talk I am pulling out some highlights of the Guidelines to show you why you should be using these selected guidelines. For each one I'll show some examples, and discuss the benefit of adopting them for new code or going back into old code to make a change.

Beginners who find the sheer size of the language and library daunting should be able to rely on the Guidelines to help make sane choices when there are many ways to do things. Experienced C++ developers may need to leave some of their habits behind. Developers along this spectrum could benefit from seeing what the Guidelines have to offer, yet the guidelines themselves are just too big to absorb all at once. My examples will be chosen to be beginner-friendly and the focus will be on what's in it for you: faster code, less bugs, and other tangible benefits.

I am so looking forward to seeing "my tribe" again in Bellevue this year. I'm going on the field trip too! If you haven't registered yet, get on that!

Kate

Friday, 21 July 2017 13:03:59 (Eastern Daylight Time, UTC-04:00)  #    
# Wednesday, 04 January 2017

I had to curtail my activities pretty dramatically in the second half of 2016, even in areas like mailing list participation or answering questions on StackOverflow. I was beginning to wonder if I would qualify for Visual C++ MVP again without conference talks or some of my other usual activities. No-one should ever assume they will be awarded; the program is always changing and our lives are always changing, so anyone can find themselves out of sync with the requirements of a program. However, I'm happy to learn that I have been renewed for 2017 and will continue to be part of this active community.

Looking forward to a terrific 2017,

Kate

Wednesday, 04 January 2017 12:08:17 (Eastern Standard Time, UTC-05:00)  #    
# Friday, 16 September 2016
It has been a very busy summer for me. Mostly it's been great, with family visits from all over the world and the wedding of my oldest child. But there have been some challenges, too. Without going into details, I've had to cancel plans to speak at (and even attend) CppCon. This is really sad - CppCon was the largest C++ conference ever when it started in 2014, and has grown remarkably ever since. It's a place where I learn new things, make new friends and contacts, and meet old friends for a wonderful week of laughter, in-jokes, and brain-stretching.

I am hoping that within a few months, I'll be "back in the saddle" again and planning a 2017 full of speaking and learning. In the meantime, I'll be following #CppCon on twitter, and watching the YouTube channel for new videos - the plenaries and keynotes get up really fast. If you're not there in person, be there virtually like me!

Kate

Friday, 16 September 2016 10:59:08 (Eastern Daylight Time, UTC-04:00)  #    
# Friday, 29 April 2016

I've started a C++ column in Visual Studio Magazine. I'm sure you've read plenty of C++ columns in your time - I sure have! I wanted this one to be a little different. So, here's what I've decided to do. For each column, I choose a guidelines from the C++ Core Guidelines, and then explain it. But the twist is that I'm not going through the guidelines from top to bottom - I'm picking guidelines whose explanations require a little language knowledge.

The first column just sets the stage and explains what I'm doing, and gives you a link to the Guidelines. The second, Don't Cast Away Const, explains the guideline, but also the consequences of const-correctness, a typical situation where you might find it hard to stay const-correct when you make a performance tweak to a running system, and the correct use of the mutable keyword. Not bad for explaining a four-word guideline!

I have a number of columns already written and plans to write more. Please check them out and spread the word!

Kate

Friday, 29 April 2016 17:17:26 (Eastern Daylight Time, UTC-04:00)  #    
# Thursday, 24 March 2016
My latest Pluralsight course is live! It's called First Look: C++ Core Guidelines and the Guideline Support Library and it introduces the guidelines and why you might want to use them, as well as some preliminary tool support. As always, if you need a free trial, use the link in the sidebar on the right.

Pluralsight courses now have trailers. This is my first course with one and it turned out a lot better than I expected. You don't need a subscription to watch the trailer - just go to the course page, and over on the right side there are these downward pointing triangles next to time lengths. Click the one for Course Overview which is 1m 49s, and you'll see one entry under it that also says Course Overview 1m 49s.



Click that and the player will open and play the trailer. I did the voice recording, and some Pluralsight elves put together visuals (some are excerpts from demos) around it. I like it! Let me know what you think.

Kate
Thursday, 24 March 2016 13:10:15 (Eastern Standard Time, UTC-05:00)  #    
# Monday, 29 February 2016

I’ve been hearing that the new search and browse functionality on Pluralsight isn’t working for everyone, and that the sheer volume of courses makes some hard to find. So I thought I’d make a list of my current courses in the hope of simplifying things for those who want to learn something specific.

Visual Studio 2015: Essentials to the Power-User

This is the most recent Visual Studio course and it starts at the beginning and goes well past what most people know about Visual Studio. I’m confident that even if you use Visual Studio every day, you’ll learn something in this course that will make you more productive.

What's New for C++ Developers in Visual Studio 2015 Preview

This course was based on the preview, but works well against the RTM version of Visual Studio 2015. It’s C++-focused and just shows you what’s new compared to Visual Studio 2013.

Using StackOverflow and Other StackExchange Sites

Most developers find StackOverflow results whenever they do a web search for a particular error message, or some API they’re having trouble using. Many of them tell me that when they try to sign up and actually ask and answer questions, they have an unpleasant experience. Often, it’s because their mental model of the site does not match the way it actually works. This course will show you how it works, so you can get the answers you need and not feel rejected or hurt by the way these sites work.

Learn How to Program with C++

This course is aimed at people who have never programmed before. If you’ve programmed, in any language, consider C++ Fundamentals instead. If you don’t believe anyone can learn C++ as a first language, I’m ready to argue with you. Modern C++ is a simple and useful language that a beginner can learn and use well.

C++ Advanced Topics

This course is for the material I couldn’t fit into C++ Fundamentals. It’s presented as a number of things I want you to do, or stop doing, when you write C++ today:

  • 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

C++ Fundamentals  and C++ Fundamentals - Part 2

These courses were written in 2011 but hold up well. Here is where you’ll learn the basic syntax of the language and how everything works, including templates, pointers, lambdas, and exceptions. Watch both parts to learn the whole language, then dive into C++ Advanced Topics to round out your C++ knowledge.

I have other courses – on older versions of Visual Studio, for example, but these are the “big” ones for me at the moment. I hope this list helps you to find them. And remember, if you need a free trial, use this link. Click Subscribe, then Start 10-Day Trial, and you’ll be all set.

Kate

Monday, 29 February 2016 12:19:13 (Eastern Standard Time, UTC-05:00)  #    
# Monday, 07 December 2015

The first keynote at CppCon this year was Bjarne Stroustrup (who invented the C++ language) announcing the C++ Core Guidelines. They are on Github and once he announced them, as Herb Sutter reported in the second keynote the very next day, they quickly became a trending topic across all languages. Here is a description of the guidelines from there:

The C++ Core Guidelines are a collaborative effort led by Bjarne Stroustrup, much like the C++ language itself. They are the result of many person-years of discussion and design across a number of organizations. Their design encourages general applicability and broad adoption but they can be freely copied and modified to meet your organization's needs.

The aim of the guidelines is to help people to use modern C++ effectively. By "modern C++" we mean C++11 and C++14 (and soon C++17). In other words, what would you like your code to look like in 5 years' time, given that you can start now? In 10 years' time?

The guidelines are focused on relatively higher-level issues, such as interfaces, resource management, memory management, and concurrency. Such rules affect application architecture and library design. Following the rules will lead to code that is statically type safe, has no resource leaks, and catches many more programming logic errors than is common in code today. And it will run fast - you can afford to do things right.

To me, these guidelines are the key to getting across my fundamental message that C++ does not have to be hard, scary, complicated, or dangerous. The language may still say “it’s your foot!” but the guidelines, and the tools they can drive, are quite the opposite.

You probably know that Visual Studio has a static analyser built in. (You should, anyway, I’ve blogged about it.) It will catch things like this:

    int* p = nullptr;
    *p = 10;   

But it doesn’t mind things like this:

    int arr[10];        
    int* p2 = arr;

Two lines, two violations of the guidelines – I’m not initializing any of the elements of arr, and then I am using its address as a regular old pointer. Now, there’s nothing wrong with regular old pointers – some people have got quite a hate on for them with the rise of genuinely smart pointers, but pointers are fine. Using pointers to control lifetime isn’t fine, because it’s impossibly difficult. But pointers themselves are fine. What’s not fine here is the “decay” of an array into a pointer – folks from other languages don’t expect that at all, and some marvelous bugs have hidden behind this simple bit of helpfulness from the compiler. So there’s a guideline that says don’t do that. Specifically:

(I’m giving you a picture of code because if you want to copy and paste you should go to the live, always updated, guidelines on github.)

This guideline is part of a “profile” – a particular set of rules that are designed to be enforced and that are supported by tools. Well, when I say tools I might be overstating the case a little. There’s just one tool at the moment, but that could be enough!

This tool, C++ Core Checker, is on the NuGet Gallery. You don’t have to get it from there though. You get it, and use it, from inside Visual Studio 2015. Any version will do. If you don’t use Visual Studio normally, just get and install the Community Edition, which is free and is ok to use for commercial purposes, from https://www.visualstudio.com/ . (Need the fine print? if you’re using it as a person, you can do whatever you like. If you work for a company with less than 250 PCs and less than a million dollars US in revenue, again you and up to 4 of your coworkers can use it for whatever you like. If you work for an “enterprise” company then any and all of the employees can still use it for learning purposes or to work on open source.) Note that Visual C++ isn’t part of the Typical install, so you’ll need to choose Custom and select Visual C++:

So once you have Community Edition or some edition of Visual Studio, make a console application and put in the two bad lines of code. Build it and then also run static analysis on it (On the Analyze menu, choose Run Code Analysis, On Solution.) You won’t get any warnings or errors. That’s your pre-guidelines life. You’re doing something inappropriate and nobody is telling you.

Now, add the checker to your solution. This is solution-by-solution, not a change to how Visual Studio does static analysis. On the Tools menu, choose NuGet Package Manager, Package Manager Console. In the console window that appears, type Install-Package Microsoft.CppCoreCheck and press enter. You will see output like this:

Attempting to gather dependencies information for package 'Microsoft.CppCoreCheck.14.0.23107.2' with respect to project 'ConsoleApplication1', targeting 'native,Version=v0.0'
Attempting to resolve dependencies for package 'Microsoft.CppCoreCheck.14.0.23107.2' with DependencyBehavior 'Lowest'
Resolving actions to install package 'Microsoft.CppCoreCheck.14.0.23107.2'
Resolved actions to install package 'Microsoft.CppCoreCheck.14.0.23107.2'
Adding package 'Microsoft.Gsl.0.0.1' to folder 'c:\users\kate\documents\visual studio 2015\Projects\ConsoleApplication1\packages'
Added package 'Microsoft.Gsl.0.0.1' to folder 'c:\users\kate\documents\visual studio 2015\Projects\ConsoleApplication1\packages'
Added package 'Microsoft.Gsl.0.0.1' to 'packages.config'
Successfully installed 'Microsoft.Gsl 0.0.1' to ConsoleApplication1
Adding package 'Microsoft.CppCoreCheck.14.0.23107.2' to folder 'c:\users\kate\documents\visual studio 2015\Projects\ConsoleApplication1\packages'
Added package 'Microsoft.CppCoreCheck.14.0.23107.2' to folder 'c:\users\kate\documents\visual studio 2015\Projects\ConsoleApplication1\packages'
Added package 'Microsoft.CppCoreCheck.14.0.23107.2' to 'packages.config'
Successfully installed 'Microsoft.CppCoreCheck 14.0.23107.2' to ConsoleApplication1
PM>

This changes your project settings so that analysis runs this Core Checker for you. Repeat the analysis step and this time the new tool will run and you will get output like this:
------ Rebuild All started: Project: ConsoleApplication1, Configuration: Debug Win32 ------
  stdafx.cpp
  ConsoleApplication1.cpp
  ConsoleApplication1.vcxproj -> c:\users\kate\documents\visual studio 2015\Projects\ConsoleApplication1\Debug\ConsoleApplication1.exe
c:\users\kate\documents\visual studio 2015\projects\consoleapplication1\consoleapplication1\consoleapplication1.cpp(9): warning C26494: Variable 'arr' is uninitialized. Always initialize an object. (type.5: http://go.microsoft.com/fwlink/p/?LinkID=620421)
c:\users\kate\documents\visual studio 2015\projects\consoleapplication1\consoleapplication1\consoleapplication1.cpp(10): warning C26485: Expression 'arr': No array to pointer decay. (bounds.3: http://go.microsoft.com/fwlink/p/?LinkID=620415)
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========

Where it says "type.5" and there's a link, that's to the specific rule in the "type" profile that this code breaks. And where it says "bounds.3", the same - I showed a picture of bounds.3 up above.

Isn’t that great? Come on, it’s great! The tool will add more rules as we move through 2016. I’m going to have a lot more to say about the Guidelines as well. But this is a great place to start.Why not point it at some of your own code and see what happens?

Kate

Monday, 07 December 2015 13:54:57 (Eastern Standard Time, UTC-05:00)  #    
# Saturday, 26 September 2015
Back when I first started going to conferences, the schedules typically ran 9 or 9:30 to 4 or 4:30. I used to bring a book to read in the evenings in case I didn’t like what was on TV. Then I started getting invited to dinners and parties and planning meetings and conference days got a lot longer for me. But what I’ve noticed recently is that conference days are getting a lot longer for everyone. People have come all this way and are willing to pack a lot into each day. I’m writing this on the last day of CppCon where there is content starting at 8am and running until 10pm. There's even content over the two hour lunch break! That’s a long day, and a bunch of them in a row makes for a long long week. So here are some tips for how to handle that kind of week. I’m going to be specific to CppCon, because I think a lot of my readers should attend it, but other conferences will have equivalents to everything I’m mentioning here; I’ll let you do the mapping yourself.

First, have a schedule. Weeks before the conference, mark out what talks you want to attend. Have a goal of selecting two talks in most time slots. Then if your first choice is not as good as you expected, or the room is full and you don’t want to stand, you know exactly where to go for your second choice. Have that schedule in your pocket – on your phone, or on a piece of paper – so you have no lost time figuring out where to go. (CppCon uses Sched, which mails you each day's schedule in the morning, making it easy to have with you.) Don’t be the person who shows up at 9 only to learn there were sessions at 8. Check the schedule at least once a day during the conference in case things are being added. Tip: things are being added, you can count on it.

Second, plan ahead to take care of the physical body that is carrying your brain from session to session. It’s really a simple matter to have a few granola bars and a bottle of water in your bag. If you miss a snack, you can still have something to eat or drink. Bring a light sweater in case you are in the cold room. Bring some painkillers if you might get a headache from sitting somewhere loud. Bring whatever little comforts you need to keep yourself from getting whiny and leaving early to go to your peaceful hotel room and watch TV. (That said, there’s always one day in a one-week conference where I go back to my room for an afternoon nap. It’s the only way I can stay functional during long and intellectually-intense days. Just make sure you’re doing it for a brain recharge and not for something you could have avoided by bringing a small item with you to the conference centre.)

Third, think about how you’re going to take notes. A paper notebook? Bring a spare pen, too. Your phone? Your laptop? Or are you just going to immerse yourself in the experience and use the videos if you want to check something later? Whatever your plan is, bring what you need to be able to use it. Power is always a challenge at conferences – I like to bring an external battery for my phone so it can charge in my bag. Think about what your bag is going to weigh and consider leaving the laptop at the hotel and getting by with a phone and some paper for notes. It’s really liberating not to be lugging a heavy bag, in fact surprisingly so.

Fourth, before you arrive (at the latest, on the plane to the conference) write up your goals for the conference. Do you want to meet people? Specific people, or some number of people, or people from a particular industry? Do you want to learn something specific? (Perhaps this is the year to understand SFINAE, or be able to follow along in a talk that includes template meta programming, or “get” those Haskell jokes people are always telling.)  Maybe you want to tell people about something? Tweet some number of times? Blog some number of times?  Have a plan. Have goals. Check yourself against these goals each morning, and adjust your plan for the day if you need to, so that you move towards those goals each day.

When you arrive at the conference, scout out the amenities. Where are the bathrooms? Are there tables and chairs? Are there tables and chairs with power? On Day 1, pay close attention to the food and drink pattern. Is coffee always available, or only at certain times? Where does the food appear? Knowing this will take away any worry you may be carrying around that you may miss something and not get another chance at it. It will also save you from taking extras of things and lugging them around all day when you don’t really need them. I also like to work out patterns related to what rooms I’ll be in – that I’ll be on the same floor all afternoon, for example. It just makes me feel a little more settled and centred.

Looking after your body doesn’t stop with what you planned and what you brought. I start each day with 5 minutes of stretching which makes a big difference to how I feel all day. I also try to use the stairs instead of the escalators – less lining up and it makes me feel better too. I go ahead and eat the snacks, many of which are not part of my normal day (brownies in the afternoon? bag of chips at lunch?) but not to excess. CppCon has fruit and other options that are not all about fat, sugar, and caffeine, and it’s often a smart choice to go with those rather than the straight-up treats. Try not to get too far from normal. If you normally have 5 cups of coffee a day, then you can do that during the conference, but if you’re a one-cup-a-day person, perhaps don’t go beyond 2 or 3 a day while you’re here. Same advice for alcohol – if you dramatically increase your consumption over the course of the week, you’re likely to feel uncomfortable by the time Thursday or Friday rolls around. The one thing you should be sure to take in more of than usual is water – whether you’re eating more sugar than usual, drinking more caffeine and alcohol than usual, or just walking a lot more than usual from room to room in a conference centre, extra water is what you need to compensate. If you grab a bottle of water at a snack break, hang on to it when it’s empty – typically most conference rooms have a watercooler or bubbler by the door where you can refill that bottle whenever you want. Can’t stand water? Bring something to flavour it with – pick up some powders or drops at home and try them out to see which one you like. It’s way more efficient than hanging around hoping that this is the break they have juice at, or leaving the conference centre on a half hour walk for a convenience store.

As the conference goes on, be aware of how you are spending your time. For example, if you check your email during a session, but then take a peek at Twitter, and then at your personal Facebook – are you even really in the session anymore? Don’t be afraid to leave if this is not the session for you. You can go to another one, or talk to other attendees out in the hall, or go back to the hotel for a one hour nap. Almost anything is better than ignoring a speaker and killing time on your laptop or phone. And if you’re not prepared to leave, then perhaps you just need to start paying more attention to the session – assuming it’s material you actually are interested in. Take a look at those goals you wrote. Have you tweeted recently? Blogged? Learned that thing? Met enough people? Will staying in this session and listening meet your goals, or should you go out to the hall and work on a goal? Are you just chatting with your own coworkers, or someone you’ve known for years? Building and strengthening relationships is great, of course. That doesn’t mean that discussing the football game with your cubicle-mate is a good use of your time at a place you flew 5 hours to attend. Maybe you can walk around and find a way to join a conversation with a speaker or someone else you wouldn’t normally meet. Just standing there listening can be very enlightening even if you don’t end up saying much.

If you’re not normally a tweeter, blogger, or talker-to-strangers, a conference is a great place to start. There are immediate benefits. Perhaps your question will be answered, or your point will be repeated and quoted, or you’ll make a new friend or business connection. This will give you reinforcement for doing that, of course. As you meet your goals, make a record of that, so you can easily answer questions about what you learned or accomplished during the conference. Consider writing a summary when you’re done – for yourself, or for whoever funded the trip. A chronological structure is natural – Monday morning I went to a talk called X and learned Y or met Z, at lunch Monday I talked to A and B who encouraged me to look into C, Monday afternoon I went to a talk on C – but be sure to have an executive summary that reads a little less like a diary. Start writing it during the conference and polish it on the trip home. Once you get back to the office, writing that summary is going to get harder and harder, so don’t put it off.

Attending conferences is a great way to boost your career – when you do it well you learn a lot in a short time, meet luminaries of your industry and people just like you, raise your profile and your confidence, and have a wonderful time. When you do it poorly, you get tired, hungover, lonely, overwhelmed, and bored. Put in the effort to plan and prepare, and you will be in a great position to reap the rewards.

Saturday, 26 September 2015 11:39:17 (Eastern Daylight Time, UTC-04:00)  #    
# Thursday, 11 June 2015

One of the CppCon sponsors, Bloomberg, is running a contest for students in university or college and giving away trips to attend CppCon2015 in September in Bellevue, Washington:

The series of seven weekly challenges will kick off on June 22, 2015, and each week contestants will be provided a different set of problems to solve via Bloomberg’s cloud-based CodeCon platform. Each week’s winner will earn a trip to CppCon in September. The list of seven winners will be announced and notified via email on August 5.

Interested? You should be. CppCon is a great experience for students and one you won't soon forget.

Kate

Thursday, 11 June 2015 15:38:34 (Eastern Daylight Time, UTC-04:00)  #    
# Tuesday, 13 January 2015

ACCU has announced the schedule for their 2015 conference in Bristol, so I can announce that it includes me!

James and I are adding quite a lot of material, so if you saw this talk at CppCon, you should probably come and see it again at ACCU. Alternatively, you could come to the conferences and watch one of the conflicting talks and take excellent notes, because I really wish I could be at those as well!

I first went to ACCU two years ago, spending my own money for travel and the registration fee. I enjoyed it immensely and learned a lot, so it's a real thrill to be speaking there this year. I can't wait!

Early bird rates last till the end of February. Register as soon as you can, and I'll see you there.

Kate

Tuesday, 13 January 2015 12:48:48 (Eastern Standard Time, UTC-05:00)  #    
# Tuesday, 12 August 2014

Earlier this year I flew to Utah for the Pluralsight Author Summit. Spending time with such a great collection of my friends and colleagues, and learning more about how to make a great course, was the real reason for the trip, but I got up early one morning to record a Play by Play video with Geoffrey Grosenbach. He has a genuine skill of getting you to demonstrate your own thought processes aloud and I've enjoyed watching other people's Play by Play sessions a lot.

Geoffrey had arranged for some ancient C++ code for me to poke around in. Mike Woodring came through with the sample code from his 1997 book with Aaron Cohen, WIN32 Multithreaded Programming. Seventeen-year old code it may have been, but it turned out not to be quite as ugly as I would have liked. Still, we put it through its paces a little and talked about how I approach this sort of task.

It came out to about 90 minutes overall so if you have a chance to watch it, let me know what you thought!

Kate

Tuesday, 12 August 2014 13:34:43 (Eastern Daylight Time, UTC-04:00)  #    
# Sunday, 03 August 2014

How fun is this going to be? (A lot!)

I'm going to speak at this next February! One of my big deciding factors was the other speakers. Erik Meijer, Greg Young, Michael Feathers, me, and one speaker still to be named. It's a small gathering to talk about software engineering. I'm still working on precisely what my two talks will cover, but expect it to include C++, legacy code, best practices, being "modern" in your C++, and related topics. Two days of intensive geekery wrapped around two days visiting the Bahamas! Space is still available so why not consider it? Brought to you by the Code on the Beach people, so you know they know how to do this.

Kate

Sunday, 03 August 2014 10:04:10 (Eastern Daylight Time, UTC-04:00)  #    
# Saturday, 02 August 2014

It's just around the corner - the largest C++ conference EVER with over one hundred talks!

And two of those talks I'll be doing with James McNellis. We had such a good time presenting together for Microsoft Virtual Academy that we decided to do it again. How do these sound?

Modernizing Legacy C++ Code

C++ is a programming language with a long, storied history spanning over three decades--four if one includes its C ancestry. The C++ language has undergone many changes during that time, compiler technology has advanced substantially, and computers today are very different from the computers of decades past. But despite all of these advances, there's an awful lot of C++ code in use today that looks like it was written in the 1980s. In some cases, the code was written in the 1980s and it's still in use; in other cases, it's recently-written code that just doesn't use modern style.

In this talk, we'll discuss some of the problems with legacy code, and review some practical techniques for applying principles of modern C++ to gradually improve the quality of legacy code and improve maintainability and debuggability. We'll show how some very small changes to code can yield huge benefits.

Making C++ Code Beautiful

Ask a non-C++ developer what they think of C++ and they'll give the language plenty of compliments: powerful, fast, flexible, and "the language for smart people". But along with that you are likely to hear ugly, complicated, hard to read, and "the language for smart people". Is it possible to write beautiful C++? Not arcanely elegant or wickedly compact, but readable, clear, expressive - beautiful! We say it is, and we want to show you how.

In this session, you'll see how to turn pages of "comic book characters swearing" into code you'll be proud to call your own. By making your code express your intent, using the power of new language and library functionality, and leaving hard-to-read constructs out of your vocabulary, you can give your code a makeover that will stand the test of time.

If you're not registered yet, there's still time! All five days cost $995 and there are one and two day passes available for less. You're going to want to meet and learn from the stars of C++ - check the full session list to read all about it.

Kate

Saturday, 02 August 2014 14:37:09 (Eastern Daylight Time, UTC-04:00)  #    
# Sunday, 23 February 2014

I was invited to speak to some Imagine Cup contestants in Calgary and delighted to accept. I spoke to the teams informally for quite a while about judging and judges and general team tips. I was really happy to see some teams from previous years so I could hear what happened after they entered. If you're a student (undergrad or grad) and would like to enter, there is theoretically still time, but realistically it would have been better to start several months ago since you do have to build working software. Why not take a look at the contest (there are over a million dollars in prizes, and you can get a cool trip somewhere and meet some industry high flyers) and start pulling together a team for next year? There's a pretty good introduction for Canadians on the Microsoft Canada blog.

For those of you who were at the sessions, here are the slides I used in the afternoon. I talked about the new C++ features and why they matter, and demoed C++ AMP as a great motivator for using C++. (I wanted to upload the pptx files, but they're too big for the blog, so I've exported PDFs.)

Kate

GregoryCppAMP.pdf (1.65 MB)

Cpp11and14.pdf (556.51 KB)

Sunday, 23 February 2014 13:17:11 (Eastern Standard Time, UTC-05:00)  #    
# Thursday, 28 November 2013

In a word, it was exhausting. But it was also cool from a technical point of view. Here's a still of us I grabbed from the video recording:


The screens in front of us are touch screens. I forgot how much fun it is to demo Hilo on a touch screen. Here's how it looked from my side (sorry about the lunch mess):

And a better view of all three cameras:

You can see that part of my job was to imagine people who wanted to learn C++ on the other side of those cameras. And finally, here's James hard at work getting something onto the demo machine:

I believe this picture immortalizes the moment he tweets about here:



Great day and good fun. Hope everyone learned a lot!

Kate
Thursday, 28 November 2013 18:41:15 (Eastern Standard Time, UTC-05:00)  #    
# Wednesday, 27 November 2013

Channel 9 has all 7 pieces of the MVA Day I did with James McNellis available online now!

We went very fast through this one day introduction. If you'd like a slightly saner pace, please check out my Pluralsight courses, C++ Fundamentals and C++ Fundamentals - Part 2. If you're not a programmer, and you'd like to "begin at the beginning" with C++, try Learn How to Program with C++. There is a free trial for the Pluralsight courses to get you started.

Kate

Wednesday, 27 November 2013 14:44:23 (Eastern Standard Time, UTC-05:00)  #    
# Saturday, 23 November 2013
The C++ Jumpstart full day event on Tuesday was a blast! James and I really enjoyed ourselves and from the looks of the chat room, so did the attendees. We had literally thousands of people registered for the event and in a few weeks the recording should be available (check http://www.microsoftvirtualacademy.com/Live-Training-Events for a recording link - scroll past Live Events to Recorded Events) for even more people to view.

Kate

Saturday, 23 November 2013 13:44:50 (Eastern Standard Time, UTC-05:00)  #    
# Friday, 22 November 2013
I've been busy this fall with the release of Visual Studio 2013. One of the things I've been working on is live now: a new Pluralsight course. I focused on new things that matter to C++ developers, whether that's compiler support for language changes (hello, variadic templates!) or IDE changes that were implemented for C++ as well as "the other languages". Here's the description:

The C++ Language and the Standard Library both changed dramatically with the release of C++ 11. Some of these features were not implemented until Visual Studio 2013, and those are presented in this course. You'll learn about variadic templates, improvements in constructing and initializing variables, and rawnstring literals. In addition a number of productivity boosting enhancements in debugging, editing, and using libraries are in this version and you will learn how to take advantage of them.

If you don't have a Pluralsight subscription already, there's a free trial available, so please check it out!

Kate

Friday, 22 November 2013 13:36:27 (Eastern Standard Time, UTC-05:00)  #    
# Monday, 18 November 2013
Are you joining us tomorrow for a one-day introduction to C++ at Microsoft Virtual Academy? (No? There's still time to register.) Then you might want the sample code we'll be using. We're probably going to go too fast for you to actually follow along in your copy of Visual Studio, but you can try. I've attached a zip of the code to this post.

Kate

Demos.zip (164.55 KB)
Monday, 18 November 2013 14:22:01 (Eastern Standard Time, UTC-05:00)  #    
# Tuesday, 12 November 2013
A lot of people (a lot) have asked whether the November 19th session (a whirlwind tour of C++ for those who don't know it) will be recorded. I'm happy to confirm that it will be. On the Live Events Page for Microsoft Virtual Academy you will see both future and past events. Here you can register for our session, and about two weeks afterward a link will appear on this page to let you watch the recording.

Please help spread the word to people you know who want to learn C++!

Kate

Tuesday, 12 November 2013 19:53:21 (Eastern Standard Time, UTC-05:00)  #    
# Wednesday, 06 November 2013

If you know someone who wants to get started using C++, and has done at least a tiny speck of programming in other languages (so I don't have to explain what a loop is) then you might want to point them at this free online event:

C++: A General Purpose Language and Library
Attention developers: here’s a painless way to learn the basics of C++ from the ground up, whether you’re updating legacy code or writing brand new, efficient, and high-performance code for new platforms like phones and want to take advantage of C++. You’ll learn the fundamentals of the C++ language, how to use the language and its Standard Library effectively, and how to use the Visual Studio environment for developing C++, including debugging, exploring code, and understanding error messages. This is your starting point for building software in C++.

James McNellis (of the Visual C++ team) and I will spend the day walking through the fundamentals of the language and the Standard Library. We're going to have a great time. Please send us some beginners to keep us company!

Kate

Wednesday, 06 November 2013 17:07:07 (Eastern Standard Time, UTC-05:00)  #    
# Wednesday, 02 October 2013

In yesterday's session, I showed a Windows 8 store app that loads an image and then draws an animated ripple over it.

If you would like to get the code, and more importantly the documentation that explains the code, it's on Codeplex. Mixing and matching a little DirectX into your Windows 8 C++/CX app is remarkably easy, so why not take a quick look?

Kate

Wednesday, 02 October 2013 02:45:36 (Eastern Daylight Time, UTC-04:00)  #    
# Tuesday, 01 October 2013

Were you at my session today?

If so, you might want this code. If not, I am not sure the code will help you much :-)

Kate

Demo1.zip (1.37 MB)
Tuesday, 01 October 2013 11:01:53 (Eastern Daylight Time, UTC-04:00)  #    
# Thursday, 28 March 2013
The week of April 8th, I'll be in Bristol, UK, attending ACCU. I'm looking forward to it tremendously - there is a great lineup of sessions and I only wish I could have spared the time to stay on for the C++ committee meetings that will follow it. I am, however, making the most of my time in that delightful city. Having enjoyed Guy Smith-Ferrier's presentations in several different locations, including my own East Of Toronto .NET User Group, I can now turn the tables and present at his.

Of course I want to do a C++ talk. But it's not a C++ group. So to be fair, I've decided to do two talks:

First, Use All of Visual Studio to Become a Better Developer

Most developers know how to use Visual Studio to do the basics of being a developer. You can create a solution, add projects to it, edit code, and run it. Easy, right? In this session, I want to show you how to be a better developer by using parts of Visual Studio you might not know about. Save hours of debugging time, move around your code more smoothly and don't lose your place, see what you want to see and find what you need to find. Demos will be in C# with Visual Studio 2012.

Second, C++ in 2013 – Why on earth?

There are so many languages a developer could use today. Yet some developers still use C++. Some developers are learning C++ when they already know C# and other younger languages. This session will show you why that is happening, and why you might want to learn the new C++ yourself. It's nothing like the C++ you remember, and it can be a very useful language for you to know.
 Please do register for these, and I hope to see you there!

Kate

Thursday, 28 March 2013 11:55:53 (Eastern Standard Time, UTC-05:00)  #    
# Friday, 04 January 2013

Over the last few weeks, I've been accumulating links to appearances of mine, and it seems like a good idea to share these.

  • OReilly webcast: This is a reasonably horrible recording (sound quality and video size) of a webcast I did back in August. It shows why C++ AMP is so cool and why you might care about it. I recorded it to promote the book but I'm not very happy with how it turned out. You'll probably do better with the recording of my Tech Ed talk.
  • Pluralsight interview: This is specifically about my Using Visual Studio 2012 course. You can download the audio or read the transcript as you prefer.  My favourite quote from the conversation:
It’s not just like, oh, I saved five seconds. I can go home five seconds earlier today. It’s that you’re less likely to forget what you were doing because you don’t have to put so much time into the mechanics and you just stay in flow. And to me, that’s a ramping up of two or three times the amount of code I can produce when I use everything the tool has to offer.
  • Dot Net Rocks panel at DevIntersection: Here Scott Allen, Michele Leroux Bustamante, Woody Pewitt, and I discuss whatever we feel like, with occasional leading questions from Carl and Richard, and some Canadian whisky too.

Even though I haven't been blogging much, I have been doing a lot, and I hope these links will help you to discover some of it.

Kate

Friday, 04 January 2013 17:58:45 (Eastern Standard Time, UTC-05:00)  #    
# Tuesday, 20 November 2012

While I was in Nashville as part of the Dot Net Rocks Roadtrip, we recorded an episode of The Tablet Show. The recording is online now and I'll have to give it a listen myself to remember what we talked about - Hilo, for sure, and C++ AMP, and just generally why C++ can be a great choice for tablet development.

Kate

Tuesday, 20 November 2012 13:30:44 (Eastern Standard Time, UTC-05:00)  #    
# Friday, 16 November 2012

Don McCrady, who with Jim Radigan did an inspiring talk on performance at Build this year, has blogged about a proof-of-concept project that adds C++ AMP to CLANG and LLVM using OpenCL underneath instead of using DirectX the way Visual Studio does. This is super cool! As Don says:

When Microsoft announced C++ AMP back in June 2011, we told you that we would release the C++ AMP specification under the Microsoft Community Promise – essentially opening up the specification to allow any C++ compiler implementer to add C++ AMP to their compiler. Shevlin Park serves as an example of the platform portability potential intended by the Community Promise.

Do read Don's post and follow the links to learn more about Shevlin Park. The praise for C++ AMP as a programming model, and the likelihood that multiple compilers will support it, should make you feel all warm and fuzzy about learning it. You might even want to use my book to do so :-)

Kate


Friday, 16 November 2012 13:19:40 (Eastern Standard Time, UTC-05:00)  #    
# Saturday, 03 November 2012

Day 4 was the first time I started to experience what some others had been complaining about with not being able to get into the room for a popular talk. I guess I'll just have to watch the recording.

I remembered to take some pictures of the signage that directed us around to help cope with being in two different buildings plus the tents:



And the map on the ground outside the building:




There were also people holding giant arrows to point attendees towards lunch or shuttles or whatever. It would have been extra-ordinarily difficult to get lost.

Herb's session Friday was everything it had promised to be. I just love the idea of http://isocpp.org/ and I intend to make good use of it when people ask me "getting started" questions.

Finally I had to accept it was ending. They were even tearing the tent down already:




I used the airport WiFi to download sessions to watch on the way home. Good week, Microsoft!

Kate
Saturday, 03 November 2012 12:11:03 (Eastern Standard Time, UTC-05:00)  #    
# Friday, 02 November 2012

One of the stickers for the badge this year was to attend an 8:30 session. I achieved that by going to Alive with activity: Tiles, notifications, and background tasks which, to be honest, I chose as much to see what Kraig Brockschmidt is doing lately as to learn about tiles and toast. But I'm glad I went, because it was a very good talk.

I've come to Redmond so many times, but I never particularly noticed the colours changing. This week they've been spectacular. I had some meetings in other buildings so I was able to get out of the giant lines at least long enough to take pictures of the giant lines :-)




And yes, it rained, but they were ready for that:




I really like the vibe that came from being on campus. Speakers tended to get up from their desks, jump on a shuttle or walk over, pull on the shirt and talk to us. I really got the sense we were being welcomed into their home.

I also went to Tips for building a Windows Store app using XAML and C++: The Hilo project - how could I not, since I was on the project. Excellent summary of some hard-learned lessons and one you should totally download and watch.

Kate
Friday, 02 November 2012 12:00:10 (Eastern Standard Time, UTC-05:00)  #    
# Wednesday, 31 October 2012
Build this year is less focused on announcing things (though the Windows phone and native C++ material is brand new) and more on drilling down into topics that we've had a year to experiment with and want some deep study on. Most of the speakers are from product teams. What's fun for me is that most of the attendees are very motivated and here to learn.

I'm also enjoying how full the rooms are for C++ sessions. Here's Tarek's Day 1 session:



BTW, that was session 3-000 demonstrating that (a) the sessions are numbered using zero-based indexing and (b) the C++ sessions were first on the list.

And here's the C++ performance talk from right after the keynote this morning:



This room was standing room only. It's possible all the C++ talks were, I don't always sit at the back where I can see whether people are standing back there or not. And you may not be able to tell from the picture but there were plenty of young developers there too.

There was also a nice session on Project Austin which is a lovely reference app showing how to use DirectX in a Windows Store app. You can get the code from Codeplex and take a look at it yourself or just use it to take beautiful notes on a tablet.

Speaking of reference apps, Hilo (which I've written about before) is now an official sample in the SDK and on the Dev Center. There's a Hilo session here at Build too. Within a day or two these links should have recordings and slides for you to download.

Want to know more about C++ at Build? Here's less than two minutes on just that topic. If you can, please watch Herb's talk on Friday. It promises to be exciting!

Kate

Wednesday, 31 October 2012 19:45:47 (Eastern Standard Time, UTC-05:00)  #    
# Tuesday, 30 October 2012
I arrived in Seattle Sunday night and filled Monday with meetings, then lined up to register for Build. I'll spare you the photos of the giant lineup that everyone else seems to have taken, and show you these delicious cupcakes from the welcome reception:



For me the most exciting part of the lineup was the revised session schedule I was handed, with lots of sessions on writing Windows Phone 8 apps in native C++. I cheerfully added them to my schedule along with all the existing sessions on C++. (The sessions are recorded so check them out yourself!)

And I ended up at dinner with a lot of geeks. We were unable to resist a little side by side comparison of our phones:




It sure made me want a 920 - good thing it turns out I'm getting one :-)

Kate
Tuesday, 30 October 2012 16:47:06 (Eastern Standard Time, UTC-05:00)  #    
# Saturday, 27 October 2012

I really enjoyed my evening in Nashville. It was fun answering the question: C++ - Why on earth? I think I even convinced a few of you.

Of course the biggest Nashville attraction for me is my friend Billy Hollis:

Look what a luxurious meeting room they have! Couches and tables and general comfort. And yes, I got to see the inside of the RV:

If I got you interested in C++, you might like some links:

Thanks for the visit, and I hope to be back!

Kate

Saturday, 27 October 2012 17:31:18 (Eastern Daylight Time, UTC-04:00)  #    
# Saturday, 20 October 2012

Is the C++ Renaissance real? Well I'll tell you one thing: conference organizers are way more receptive to all-day C++ sessions than they used to be :-). I'll be doing yet another one this year. This time it's in Las Vegas Dec 9th, as part of DevIntersection. Here's the abstract:

PRECON04: C++ in 2012: Modern, Readable, Safe, Fast (9:00 AM - 4:00 PM)
C++ 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 workshop 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.

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.

The workshop costs an extra $399 for conference attendees and will cover a lot of ground: new language and library goodies in C++11, ALM Support for C++ developers in Visual Studio 2012, a quick taste of some PPL and C++ AMP power, and plenty of advice on best practices and modern C++ style.

I hope to see you there! Don't forget, if you register for the conference before Nov 1st, you'll get a tablet!

Kate

Saturday, 20 October 2012 20:01:13 (Eastern Daylight Time, UTC-04:00)  #    
# Wednesday, 17 October 2012

Here's an amazing grand finale to the Dot Net Rocks Roadtrip this year -a full on developer conference in Las Vegas, Dec 9th - 12th.

I love this answer to "What is DevIntersection?"

This three-day conference marks the final stop on the USA leg of the .NET Rocks! Visual Studio 2012 Launch Road Trip! DevIntersection is a developer conference PLUS the recording venue for the last stop of the three-month road trip hosted by Richard Campbell and Carl Franklin. We're bringing together some of the best speakers (and our personal friends) for a conference that is relaxed and educational, plus forward looking as you and your company start to figure out what to do with Windows 8 and Visual Studio for the next few years. Our attendees tend to be .NET software developers plus other members of their teams. DevIntersection is an educational onsite conference for anyone who is attached to a .NET development programming project who is looking to use Visual Studio to develop apps for desktop, web and mobile platfoms.

I have two breakout sessions - one on C++ AMP and one on developing for the Windows Store in C++. No .NET in either one of them; this is a conference for expanding your horizons, after all.

For $1595 you get three full days of sessions. And if you register in October (hurry!) you will also get a new tablet. Build sold out in hours, so this is your chance to get access to deep and current information for developers across the Microsoft ecosystem. See you there!

Kate

Wednesday, 17 October 2012 13:52:31 (Eastern Daylight Time, UTC-04:00)  #    
# Monday, 15 October 2012

Hilo is a reference project written in C++/CX for Windows 8 by the Patterns and Practices team. I was delighted to be part of this project and think it turned out very well. I use the Hilo codebase to remind myself how to do certain things when writing a Windows Store app in C++ (something I'm in the middle of doing for another project.) The accompanying document is rich in best practices for Windows 8 development, async work, modern C++, unit testing, and more. Now the latest version has been released, updated for Windows 8 RTM.

Hilo itself is a photo viewer. Before you roll your eyes, bear with me. I actually think it's better than the one that ships with Windows 8. It shows you some of your pictures as a sort of overview:

Click on one to interact with it. You can right-click to bring up both the app bar at the bottom and a nice strip-navigation control at the top:

If you want to see something cool, use Cartoon Effect. This leverages C++ AMP to cartoonize the picture. I've shopped this image a little to reduce the width (pulled the appbar in from the edges) but the cartoon work was done by Hilo - and super quickly.

If you have any thoughts of writing Windows Store apps, and C++ is a possibility for you, get over to Codeplex, download the Hilo code and the .chm file, and get reading!

Kate

Monday, 15 October 2012 13:17:12 (Eastern Daylight Time, UTC-04:00)  #    
# Friday, 28 September 2012
I’ve been writing a book, though I swore I wouldn’t write any more books, and it’s finally done! You can buy a Kindle version from Amazon or an e-book directly from O’Reilly today. The paper copies will be ready in about a week and you can order them from O’Reilly or Amazon. The book is published by Microsoft Press, but O’Reilly handles the actual production of the books.


 I’ve got a page dedicated to the book with links for you to buy it, get the code, submit errata, and whatever else you might want. (If you think something’s missing, comment here and I’ll try to take care of it.)

Kate
Friday, 28 September 2012 14:50:54 (Eastern Daylight Time, UTC-04:00)  #    
# Wednesday, 26 September 2012

I love writing courses for Pluralsight. I have quite a few and am working on more right now. They like to interview their authors about each course. Here's one about my latest for them. If you’ve done the whole course you won’t learn anything new from the interview, but if you’re curious about writing what we’re now calling Windows Store applications for Windows 8 using C++ and Visual Studio, perhaps this interview will help you decide whether it’s something you want to learn. There’s a transcript as well as an audio link.

Kate

Wednesday, 26 September 2012 14:13:20 (Eastern Daylight Time, UTC-04:00)  #    
# Monday, 02 July 2012
I'm headed to Australia tomorrow (I won't get there till Thursday though) and I'm going to be doing some C++ talks while I'm there. Both are aimed at folks who haven't been keeping up to date on all that's been happening in the world of C++ over the last few years.

On Tuesday, July 10th, I'll do a free Tech Breakfast on the new features of the C++ language in the standard once called C++0x and now called C++ 11. I'll demonstrate how a lot of these features are already in Visual Studio 2010 and some in Visual Studio 2012. It runs from 9am to 11 am in Sydney, and you do need to pre-register.

Then all day Wednesday, July 11th, I'll do a course on modern C++ development with Visual Studio 2010 and 2012. I'll cover language changes, tool changes, drill into my favourite feature - lambdas - and show some of the cool things they enable, and give you some advice on best practices for writing C++ today. This course costs $300 Australian and will be held in Sydney just once.

I realize many people who read my blog don't need to come and learn this material. But perhaps you know someone who does? There is room in both sessions for more people - and I want to reach as many people as possible, so please spread the word! Registration links for both session are on the SSW page announcing them.

Kate

Monday, 02 July 2012 10:47:22 (Eastern Daylight Time, UTC-04:00)  #    
# Tuesday, 26 June 2012
As I am soon to discover first-hand, Australia is a very long way from North America. So when Adam Cogan makes the trip, he often extends his stay to see more people or places. Last September when we all gathered for //build/, Adam tacked a mini Canada tour onto his North American stay and we got together for a quick chat near my home. Part of it was filmed and (after a long delay to cope with the sound issues) is now available on the SSW TV site.

We talk about C++ and why it has advantages over managed code in some cases, about C++ AMP, and about tablets, leading to this moment:



It's just a 7 minute video, so give it a listen!

Kate
Tuesday, 26 June 2012 02:18:02 (Eastern Daylight Time, UTC-04:00)  #    
# Tuesday, 29 May 2012

I've been putting my schedule together for the talks I want to attend at Tech Ed North America and Tech Ed Europe this year. While I wasn't looking, a bunch more C++ content was added.

In Orlando:

Plus some language agnostic sessions that chose to put C++ in their session descriptions, which is a new thing these days.

Now as it happens, Tech Ed North America is sold out, so if you're not registered yet, you have three choices: join the waiting list, watch these sessions online, or get your boss to agree to a slightly larger T&E budget and head to Tech Ed Europe in Amsterdam just two weeks later. There we will have:

  • PRC08, my all day Monday precon: C++ in Visual Studio 11: Modern, Readable, Safe, Fast
  • DEV316, Tuesday at 4:30 pm: Application Lifecycle Management Tools for C++ in Visual Studio 11 by Rong Lu
  • DEV368, Wednesday at 2:45 pm: Visual C++ and the Native Renaissance by Steve Teixeira
  • DEV322, Thursday at 8:30 am: Building Windows 8 Metro style Apps with Visual C++ 11 by Rong Lu
  • DEV367, Thursday at 4:30: Building Windows 8 Metro Style Apps With C++ by Steve Teixeira
  • DEV334, Friday at 1:00 pm: C++ Accelerated Massive Parallelism in Visual C++ 11 by me

(Europe doesn't have direct links to the sessions, but they do allow links to the search for C++.) I'll have to miss Steve's talk because Rong and I are going to Belgium, so that one I'll be watching online. 

One way or another, please attend or watch these sessions. There's a lot of new stuff happening!

Kate

Tuesday, 29 May 2012 17:31:56 (Eastern Daylight Time, UTC-04:00)  #    
# Monday, 28 May 2012
I am having a very lucky year. I've been nominated and accepted as a judge at the Worldwide finals of the Imagine Cup. I love being around students, and everything I've heard about Imagine Cup tells me that the energy, excitement, and creativity is marvelous to be part of. While I'm there, I decided to stay an extra day (July 11th) so I can offer my one-day C++ training to those who can't make it to Tech Ed in Orlando or Amsterdam. Here's what I'll cover:
  • Modern C++ with the Standard Library
  • Application Lifecycle Management for Visual C++ 11
  • Leveraging Lambdas for the PPL and C++ AMP
  • Best practices for C++ developers today

This is not a free session, but the price is even lower than the Tech Ed precons since I don't have travel expenses to get down there and see you all. If you live in Australia, please register and take advantage of this chance to come and learn what's been going on with C++ while you weren't looking! And if you don't, I'd appreciate it if you could spread the word to those who do.

Kate

Monday, 28 May 2012 21:04:29 (Eastern Daylight Time, UTC-04:00)  #    
# Sunday, 27 May 2012
Some people really go above and beyond for community. They have an idea, and then they make it happen. Take Marc Gregoire, for example. Our names are similar, and we both care about community, C++, and related topics, but we've never met. That didn't stop him from emailing me to see if I would do a user group talk while I was nearby for Tech Ed Europe. Of course I would! And then he arranged for Rong Lu from the C++ team to come and do one as well. Marc has done all the work of getting the room, the travel arrangements, you name it. All I have to do is take a short scenic train ride, and talk about a topic I'm excited about. That part is easy. The organizing part is hard.

It's going to be a very fun evening. I'm going to talk about C++ AMP, and Rong will cover what's new in VC++ 11. I've seen her speak before, and I know you're going to enjoy it. Be there, Wednesday June 27th at the Microsoft offices in Brussels. (I was kinda hoping for Tuesday, so I could make a joke, but Wednesday will be fine.) You need to register, so please do!

Kate


Sunday, 27 May 2012 20:49:12 (Eastern Daylight Time, UTC-04:00)  #    
# Saturday, 26 May 2012
This report is well overdue, I know. On April 17th I spoke at the first meeting of the Toronto C++ User Group! The room was PACKED:



And as you can see, there's quite an age range represented. The space was provided by bNotions. It was lovely and airy, and I was thrilled to hear their commitment to community across a variety of technologies:



Once I got started, my challenge was to give the one hour version of this talk, and not the six-hour one I plan to do at my Tech Ed precons in June. Here I am in action (thanks Eran for wandering the room with my camera throughout the talk) explaining the new ranged-based for:




The next meeting will be shared with the North Toronto .NET User Group, covering Windows 8 development in native C++. Yes, the .NET folks want to hear about this, too! I'll see you there June 4th, right?

Kate
Saturday, 26 May 2012 20:36:18 (Eastern Daylight Time, UTC-04:00)  #    
# Thursday, 10 May 2012
So much C++ news going on lately. Time to clear my queue:

It's hard to keep up with it all! Especially when I'm on a book deadline :-)

Kate

Thursday, 10 May 2012 22:06:29 (Eastern Daylight Time, UTC-04:00)  #    
# Friday, 13 April 2012
The times for my sessions at Tech Ed North America and Tech Ed Europe have been announced.

  • PRC08 - C++ in Visual Studio 11: Modern, Readable, Safe, Fast is Sunday, June 10th in Orlando, 10am to 6pm. This is the session for those who've been ignoring C++ and are wondering why they keep hearing about it. Please encourage your friends to attend.
  • DEV334 - C++ Accelerated Massive Parallelism in Visual C++ 11 is Tuesday, June 12th in Orlando, 10:15am - 11:30 am. This session will show you what C++ AMP is all about.
  • PRC08 - C++ in Visual Studio 11: Modern, Readable, Safe, Fast is Monday, June 25th in Amsterdam, 9am to 5pm. The same material as in Orlando, just saving some travel time and costs for attendees :-)
  • DEV334 - C++ Accelerated Massive Parallelism in Visual C++ 11 is Friday , June 29th in Amsterdam, 1pm - 2:15 pm. Again, same material, different continent.

If you or those you influence are not yet registered for the conference in general, and the preconferences in particular (they cost extra and require you to arrive early, so plan ahead) please take care of that as soon as you can. Here are some helpful links:

North America


Europe

Hope to see you in one place or the other!

Kate
Friday, 13 April 2012 16:02:44 (Eastern Daylight Time, UTC-04:00)  #    
# Monday, 26 March 2012

How's this for a renaissance? People are starting C++ user groups!

  • The Jerusalem .NET/C++ User Group will cover both topics. They've had their first meeting already.
  • The Central Ohio C++ User Group has also had its first meeting and will meet monthly.
  • In Austin Texas they're calling it the C++ Meetup and the description sounds a lot like a user group
  • The Belgian C++ User Group has its first meeting in April

It's so much fun to see this excitement springing up. There seem to be two popular topics for first meetings: either "What's new in C++ 11" or "Writing Windows 8 Apps". I think these two things arriving together - the huge language and library improvements (and the unexpected synergy of the language changes and the library changes) with the chance to write for Windows 8 in C++and XAML - is producing much more interest than there used to be.

And now the fun is spreading to Toronto! No, I'm not founding the group - I'm surely not the only C++ developer in Toronto after all. But I am honoured to be speaking at the first event on April 17th right downtown (pretty much Yonge and Bloor.) I'd love to dive deep into C++ AMP, or show how the Consumer Preview of Windows 8 is easier to code for, but I think I should begin at the beginning, so my talk is titled What happened in C++ 11 and why do I care? and has this abstract:

C++, both the language and the libraries that come with every compiler, is defined by an ISO standard. The latest version of the standard, generally known as C++ 11 after its approval last fall, was optimistically called C++0x throughout the multi-year process that led to its adoption. Many of the language changes (new keywords, new punctuation, new rules) and library changes (genuinely smart pointers, threading, and more) have already been implemented by vendors who were following the standards process closely.
In this session Kate will introduce and demonstrate many of the highlights of C++11 including lambdas, auto, shared_ptr, and unique_ptr. These are all supported in Microsoft’s Visual Studio 2010. You can see how to make your code more readable and expressive, easier to update, more correct (less bugs and memory leaks) and faster, not by trading off among those possible constraints but by adopting modern C++ which gives you improvements in all four areas at once. If you’ve been ignoring the Standard Library, for example, you must see how lambdas make all the difference and open a world of productivity to you.
A sneak peek of the next version of Visual Studio will show you even more C++11 goodness.

If you've looked at my Pluralsight courses, you'll know that my biggest challenge is going to be fitting this into an hour plus Q&A. This will be an overview, an overture if you like, and should whet your appetite for the meetings to come!

Please register as soon as you can, please spread the word, and I hope to see you there!

Kate
Monday, 26 March 2012 08:29:02 (Eastern Standard Time, UTC-05:00)  #    
# Friday, 23 March 2012

My C++ precon, an all-day session about modern C++, has had a slight title change and is now called PRC08, C++ in Visual Studio 11: Modern, Readable, Safe, Fast. The content is still the same. My high level outline is:

  • 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
  • Best practices for C++ developers today
This is all day the Sunday before Tech Ed Orlando starts, June 10th. You don't have to be registered for Tech Ed to attend a pre-con. It's a great way to get caught back up on what's been happening with C++ over the last decade or so. It's really not the language you remember. I plan to show you what's fun and amazing about it. Forget all that pointer-to-pointer-to-pointer and manual memory management stuff you may remember, and get ready to see how C++ can be simple, fast, and genuinely useful in some surprising ways.

Kate


Friday, 23 March 2012 11:12:51 (Eastern Standard Time, UTC-05:00)  #    
# Wednesday, 14 March 2012
People keep on releasing interviews with me. If you're willing to listen to them, I'm more than willing to keep on talking. There's remarkably little overlap in all of these.

On The Tablet Show, Richard and Carl (yes, that Richard and Carl) asked me about C++ in this wacky new world of Windows 8. We had the usual freewheeling conversation and covered a lot of ground in 49 minutes.

For PluralSight, Fritz asked me questions about my latest course, and the industry in general. This one's just ten minutes, and there's a transcript if you'd rather read than listen.

Kate

Wednesday, 14 March 2012 14:56:58 (Eastern Standard Time, UTC-05:00)  #    
# Tuesday, 13 March 2012

In recent years the speed at which Tech Ed session recordings have appeared has increased dramatically. I can now sometimes watch a missed session while I am still at the conference, in time to seek out the speaker and ask questions if I want to. But one thing that hasn't changed is that the precons, the all-day sessions held the day before the conference starts, are not recorded. Whether you attend one or not, you can't watch afterwards.

This has two consequences. First, if you want to see what's been happening to C++ lately and why people who've ignored it for the last ten years are suddenly interested again, you have to register (Orlando, June 10th or Amsterdam, June 25th) and you have to come and listen to me live. Second, if you do that, you want to take plenty of notes because you won't be able to just watch the video again later if there was a part where you got caught up in something on Twitter and just weren't listening.

Here's what I'm going to do to reduce the note-taking burden for my attendees. (I can't speak for other precon presenters, but you're welcome to ask them.) I will put a number of useful bits and pieces for you to download, using credentials I'll give out on the day. These will include:

  • The PPT decks I will use to present, with some notes added to some slides
  • Written demo scripts for all demos with exact step-by-step instructions (occasionally, it might just say “show the for loop and explain what it is doing”, but if there is code to be added or edited, it is in the script, if there is an option to be set the exact menu choices are in the script, etc.)
  • Zip files of starting points for all the demos and ending points too

During the precon itself, I will collect Live IDs from attendees who would like to be added as a user to a subsite on  my “hosted TFS” preview page, which I am using as a sandbox. This makes it possible to play around with the new ALM features without having to get a site all set up. I am not sure what will happen to this preview site by Tech Ed time, but I’m presuming it will continue to exist all through 2012. That’s the site I intend to use during the ALM (module 2) section of the precon.

I also intend to record each demo in advance – I typically record all my talks when I’m practicing for length and I have a pretty good mike that I use for my PluralSight courses. It's not much effort to edit them so that you can use them for a reference. I would have put this in the bulleted list but I don't want to 100% promise that I'll get them all nicely edited in time. I hope to provide them.

Specifically for module 4, Best Practices, I am planning to write a short paper that makes the same points in prose – sentences, code snippets etc – and if it's ready in time, I'll bring printouts of that paper to the session (leave me a comment if you think that would be useful.) It will be on my web site eventually, but I am trying to push myself to get it written before Tech Ed so it can be at the precon.

Anything else you think would help to reduce the note-taking burden? It's a full day, and a lot of us are out of practice receiving information in pieces of that size. Let me know!

Kate

Tuesday, 13 March 2012 17:18:55 (Eastern Standard Time, UTC-05:00)  #    
# Monday, 12 March 2012
It's been a week-and-a-bit that the beta of Visual Studio 11 has been out. I'm using it more than Visual Studio 2010 at the moment - in both Windows 7 and Windows 8, and for C++ projects exclusively at the moment. (Say what you will about the C++ Renaissance, but the fraction of my consulting, writing, and coding that is C++ has taken a major uptick in the last  6 or so months.) I'm getting used to the look, and I'm certainly motivated to use more keyboard shortcuts :-)

Herb has a nice blog post that summarizes the C++ features in this release. You can read the details there, I'll just summarize briefly:
  • Complete Standard Library for C++ 11. Especially the async and threads stuff. Standard!
  • Some more language C++ 11 features. Range for is the big one here.
  • C++ AMP. You know I care about this one!
  • The continuation (.then) syntax of PPL, which makes WinRT asynchronicity much more readable.
  • Windows 8 - both C++/CX and WinRL

And there will be more coming, sooner than "Visual Studio 12" whenever that might be. There will be out of band releases with more goodies as they get finished. If you care what gets done (and released) in what order, you can tell the team. I took the survey myself - I care about uniform initialization, defaulted constructors, and then some other bits and pieces at lower priority. Since they aren't just going to gather them all up and release them a few years from now, order matters. Share your opinion, and you're more likely to get what you want.

Monday, 12 March 2012 11:09:18 (Eastern Standard Time, UTC-05:00)  #    
# Sunday, 11 March 2012

Recently the Tech Ed people interviewed me for a profile that is now live. You can read it on their blog. We are all starting to work our way towards being ready for June. The content catalogs are partially public for both Tech Ed North America and Tech Ed Europe. If you search on C++, you'll find more than just my precon, by the way.

North America:

Europe:

Who is giving those talks? Well I am doing the precons in both places - that's official. And I wrote the abstracts for the other two talks, so I'm pretty sure I'm giving those too. I would love to see you there. And if you have colleagues who are coming to Tech Ed who really don't "get" why C++ is different these days, please encourage them to join me for the all-day precon that answers precisely that question.

Kate

Sunday, 11 March 2012 13:48:45 (Eastern Standard Time, UTC-05:00)  #    
# Saturday, 10 March 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!

Kate

Saturday, 10 March 2012 14:36:17 (Eastern Standard Time, UTC-05:00)  #    
# Wednesday, 08 February 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 too.

Dive in! There's a lot to learn. And plenty of samples to play with. I'll post updates here as I go.

Kate

Wednesday, 08 February 2012 20:48:48 (Eastern Standard Time, UTC-05:00)  #    
# Tuesday, 07 February 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:

Bjarne Stroustrup: C++11 Style

Hans Boehm: Threads and Shared Variables in C++11

Stephan T. Lavavej: STL11 – Magic && Secrets

Andrei Alexandrescu: Variadic Templates are Funadic

Panel: The Importance of Being Native (Bjarne, Andrei, Herb, Hans) 

Herb Sutter: C++11, VC++11 and Beyond

Chandler Carruth: Clang - Defending C++ from Murphy's Million Monkeys

Andrei Alexandrescu: Static If I Had a Hammer

Bjarne Stroustrup and Andrew Sutton: A Concept Design for C++

Panel: Ask Us Anything! (all speakers)

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!

Kate

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...
Tuesday, 07 February 2012 12:19:41 (Eastern Standard Time, UTC-05:00)  #    
# Thursday, 12 January 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.

Kate

Thursday, 12 January 2012 10:57:42 (Eastern Standard Time, UTC-05:00)  #    
# Monday, 09 January 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:

C++ 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
  • Best 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.

Kate

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.

Monday, 09 January 2012 20:29:14 (Eastern Standard Time, UTC-05:00)  #    
# Thursday, 15 December 2011
The second part of my C++ Fundamentals course is now live on the Pluralsight site. This one covers:

  • The Standard Library - string, collections, and the like
  • Lambdas - perhaps my favourite C++ 11 feature
  • Exceptions - every C++ developer needs to understand exceptions
  • Understanding Legacy Code - here's where you'll find out how C++ earned its reputation
These four modules build on the material I covered in part 1:

  • Context - to set the stage
  • Tools - Visual Studio and Visual Studio Express
  • Fundamental Types
  • User Defined Types
  • Flow of Control
  • Operators
  • Templates
  • Pointers
  • Pointers, Inheritance, and Polymorphism
One of the things I like best about this material is that char* strings and all the special cases to deal with them don't show up until the last module of part 2. Ditto the kinds of arrays you may have first learned. The kinds of gyrations C-style arrays and C-style strings put C++ programmers through are a large part of why people think C++ is hard. With std::string, std:vector, and other goodies from the Standard Library, C++ really isn't hard. Honestly!

Kate

Thursday, 15 December 2011 16:51:31 (Eastern Standard Time, UTC-05:00)  #    
# 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!

Kate
Saturday, 17 September 2011 16:42:01 (Eastern Daylight Time, UTC-04:00)  #    
# 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);
 
    parallel_for_each(
        c.grid, 
        [=](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.

Kate



Thursday, 15 September 2011 09:15:16 (Eastern Daylight Time, UTC-04:00)  #    
# 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.

Kate

Tuesday, 13 September 2011 12:41:14 (Eastern Daylight Time, UTC-04:00)  #    
# 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.

Kate

Monday, 29 August 2011 16:08:39 (Eastern Daylight Time, UTC-04:00)  #    
# 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?

Kate

Saturday, 27 August 2011 15:53:50 (Eastern Daylight Time, UTC-04:00)  #    
# 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)  #    
# 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!

Kate

Tuesday, 23 August 2011 14:55:55 (Eastern Daylight Time, UTC-04:00)  #    
# Sunday, 21 August 2011
Here's an interesting project I came across:




The game is Mastermind, which many people already know. What caught my attention is that it's done in C++ and XAML. To quote Tyler Whitney's blog post,

The Mastermind code sample demonstrates how to create a simple Silverlight storyboard in Expression Blend 3, and then provide the code for the state transitions in Microsoft Visual Studio 2008. You can also see how to create brushes programmatically and how to add a title bar to a Silverlight-based app.

The code is on the Microsoft Code Gallery (only Microsoft Employees can publish there) and Tyler has been updating the article over the summer. Nice way to see how to combine two technologies some people would never thought have combining.

Kate
Sunday, 21 August 2011 14:41:42 (Eastern Daylight Time, UTC-04:00)  #    
# Friday, 19 August 2011
I have talked about plenty of C++0x (soon to be known as C++11 or just plain C++) features over the last little while. Here's a nice summary by Danny Kalev of the top features and why they matter. He covers lambdas, auto, the new ways to initialize instances (which hasn't been covered much elsewhere and contribute a lot to readability), suppressing default versions of functions (like constructors for example) or specifically requesting them (how cool is that?), nullptr (which I love because it eliminates a late night drinking argument about "what if someone #defined NULL to 3, would your code still work?", and rvalue references -- and those are just the language changes! His library coverage is super terse, but there are links in it if something (*cough* shared pointer *cough*) catches your attention.

There's no reason for a C++ developer to ignore C++11. This is big stuff, and reading these "what's new" lists from a variety of different people is essential for getting perspective on the changes. So read Danny's list!

Kate

Friday, 19 August 2011 13:51:01 (Eastern Daylight Time, UTC-04:00)  #    
# Wednesday, 17 August 2011
Everyone knows that C++ is the language to use when speed matters. That's just a known fact. So here's a question: if you solved the same problem in both C++ and C#, using the generally available languages (the Standard Library for C++, the .NET Base Class Libraries for C#) and you didn't happen to know which parts of those libraries weren't implemented very efficiently, just wrote your apps -- which would come out faster and by how much?

Think you know? Of course, the answer is "it depends". Debug or Release builds? Laptop or handheld device? Whose implementation of the .NET Framework are you going to use - Microsoft or Mono? What chip are you running on? Oh, and to what extent are you deliberately setting C++ options that emphasize runtime speed? Also, did you choose an algorithm with a lot of generics or templates? C++ has a huge perf advantage there, but lots of benchmarks don't use generics or templates since they are solving one specific problem.

An article on CodeProject leapt into all of this feet-first and did some measuring. Along the way, "Qwertie" proved a universal rule of the internet: nothing will get you the answers you seek faster than posting the wrong answer. Want to know the exact date Bewitched switched Darrens? Find a place that discusses old TV shows and post your belief that there was only one, or that there were seven, or whatever, and people will correct you while the ads are still loading on their copies of the page. When Qwertie posted the first version of the benchmarking article, commenters were quick to say "but you made this mistake, and that mistake, and forgot this other thing" all of which led to a much better article.

Definitely worth a read. It gets you thinking about the things that truly affect performance. Absent-mindedly deploying a Debug build is going to cost you far more performance than your language choice ever will. Using a library in a performance-sensitive situation without understanding whether the library is high-performing or not will too. It's chock full of graphs like this one:




Don't read it to find out the answer to "is C++ faster than C#?" - we already know that. Read it to find out how to make your applications faster.

Kate
Wednesday, 17 August 2011 16:59:15 (Eastern Daylight Time, UTC-04:00)  #    
# Thursday, 11 August 2011
I'm pleased to see that Kenny Kerr is writing his C++ column for MSDN again. He's also blogging again and in a recent entry, he provides some really plain-spoken advice to people looking for guidance:

  • "You can of course still use MFC but I do not recommend it as modern C++ can do a better job of supporting the Windows developer."
  • "You should never again use auto_ptr for anything."
So there! I agree with these, especially the auto_ptr one. It was an attempt at a smart pointer that just wasn't smart enough. We have shared_ptr and unique_ptr now and they work in collections and are truly smart pointers. Use them and stop typing delete in your code entirely.

As for MFC, it does fill a need and I certainly wouldn't scrap a working MFC app just because the library is getting old (the facelift a few releases ago helped) but if I was starting a brand new application from File, New Project I would need a good reason to use MFC as my UI framework.

Kate

Thursday, 11 August 2011 13:29:29 (Eastern Daylight Time, UTC-04:00)  #    
# Monday, 01 August 2011
I consider myself a pretty skilled debugger, and reasonably familiar with the things you can do in Visual Studio (My Visual Studio course Part 1 and Part 2, for example.) Conditional breakpoints, tracepoints in C++ and in C#, breakpoints that only break every 10th time they're reached, customizing the data tip that shows when hovering over one of your own types, making data tips transparent, and plenty more have all been covered here in the blog over the years. But I still come across things I didn't know before, or didn't try before.

Take this blog post by "Daan-Nijs" about the abilities of the watch window. I knew the first one, but the rest are new to me:

  • Changing a value in the watch window
  • Changing a type in the watch window
  • Inspecting an array in the watch window
Then there's re-running or skipping code by dragging the instruction pointer - I only knew I could right click somewhere and say Set Next Instruction. Finally he includes a reminder of how to enable Edit and Continue. All this is for C++, but you're welcome to give some of the techniques a try in other languages and see what happens. Being a faster and more productive debugger will rocket you up the overall productivity leagues like nothing else.

Kate

Monday, 01 August 2011 11:57:45 (Eastern Daylight Time, UTC-04:00)  #    
# Friday, 29 July 2011

Since Tech Ed came and went during my blogging hiatus, I didn't get around to providing links to some of the sessions you might want to see. It's time to correct that omission:

There were other sessions I attended, including a great interactive session that was not recorded called "C++ Renaissance at Microsoft: How the C++ Developers Can Get Involved" with plenty of conversation between Microsoft people and native developers. You might want to do a little searching on the main Tech Ed Video site to see what interests you.

Kate

Friday, 29 July 2011 17:51:36 (Eastern Daylight Time, UTC-04:00)  #    
# Wednesday, 27 July 2011

Today saw the release of the first episode (naturally, Episode 0) of GoingNative on Channel 9. As the introduction says:

GoingNative is a new, monthly show on C9 dedicated to native development and native developers, with an emphasis on modern C++.

You know there's been a lot of talk about the C++ Renaissance. I'm happy to see that phrase get picked up, and I've got another one for you: Modern C++. Or as some folks like to say "not your father's C++". If you think C++ means manual memory management, strings as arrays of characters and a strange cast of global functions, and longing for a library or framework that might rival what .NET has to offer, then you haven't been keeping up with C++. The good news is that it won't take you long to catch up - shared_ptr and unique_ptr, the Standard Library, lambdas and other Modern C++ goodies are easy for both managed developers and longtime native developers to learn.

In Episode 0, Charles Torre (longtime C++ friend) and Diego Dagum (C++ Community lead, blogger, and Tweeter) lay some groundwork and, of course, show code. It's always about the code, right? Then, they ask you to get involved. Whether you're someone who wants to learn about C++, or someone who wants to make sure something about C++ gets taught to others, speak up! And yes, that includes topics on non-Microsoft platforms. Email C9GoingNative - they're using hotmail - or on twitter, follow or talk to @C9GoingNative. (There's a Facebook group, too - whatever way you like to interact is welcome.)

But wait, did that sound like a whole episode? Nope, they grab the camera and head over to see Ale Contenti - one of my favourite team members and one I've done interviews and sessions with before. His talk gets technical fast, which is one of the things I like about him! I too have a soft spot for 6502 assembler :-) and find template meta-programming a bit of a write-only technique. I, too, like "the power the language gives you to make the language bigger with libraries" and think that's part of the appeal of C++ for me. Well, that and the power and performance and control, of course. Are there downsides? Well, there's what Joni Mitchell called "the crazy you get from too much choice" - C++ gives you many ways to do everything, according to your circumstances, and having to decide how to do it, or having to connect two components that made different choices about something as simple as how to represent a string, can be frustating. As well, it's great to be in control, but that does mean that nobody is looking after you. If you're inexperienced (and sometimes, even when you're not) you can make dangerous choices and, as we like to say, shoot your foot off. Security holes and vulnerabilities are important and C++ will let you write bad code, so you need to be aware of best practices. Both Ale and Diego address these points, and you can expect to see more of that in time to come - especially if you ask for it!

Looking forward to next month's show already,

Kate

Wednesday, 27 July 2011 19:55:44 (Eastern Daylight Time, UTC-04:00)  #    
# Saturday, 23 July 2011
So, you're a C++ programmer? You've written a Windows app or two in your time? Let me propose a little challenge to you. Write one. Only start with File, New and don't let Visual Studio generate any code for you. Write each line of it. Then explain it. No MFC, No ATL. That's what was asked of me a while back, and the result is a six-paper series that has finally arrived on MSDN.

I have to say I really enjoyed the simplicity of the smallest Windows program possible. I also enjoyed making it better, which included making it more of a C++ program and less of a C one. I also covered a little Direct2D, a little COM, and a little "here's some other stuff you're going to want to read." If it's been ages since you wrote a Windows program in C++, or wrote one that wasn't all covered in barnacles from frameworks and libraries you might not want to rely on for simple things, I really suggest you give this series a read - it won't take long and you can use Visual C++ Express if you like - the first chapter includes links and instructions for getting all the tools you need. Better still, if you've never written a Windows in C++, why not give it a try and let me know what you think?

Kate

ps: Never blog that you're not blogging. Never blog about why you're not blogging, no-one cares. Just blog. Right?

Saturday, 23 July 2011 00:39:47 (Eastern Daylight Time, UTC-04:00)  #    
# Saturday, 02 April 2011

Here's yet another C++ team member on Channel 9. Boris starts out reviewing some "old days" things including the Intellisense background I pointed to recently. He explains in more detail why it's so hard to be the C++ team, needing to build an IDE for a language they can't control and that is used by such widely different people. I love that Boris appears to have framed and hung on his office wall someone's comment on a blog post. If you ever wondered whether what you type can make a difference, there's your answer.

With the history and reminiscing out of the way, Boris warms to a topic I haven't heard on Channel 9 before (though I have been hearing it in person) and that's the importance of C++ and specifically the Microsoft toolset, Visual C++, to the games industry. He also talks about how the games industry can be important to all the other developers as well, which I find intriguing. Definitely worth watching and not a rehash of the other C++ videos you may have seen lately.

Kate

Saturday, 02 April 2011 11:07:01 (Eastern Standard Time, UTC-05:00)  #    
# Sunday, 27 March 2011
The screencasts for restart and recovery in native and managed code went live before the associated recipe was published. Now the recipe is on Code Gallery ready for you to use. As it says there:

This recipe provides guidance and an easy way to start using these great features in your application, removing any complication of how and where to store your application data.

What’s in the box?

This Restart and Recovery recipe includes:

  • Complete source code of the recipe and its samples
  • Managed .NET assembly
  • C++ header and class files to be included in your C++ application.
  • C#, and C++ test applications
  • Documentation
Give it a try, please!

Kate

Sunday, 27 March 2011 07:21:53 (Eastern Standard Time, UTC-05:00)  #    
# Friday, 25 March 2011
Charles was busy during MVP summit! In addition to interviewing me, he sat a number of MVPs down to talk about C++, being an MVP, and the like. They're from all over the world and they have widely different jobs, but you can see how much they love this stuff. And please notice -- they span a wide age range, too. The stereotype of C++ as the language for the grey haired developers is just a myth. If you wonder why anyone still uses C++, and why it's going to be very good for this industry that there are still C++ experts around, watching these videos will be an eyeopener.

By the way, Alon is also an RD.

Kate

Friday, 25 March 2011 07:15:03 (Eastern Standard Time, UTC-05:00)  #    
# Wednesday, 23 March 2011
As you may have noticed the C++ team is really stepping up the communication lately. There have been hours of Channel 9 videos (I pointed you to some good ones) and Diego has been blogging a lot. Recently he did a long post (with references!) on Intellisense in C++/CLI - why it wasn't in Visual Studio 2010, why it didn't sneak in with SP1, and so on. Here's a level of transparency you just don't see these days:

...we simply underestimated the amount of work it would take to implement C++/CLI in this codebase, and we couldn’t change our plans by the time we realized it. ... In the end it was one of those hard cuts you have to make when dealing with the real world resource and schedule constraints. It turned out that the work was also too much work to fit into SP1. As soon as we wrapped up VS 2010, we started work on C++/CLI IntelliSense, but it wasn’t ready in time for SP1. We realize this wasn’t what you wanted to happen and an explanation doesn’t help you get your work done if you are affected by this, but we want you to know the truth.

Wow. Makes perfect sense and is actually a nicer reason than "we think you don't matter". Yet so few teams will hold their hands up and say this. It happens. It happens to every one of us pretty darn regularly. Kudos to the C++ team for not pretending it was all part of a plan from the beginning to leave it out. And do read the blog to understand just how much they were taking on.

Kate


Wednesday, 23 March 2011 07:04:54 (Eastern Standard Time, UTC-05:00)  #    
# Saturday, 19 March 2011
I'm on Channel 9 a lot right now - partly because some things are getting published that were done a long time ago, and partly because being on campus for the MVP Summit makes it convenient to be interviewed. I love talking to Charles because he really cares about the answers to the questions he asks. So we talked for half an hour about what it means to be an MVP, what C++ is useful for, what I like about C++0x, and that sort of thing. Since Charles started things off by mentioning previous conversations, let me toss in some links to those too - here's the Barcelona conversation (backstory here)and on the couch with the C++ guys (shorter backstory.) You can watch my hair change colour if you watch those oldest-to-newest. Diego was also nice enough to blog about this interview, too, as was John Bristowe of Microsoft Canada.

Thanks for the chat, Charles!

Kate

Saturday, 19 March 2011 19:51:23 (Eastern Standard Time, UTC-05:00)  #    
# Thursday, 17 March 2011

Here's another pair of screencasts to simplify your Windows 7 development. Both cover Restart and Recovery - one is for native developers and the other for managed. As the screencast intros say:

Application Recovery and Restart (ARR) technologies enable developers to customize an application's behavior when Windows Error Reporting(WER) terminates the application due to an unrecoverable error. For example, it enables an application to perform data recovery and cleanup operations such as capturing application state and releasing resources before termination. It also allows developers to specify that WER should automatically restart an application that it has terminated.

I hope they help you do the right thing when your application blows up or the machine reboots.

Kate

Thursday, 17 March 2011 19:38:55 (Eastern Standard Time, UTC-05:00)  #    
# Tuesday, 15 March 2011

You know I blog here a lot about Windows 7 goodies including taskbar integration. One of the questions I get pretty often is how to use tasks to communicate with the running app, such as changing your status, sending a new email, that sort of thing. I mentioned in an aside on another post that this requires launching some other application that communicates with the first instance.

If you'd like to do that, it just got a little easier with the release of a "recipe" from Microsoft that packages up this concept and lets you use it with very little extra code. As it says on the Code Gallery page for the recipe:

This Taskbar Single Instance Recipe allows developers to easily develop applications that use "Messenger Like" tasks that change the state of the currently running instance, allowing it to react to incoming state-change notifications and act accordingly.

This Recipe includes:

  • Native (C++) and managed (.NET) Source code for the Single Instance library
  • Well documented native (C++) and managed (.NET) samples
  • Documentation

To compile and run the recipe and samples the following items are required:

  • Microsoft Visual Studio 2010
  • Windows 7 – Note that only the samples require Windows 7. 

Yes, this recipe is actually two recipes - one native and one managed, and comes with whitepapers explaining how it's done. I mentioned this in my Tech Ed Europe talk on Advanced Windows 7 development and it's finally released for you to use! Enjoy!

Kate

Tuesday, 15 March 2011 19:18:48 (Eastern Standard Time, UTC-05:00)  #    
# Sunday, 13 March 2011

Whenever new stuff appears in the Microsoft universe, native C++ developers can get to it first. That's because they can easily call Windows APIs or COM interfaces or however it's implemented. Managed developers need to wait until the new stuff gets added to the .NET Framework or to a particular managed technology, like WPF. Take taskbar integration, for example: adding tasks and destinations, getting a progress bar or icon overlay on your taskbar icon, and so on. From the very beginning you could interact with the taskbar from native code by making Windows API calls. The Code Pack is a popular managed wrapper from Microsoft that enables those interactions from managed code such as Windows Forms applications. In the early days of Windows 7, WPF developers also used the Code Pack - but now those capabilities are in WPF itself.

Does that mean that native developers get nothing new? On release day they gain the ability to call those APIs and that's that? Of course not. Native developers use frameworks and libraries to build their applications, and those frameworks and libraries in many cases are wrappers for Windows functionality. One of those is MFC and you should know that MFC has support for Windows 7 functionality.

If that's news to you, then watch my screencast on Channel 9 in which I cover jumplists and overlays with lots of demos. It's just one or two lines of code for each of these. Users expect their apps to behave like this. MFC makes it simple.

Kate

Sunday, 13 March 2011 18:58:23 (Eastern Standard Time, UTC-05:00)  #    
# Wednesday, 09 March 2011
I have two sessions in Atlanta:

DEV303 | Modern Native C++ Development for Maximum Productivity

Breakout Session  |  300 - Advanced  |  Developer Tools, Languages & Frameworks

C++0x, the next C++ standard, is almost upon us and it contains the most important updates to the language since the mid-90s. These new features bring more expressiveness and power to the native C++ developer. Microsoft Visual Studio 2010 has added support for some of these key features in order to enable these modern programming techniques. This session clarifies what features are in Microsoft Visual C++ 2010 and what is yet to come. It illustrates how new constructs such as lambda expressions enable better use of existing libraries and how your code can be simpler, safer and faster all at the same time. Also, see how simple it can be to implement concurrency in your application and how Visual C++ 2010 supports the difficult task of debugging parallelized code. If you are itching to show off how C++ is one of the coolest languages on the planet, this talk is for you!
 

DEV304 | Advanced Programming Patterns for Windows 7

Breakout Session  |  300 - Advanced  |  Developer Tools, Languages & Frameworks

Windows 7 development in managed code can be very simple, especially for those using the Windows API Code Pack. But there's more! Your integration with Windows 7 doesn't have to be limited to simple interactions with the new API. This session goes beyond the simple and into aspects of Windows 7 development that have in the past been left for you to explore on your own. See how to create a jumplist with a task that delivers a command to your application, as Messenger and Outlook do. Explore a simple and powerful recipe for connecting to Restart and Recovery with minimal effort. Discover how Trigger Started Services can reduce your power footprint while giving your users better responsiveness. Explore all that libraries have to offer beyond "File Open" and why using a library is a better approach than having a user setting for "save directory."

I'm looking forward to it. If you haven't registered yet, you should!

Kate

Wednesday, 09 March 2011 21:42:23 (Eastern Standard Time, UTC-05:00)  #    
# Monday, 07 March 2011

There are thousands of MVPs chosen by Microsoft for their contributions to technical communities. Eric Ligman says there are over 4,000 and I believe him. So of course nobody could choose a single "MVP of the year". There are several dozen this year, chosen from various technical areas and also for reasons that transcend a single technical area. I was delighted and honoured to be among them this year, and even more so to be joined by two of my fellow MVPs. To quote from an email telling us about it:

...the new 2010 C++ MVPs of the Year are

  • Kate Gregory, for her very active role in promoting modern C++ application development, being among top speakers in some prominent conferences. Kate was also selected by peers (you guys) as C++ MVP of the Year.
  • Marius Bancila – Ovidiu Cucu (shared), for the great job in CodExpert, their C++ community site (in Romanian language).
  • Sheng Jiang, one of the top answerers in our MSDN Forums.
Is that amazing company or what? We were invited to dinner with a number of MS executives and the other MVPs of theyear during the MVP Summit. Here's a picture of us with Diego, the Visual C++ Community PM:




It was a great evening and it was nice to see C++ well represented.

Kate
C++ | MVP
Monday, 07 March 2011 21:16:34 (Eastern Standard Time, UTC-05:00)  #    
# Saturday, 05 March 2011

The pace of C++-relevant video releases on Channel 9 sure feels like it's increased. I watched a few recently (I download them and then watch them in my copious free time) and they happen to fit well with some links I've been carrying around for a while, meaning to share.

Let's start with Herb Sutter talking with Erik Meijer about C++ and whatever else they felt like talking about. The resulting Channel 9 video is a must-watch, and for once I didn't crank it to 1.5x or 2x speed as I usually do with video interviews. When they get into the part about deriving future<T> from T, you might want to pause it and go read Thomas Petchel's post on automatic type deduction. And during the lambdas-and-closures part, let me recommend a quite old post by Eric Lippert and a followup to it that discusses how these things work for C# and how it's a little different in C++.

Then another two-smart-people talk, with Mohsen Agsen and Craig Symonds. It's great to get the high-level perspective of the value of C++ to any software firm. I love that phrase, dark matter, and you may have heard it from me before. After you've watched that one, you need to go immediately to Tony Goodhew's interview where he puts some numbers out that will drop your jaw.

I know, I'm asking for like 2 hours of your life. Even if you don't develop in C++ any more, you should watch these three videos. You really should. Call it industry research if you like. And if you wish you knew a C++ developer, you do :-)

Kate

Saturday, 05 March 2011 11:49:44 (Eastern Standard Time, UTC-05:00)  #    
# Sunday, 27 February 2011
Here's an interesting blog post. Say you use MFC and are wondering whether anything was added to it in a particular release. What tool would you use for that? How about CppDepend? If you've never used it, seeing how it provides the illustrations for this post should show you the appeal of it. Either way, you're going to learn something.

Kate

Sunday, 27 February 2011 22:11:52 (Eastern Standard Time, UTC-05:00)  #    
# Friday, 25 February 2011
Pete Brown is a WPF guy and I've learned a lot from him. Now I get to watch him learn. Recently he wanted to write an add-in for IE and he decided to do it in C++. You can see how he struggled through it and get some tips of your own in the detailed post he wrote about the experience. I agree with the commenter who said you should only run Visual Studio as admin when you know you're going to do a step (like registration) that requires elevation, and you should run non-elevated the rest of the time, and the one who tweaked the string code to take advantage of being in C++. If you have some tweaks of your own, stop by and add a comment.

Kate

Friday, 25 February 2011 18:20:58 (Eastern Standard Time, UTC-05:00)  #    
# Tuesday, 15 February 2011
Did you watch the whole "Introduction to STL" series on Channel 9? As I said when part 10 appeared, there is no universe in which this series is really introductory. So when I tell you that Stephan has now started an advanced series, you need to take it seriously. Here's how Charles entices and warns us:

This series, Advanced STL, will cover the gory details of the STL's implementation -> you will therefore need to be versed in the basics of STL, competent in C++ (of course), and able to pay attention! Stephan is a great teacher and we are so happy to have him on Channel 9, and C9 is the only place you'll find this level of technical detail regarding the internals of the STL. There are no books. There are no websites. This is Stephan taking us into what is uncharted territory for most of us, even those with a more advanced STL skill set.

Me, I'm enticed. And I'm watching. You should be too. (But watch the first ten first, or the minute you start to feel lost.)

Kate

Tuesday, 15 February 2011 20:52:02 (Eastern Standard Time, UTC-05:00)  #    
# Sunday, 13 February 2011

I've written about "banned APIs" before - let's start with this link and if you read it, it has a link to a previous post, and go on and follow that link and it has a link to a previous post and so on and so on. To summarize, there are three ways to ensure you are not using banned APIs in your C++ app:

  • You can use the extension I blogged about. It highlights places in code you're editing or typing that calls a potentially unsafe function. That's great if you're typing fresh code,not so great if you just inherited a million lines of C++ and aren't sure if it's vulnerable to buffer overflow attacks.
  • You can compile with /W4, and deal with all the C4996 warnings (and use code analysis or code review or generally find the places that someone has suppressed that warning.)
  • You can include banned.h, which controls whether these unsafe functions are marked deprecated or not
None of that has changed. What I wanted to point out was a recent blog entry from the SDL team alerting us that banned.h has been updated, and I also spotted a video on TechNet (why a developer-focused thing is there I don't know) that shows it in action. If you write C++ code, you should be using one or more of these techniques.

Kate
Sunday, 13 February 2011 20:44:32 (Eastern Standard Time, UTC-05:00)  #    
# Wednesday, 09 February 2011
At the end of January, the busy bees at All-in-One (OK, they're not bees, they're Microsoft engineers) released even more samples including Azure, setting a hotkey that Windows will route to your app even if it doesn't have focus, detecting if the machine has been locked (with Windows+L) or unlocked, downloading multiple files with ftp, and many more. As always these are in VB, C#, and almost all of them are also in native C++.

In fact, there are just so darn many samples right now that it's getting harder to find the one you want. What a great problem to have! So they've released a sample browser to help you search and browse and generally get your hands on the code that will solve your problem and move you on to the next part of your day.

What are you waiting for? Go get it!

Kate

Wednesday, 09 February 2011 11:41:05 (Eastern Standard Time, UTC-05:00)  #    
# Monday, 07 February 2011
The architectural tools in Visual Studio Ultimate are fantastic. Often, people think they're just for for managed code, though. Not so! Here's a page on MSDN that shows how you can use Layer Validation to validate your architecture. You'll need the Modelling and Feature Pack and parts are a little fiddly, but it can be done!




No reason to assume the architecture tools are not for C++ developers, too.

Kate
Monday, 07 February 2011 11:08:49 (Eastern Standard Time, UTC-05:00)  #    
# Saturday, 05 February 2011
Adding concurrency to an existing application can be remarkably simple. I have a demo where I change a for loop to a parallel for and -poof!- the app gets faster. The hard part of that demo is knowing that a given loop is ok to parallelize, that it doesn't matter what order things are done in as long as they all get done once. And, of course, knowing that the loop in question is responsible for your execution time. Making the right decision is the hard part - typing the code is easy.

With that in mind, you need advice about choosing your structures and algorithms. Here are some handy things that may help you. On the native parallel programming blog they will help you choose your parallel sort. And on the VC++ blog, it's all about the parallel containers. If you're going to write parallel code (and let's face it, eventually you will) you need to read this sort of thing.

Kate

Saturday, 05 February 2011 10:42:30 (Eastern Standard Time, UTC-05:00)  #    
# Thursday, 03 February 2011
Here's a useful blog entry from Nish that shows how simple it can be to handle what at first seems an intractable problem - how to get an unmanaged array into a managed array. The marshaller doesn't know the size of the array, but as long as you pass the length as a parameter, you can create the array yourself and copy the contents over. Not hard at all, once you know.

Kate

Thursday, 03 February 2011 10:25:52 (Eastern Standard Time, UTC-05:00)  #    
# Tuesday, 01 February 2011

Like a lot of folks, I have a Windows Phone and I enjoy it a lot. I've filled it up with (free) games and they pass the time quickly when I have to wait in line or otherwise have an empty minute or two. C++ MVP Marius Bancila had the same experience, but unlike me he responded by writing a version of the game in MFC so he could play it on his own PC as well as on a phone.

You can get the source from his blog post, and another post and its comments (mostly in Romanian - Bing Translate is your friend there) have a nice discussion of performance issues. After all, whenever two or more C++ programmers gather together, someone is going to have an opinion about performance. Take a look for yourself!

Kate

Tuesday, 01 February 2011 18:45:11 (Eastern Standard Time, UTC-05:00)  #    
# Friday, 28 January 2011

Despite this rather famous xkcd comic, most developers would rather spend as little time compiling as possible:

But most of us how no clue why a build takes as long as it does, or how to make a project build faster. I mean sure a Clean and then a Rebuild will take longer than an incremental build. But beyond that, which is quicker - a debug build or a release build? Debug puts more information in, but it doesn't optimize - which wins? Does it make a difference if you keep Visual Studio up all day or if you close and re-open it from time to time? Are there options you can set that make your builds faster? All this and more is covered in remarkable detail in a new blog post from the Visual C++ team. You need to read it.

Kate

Friday, 28 January 2011 18:36:46 (Eastern Standard Time, UTC-05:00)  #    
# Wednesday, 26 January 2011
Not everyone knows that the Windows SDK includes a C++ compiler and linker that you can use if you don't have Visual Studio installed. Of course, Visual Studio Express is free, and you could use that to compile and link C++ apps. The advantage of using the tools that come with the SDK is that you don't have to install and configure a lot of stuff to get started. On a new machine that may appeal to you.

Gus Class has posted a super-quick 3 minute video that shows how to compile one of the SDK samples using only the tools that come with it. I just wanted to elaborate on one thing. The SDK installs, by default, under Program Files. As you probably know UAC prevents applications from writing to any folder under Program Files unless the application is elevated. That's why Gus launches an elevated command prompt in this video. If you don't want to elevate your command prompt, you'll need to move the sample folders and adjust your path accordingly.

Three minutes. Worth a watch. It's always good to have some tricks up your sleeve on a new machine.

Kate

Wednesday, 26 January 2011 18:25:57 (Eastern Standard Time, UTC-05:00)  #    
# Saturday, 22 January 2011
The revisions to the C++ standard, headed to producing a new C++ standard which is still nicknamed C++0x, are proceeding at their stately pace, and will for months yet. But since a number of compilers are supporting more and more of the functionality and syntax, which are pretty much locked down now, we can adopt much of it today. (I don't know why some people are running around claiming that because the standard isn't released yet, no-one should be using any of it, but when you bump into such people, you can send them to me.)

I came across an interview with Bjarne Stroustrup, the father of C++, at CodeGuru. If you're wondering why the standard is so far behind schedule, what the very first C++ developer thinks about the very newest C++ developers (undergrad students), and how risk feels to a standards committee, then you will enjoy reading this, as I did. The lambda syntax on the first page isn't quite right, but you can fix that up if you need to. There are plenty of lambda examples here in my blog.

Give it a read!

Kate

Saturday, 22 January 2011 10:52:40 (Eastern Standard Time, UTC-05:00)  #    
# Thursday, 20 January 2011
One of the things C++ developers have had for ages is a way to see a function's return value in the debugger, even if it isn't kept in a local variable. For example, see tip 29 in this list of Visual C++ tips for VC++ 6.0 - a product released 12 or 13 years ago! Managed developers would like this ability, too. Jared Parsons, from Technical Strategy Incubation, points to a set of requests, and explains why it appears that VB has it already. (And you thought VB6 legacy support wasn't going to help you!)

Take a look and see what you think. Would it be worth the possible performance hit?

Kate

Thursday, 20 January 2011 10:28:24 (Eastern Standard Time, UTC-05:00)  #    
# Tuesday, 18 January 2011
I don't think I ever linked to this Tech Ed Europe talk. Ale Contenti talked about Application Lifecycle Management (ALM) features for C++ developers. Now it's featured on the Visual C++ Blog. There are useful links in the comments, also.



I saw the talk live and I liked how personal Ale made it. If you wonder whether any large C++ projects rely on Team Foundation Server, you could hardly have a nicer example than this one!

Kate
Tuesday, 18 January 2011 10:10:32 (Eastern Standard Time, UTC-05:00)  #    
# Wednesday, 12 January 2011
Since midsummer I've been watching the "STL on STL" series accumulate on Channel 9. The lectures appeared as "part 1 of n", "part 2 of n" and so on until, in the bleak midwinter, part 10 of 10 appeared, so they must be done. Here are some links to them all:

There really isn't any universe in which the material this series covers can be called Introductory. When Stephan has finished introducing you to the STL, you will know an awful lot. And in this century, knowing the STL is a vital part of being a C++ developer. Many developers are scared of it: they think it's difficult and complicated. And to be honest, it can be. There's an awful lot going on and there is a lot to learn. Watching these videos, you can see how much Stephan LIKES this material, likes this library, and he's clearly not scared of it or trying to impress you with how difficult it is. He wants you to know all this. And if you follow along (and even do the homework!) you will catapult yourself forward in your STL knowledge and abilities. Take the time to do it, you won't regret it.

Kate

Wednesday, 12 January 2011 09:33:08 (Eastern Standard Time, UTC-05:00)  #    
# Monday, 10 January 2011

The Visual C++ team, in addition to tweeting and blogging regularly, is now accumulating a week's worth of links and stories at a time and publishing them at paper.li. If you don't compulsively check in to the C++ world every day, it can be a great way to stay in touch. Even if you do, you might discover a source you're weren't checking before. It's a little less obtrusive than other ways of sharing links, I think. Check out the C++ Weekly and the team blog post introducing it.

Kate

Monday, 10 January 2011 08:44:04 (Eastern Standard Time, UTC-05:00)  #    
# Saturday, 08 January 2011
The voting is open at the Tech Ed site for you to express your preferences on possible sessions. My experience indicates that submissions not shown here can still end up being sessions, and certainly not all submissions shown here will be accepted, but obviously a strong interest from the public in a session will increase its chances of acceptance. With that in mind I thought I'd show you the results of a few searches.

First, C++:

These have orange plusses on them because I've added them to my preferences. You'll see a grey square you can click to add them to yours.

Next, Windows 7 development. Let's try Code Pack:

And finally the intersection of WPF and Windows 7 searches (I had to crop the shot by hand, there's no handy search that returns just these):


If you want to be sure that Tech Ed USA offers sessions you'd like to attend, the power is in your hands. (Disclaimer: some - but not all - of the submissions I am showing you here are my own.) Make your feelings known. And see you in Atlanta (I hope) in May!

Kate
Saturday, 08 January 2011 10:14:11 (Eastern Standard Time, UTC-05:00)  #    
# Friday, 31 December 2010
I was lucky enough to be part of a spirited email discussion recently on the topic of exceptions. And luckier still that Diego Dagum, the new C++ Community PM, has summarized it on the VC team blog. You should enjoy reading the "best practices" we worked our way around to, like:
Most MVPs agreed that, despite not being illegal in C++, throwing primitive types like int, long, etc., or similarly Windows-based ones like HRESULT, etc. is a coding horror as inabilities to catch those in the proper place will make the application crash with a hard post-investigation to determine where they are being originated.

Of course, we ended up talking about checked exceptions, one of the things I really hated about Java personally, and RAII which is a critical way of thinking if there are exceptions flying around your app. STL joins in with a comment that could be worth gold to someone dealing with SEH:

I strongly recommend AGAINST using the /EHa compiler option. Either /EHs or /EHsc should ALWAYS be used, with /EHsc being preferable (it's faster because it assumes that extern "C" functions won't emit exceptions - while technically permitted by the Standard, sane code should never attempt to do such a thing, so giving up that ability is worth the performance gain).

And I am sure the comments will continue to grow and the conversation continue. This is how we all get better, by discussing and sharing and occasionally defending our practices. It's a must-read.

Kate

Friday, 31 December 2010 20:01:25 (Eastern Standard Time, UTC-05:00)  #    
# Tuesday, 21 December 2010
According to Darryl Taft, the top languages for next year (and this may surprise you) are going to be Java, C, and C++. You're probably all ready to disagree, but understand the criteria:

... the workhorse languages such as C and C++ continue to remain at the top end of the software development landscape in terms of language use and job potential (despite growing more slowly and even decreasing, according to some sources). Moreover, this list is not intended to highlight the hot, hip new languages on the horizon, but to focus on where programmers can go to look for work.

There's a large body of work being done in languages that are not new, or hot, or trendy, but that have been around for long enough to develop a body of developers and libraries that enable getting things done. The volume of code that will not be ported to new and exciting languages, and will be maintained in its current language for years and decades, will always outweigh the volume of code that is being written from scratch right now or being ported. If you want a job, knowing an "old workhorse" language is a good thing.

Darryl profiles 18 languages in all: Java, C, C++, C#, JavaScript, Perl, PHP, VB, Python, Ruby, Objective-C, ActionScript, Groovy, Go, Scala, Erlang, Clojure, and F#. That is an awful lot of curly brackets, a very high placement for Objective-C given that it really does only one thing, and a fair dose of hot/new/trendy once you get past the top ten. Worth a read!

Kate


Tuesday, 21 December 2010 13:50:01 (Eastern Standard Time, UTC-05:00)  #    
# Friday, 17 December 2010
It's over 200 pages long, and over four years old, but I just heard about it recently. A long, dense discussion of whether certain C++ features (templates, namespaces, RTTI, etc) have a performance cost, and how to write code that incurs as little performance cost as possible. Its official name: ISO/IEC TR 18015:2006(E)  Technical Report on C++ Performance. In addition to runtime performance, it also touches on compile slowness, the "brittle base class" problem, and the different performance characteristics of various STL collections and algorithms. If you care about the speed of your C++ code, you should read this, even if some of it is already familiar to you.

I'd like to give some kind of "Restrained Understatement" award to this sentence:

Template meta-programming  and  expression  templates  are  not  techniques  for novice programmers, but an advanced practitioner can use them to good effect.
To be clear about where these authors are placing the "advanced" bar, I don't use meta-programming, I consider it too advanced for me. And I have 20+ years of C++!

The whole report is platform independent (though embedded systems are discussed separately) and compiler independent, too. I wish it were updated for C++0x, but I guess that will have to wait until C++0x is settled :-). There's a 14 page bibliography, and you would do well to read many of them, though my source for the link winkily pointed out another possible paper. That one is old enough to get a driver's license, but I think you might enjoy reading it anyway. As the introduction begins:

It is important to understand how your programming language is implemented. Such knowledge dispels the fear and wonder of “What on earth is the compiler doing here?”; imparts confidence to use the new features; and provides insight when debugging and learning other language features. It also gives a feel for the relative costs of different coding choices that is necessary to write the most efficient code day to day.
It's only 23 pages long, and concludes:
... we have considered many of the significant C++ run-time implementation issues. We see that some wonderful language features are almost free, and others can incur significant overhead. These implementation mechanisms are applied quietly for you, behind the curtains, so to speak, and it is often hard to tell what a piece of code costs when looking at it in isolation. The frugal coder is well advised to study the generated native code from time to time and question whether use of this or that particularly cool language feature is worth its overhead.
Good advice, in 1994 or 2010.

Kate

Friday, 17 December 2010 11:34:31 (Eastern Standard Time, UTC-05:00)  #    
# Wednesday, 15 December 2010
Those hardworking elves at the All in One Code Framework keep releasing more samples. They've added some ASP.NET samples (including a very interesting "get location from IP address" one) and some Windows 7 shell extensions, specifically a preview handler. Ah, the good old .recipe file type - an old friend of mine. But as always the samples are going to save you hours and hours of time.

Here's an index to all the samples for you to explore. You might be a little astonished if you haven't checked it out before, they have:
Slowly but surely the samples are accumulating to live up to the name. This should be the first place you look when you want to take on a new task. Generally speaking, everything is available in native C++, C#, and VB (the exceptions are things you can't do in native C++, like ASP.NET) with the language included in the sample name (look at CppWin7TriggerStartService, CSWin7TriggerStartService, and VBWin7TriggerStartService for example.) And remember, if you don't see what you want - you can ask for it!

Kate

Wednesday, 15 December 2010 10:57:52 (Eastern Standard Time, UTC-05:00)  #    
# Saturday, 11 December 2010
Back on December 7th, Jason Zander announced the beta of Service Pack 1 for Visual Studio 2010. December announcements can often go un-noticed, but you should pay attention to this one. You can get the beta and start using it in production immediately.

What's in it, and why does a service pack matter, anyway? Well this one brings Silverlight 4 Tools for Visual Studio "into the box", updates some MFC capabilities, and fixes things people raised on Connect. (Remember, complaining about missing features or bugs to your cubicle mates may make you feel better, but raising them on Connect gets them fixed. I should know, I submit things there and they get fixed.) STL has a comment on the VCBlog post that spells out many of the fixes in detail.

Take a few minutes and update your Visual Studio, especially if you're a C++ developer, whether MFC or C++0x (or both, of course.)

Kate

Saturday, 11 December 2010 10:17:49 (Eastern Standard Time, UTC-05:00)  #    
# Thursday, 09 December 2010

Herb Sutter has blogged a "trip report" (except he didn't travel, but anyway) about the November meeting of the C++ Standards Committee. In it, he tells us:

Things are going well and we are on track to complete the Final Draft International Standard (FDIS) for the C++0x standard after the Madrid meeting in March. If that happens and that ballot succeeds, the C++0x standard will be published in 2011.

There are still decisions being made, and I have to say I like the way they're going. I think contextual keywords are wicked smart, and that if compilers can understand them, developers sure can. Compare Herb's two examples:


class [[base_check]] Derived : public Base {
public:
virtual void f [[override]] ();
virtual double g [[final]] ( int );
virtual void h [[hiding]] ();
};
class Derived explicit : public Base {
public:
virtual void f () override;
virtual double g( int ) final;
virtual void h() new;
};

Contextual keywords make the second option possible, and I think it's much better. You can also read about noexcept and the whole exception-checking backstory, as well as rules for generating move constructors and move assignment operators. It's all good.

Kate

Thursday, 09 December 2010 13:24:29 (Eastern Standard Time, UTC-05:00)  #    
# Sunday, 05 December 2010
I finally caught up some of my PDC-watching and really enjoyed this Herb Sutter talk on C++0x lambdas. I'm well known to be a huge lambda fan. Herb made this talk enjoyable for me by bringing his personality to the table. He showed aspects of C++ that are not exactly elegant, and how using lambdas can make some much neater code possible. Sure, lambdas are "just" syntactic sugar, but they add up to a new way of thinking about writing applications in C++. Well worth watching.

One warning though - I generally download videos and watch them at 1.5 or double speed. I highly doubt you want to do that with this talk - it's dense!

Kate

Sunday, 05 December 2010 11:59:12 (Eastern Standard Time, UTC-05:00)  #    
# Friday, 03 December 2010
Kenny Kerr is back in Canada and back writing about C++. Like a lot of us these days, he's looking at a stripped-down, more modern way to write Windows applications in C++ - no MFC, no ATL, no WTL. Plenty of STL and new C++0x features. I like it! Here's the first installment - stay tuned for the rest of them!

Kate

Friday, 03 December 2010 11:53:59 (Eastern Standard Time, UTC-05:00)  #    
# Wednesday, 01 December 2010
Lately there's been quite a lot of interest on programmers.se about interview questions, and specifically the "coding at the whiteboard" part of the interview. It came up in a discussion of FizzBuzz, in one about "testing" your whiteboard code, and in one about question 11 of the Joel test.

I ask candidates to code at the whiteboard. I ask an intensely simple question, because I am mostly testing for things other than the actual code the person writes. I know, however, that there are places that actually want you to tackle reasonably challenging problems. I came across this blog entry by Diego Dagum (who edits The Architecture Journal, writes architecture columns, and is committed to native C++big time) that walks you through a C++ whiteboard problem that is decidedly non-trivial. What I found interesting is that he starts his "thinking aloud" the same way I would, but then when I would start writing something that worked for valid input, he first started to set out examples of invalid input. And when he wrote the code, it starts by rejecting various categories of invalid input before processing anything. It's cool to see someone thinking differently from me.

One thing really struck me. He spends over a page on the signature of his method - why he called it rtoi, why it returns an unsigned int, why its argument is const, whether it should take a  unicode string or not, why an STL string and not a char*. See how much these problems reveal about a person? That kind of care and precision is not something you can discover by asking a person "how important is it to you that a method signature is chosen with care? Can you give me some examples of naming methods you have done?" Coding in a job interview is about so much more than syntax. Are you prepared for the whiteboard?

Kate

Wednesday, 01 December 2010 21:59:11 (Eastern Standard Time, UTC-05:00)  #    
# Saturday, 27 November 2010
People say you can't get unit test support from Visual Studio for native code. That's not strictly true. Your tests will need to be managed code, but that doesn't mean the code you're testing needs to be.

As I hope you know, it's super easy to call native C++ code from C++/CLI - include the header, link to the lib. So here's the deal. Make yourself a lib that holds all the code you want to test. This can be completely native code, no problem. Build your UI (or your web services layer or your service or server or whatnot, I don't mean by UI an actual interface that a user clicks and types to, I just mean the part of your app that consumes your business logic) in native code if you like. Or in managed code, that's cool too. Then create a C++/CLI test project that includes the header for the logic, and links to the lib. There you go.

For the gory details including precisely what menu items to select and how to set up the project, John Socha-Leialoha has you covered. I love his conclusion:

After so many years writing in C#, I never thought I would enjoy C++ programming again. I was wrong. Using TDD to write C++ code is almost as nice as writing C# code, and I’m really enjoying the experience.

Kate

Saturday, 27 November 2010 14:20:05 (Eastern Standard Time, UTC-05:00)  #    
# Friday, 19 November 2010
One of my track chairs at Tech Ed Europe was Christian Binder. Christian always makes sure there is C++ content at Tech Ed Europe and this year he sat down with Ale Contenti to talk about Microsoft's commitment to C++, which is stronger than ever right now. You might be a little surprised to hear C++ called "the innovation language" but c'mon - if a new API is added to Windows, you can just use it right away from C++, but from some other languages you might have to wait for something to be released that will help you, right?

Christian blogged about the interview in German, but the interview itself is in English. Worth a listen!

Kate

Friday, 19 November 2010 16:48:05 (Eastern Standard Time, UTC-05:00)  #    
# Saturday, 13 November 2010

Wow, these things get up there fast! My sessions were very well received and I had such a great time doing them! In the order I delivered them, they are:

  • Women In Technology Panel - Claudia Woods, Freena Eijffinger, Paula Januszkiewicz, and Rhonda Layfield joined me to take questions from the audience and talk about what was on everyone's mind. There's really no video - just the title slide for the whole hour. Please listen!
  • The Windows API Code Pack: Add Windows 7 Features to Your Application - This one includes screen capture so you can follow along in the demos. You can also download the powerpoints from this page, and as I mention in the talk, the demo code is the samples that come with the Code Pack.
  • Modern Programming with C++0x in Microsoft Visual C++ 2010 - I had a great time delivering this talk even though it was the first time I delivered this version of it. The attendees responded by putting the talk in the top ten for the whole conference - thankyou! It, too captures the screen and slides, and you can download the powerpoints.
  • Advanced Programming Patterns for Windows 7 - Another talk I was doing for the first time and I enjoyed it too. If you'd like the sample code, stay tuned - I will blog when the recipes are released. The slides are with the video of the screen and slides.

If you came in person, thank you! If you couldn't be there, please watch the videos and leave me a comment. Speaking on technical topics really is the most fun you can have standing up, and I can't do it without audiences.

Kate

Saturday, 13 November 2010 08:41:15 (Eastern Standard Time, UTC-05:00)  #    
# Friday, 05 November 2010

You may have noticed that the fall tour I'm doing features morning talks that go till about 11:30, and evening talks that start at 6pm. I've decided that between those two, I'll spend the afternoon in a coffee shop and host an "on the road coffee and code". As I explain on the Coffee and Code page I keep for this purpose, this is really informal. Just stop by, say hi, we can talk about whatever you like. If you were at the morning session, you might want to just walk with me from the venue to the coffee shop and continue the conversation. Or if you're coming to the evening session, you might want to try to find me during the afternoon to ask something specific, then head to the venue together. Or maybe you have a topic to discuss that has nothing to do with Building Awesome Windows 7 Applications in managed code: a C++ question, or an extending Visual Studio 2010 question, or whatever. That's great, and the Coffee and Code format is just the place for us to have that chat.

Levitating coffee cup from microsoft.ca/office  Ancient laptop from microsoft.ca/office

If you live or work near the venues for the fall tour, I'd appreciate your suggestions (by email or twitter) for where to hold these. Obviously we need wifi, power, and a table we can hog for most of the day. My default choice is Starbucks, but if you know a better one that I can easily walk to, please tell me about it. Once I've chosen the location I can finalize the times.

Looking forward to meeting everyone,

Kate

Friday, 05 November 2010 11:10:46 (Eastern Standard Time, UTC-05:00)  #    
# Monday, 01 November 2010

Here's something that happens to me a lot. I'm working on a project that is mostly Technology A, but I need a little Technology B. I want a sample or two to show me what it can do. I search the web, but often find mostly things written by people who don't know what they're doing and are posting their (possibly flawed) code into question-and-answer forums. I search MSDN, but often the newest technologies don't have their samples yet. I also remember to check if the All-in-One Framework people (I blogged about their coding standards document earlier) have anything. And if I still get nowhere I start asking people I know if they have one.

Well, now those helpful folks at All-in-One are kicking it up a notch. And remember, they cover all technologies and languages related to Microsoft tools. (Want to know more about them? Here's a fun video.)

And this goes back to one of my earliest blog posts - what you want may be what I need to give. Imagine it's your job to decide what samples to write. How are you ever going to find out what developers out in the big wide world want samples of? You could come up with a great idea and then find out people already had all the samples they needed for that. So that person wants ideas for samples. And here you are needing a sample. See how that works?

Just visit the wiki page and follow their instructions. It's a tad more complex than "shoot me an email and tell me what you need" and for good reason. Give it a whirl if there's something you need!

Kate

Monday, 01 November 2010 10:40:23 (Eastern Standard Time, UTC-05:00)  #    
# Sunday, 24 October 2010
Hilo, the reference application project from the C++ team that doesn't use MFC or the .NET Framework, is back with another sample. You've seen nice graphics in the way photos are treated, a ribbon UI, and now you can see social media integration with Flickr uploads, touch support, and Windows 7 jumplist support. And remember, all the code is available for you to explore and learn from.



Take a look and see what you think. If you want to know how to build a modern UI and a modern set of functionalities (like web services) then this is the reference application for you.

Kate
Sunday, 24 October 2010 14:23:59 (Eastern Daylight Time, UTC-04:00)  #    
# Friday, 22 October 2010
The wheels of the standards committee, I have said more than once, do grind slowly, but exceedingly fine. Apologies to probably Longfellow, though I might be mistaken. Anyway, progress continues on the next version of the standard and there are some details still to settle. Anthony Williams has written a nice summary of the October Mailing (in preparation for a November Meeting) along with some helpful links. He points out that generating move constructors (as compilers do today for copy constructors), as required by the Final Committee Draft (FCD) could break some existing code, so discussions are planned on restricting (or dropping) this implicit generation. I  like knowing that people are putting this level of thought into language changes instead of just issuing a Breaking Changes list and expecting me to go edit my code accordingly.

He also highlights situations where people are deliberately throwing exceptions from a destructor (gasp! I know!) and their working code will break unless they change it say they intend to throw exceptions from their destructor. You would think that this was a tiny population of people, and that marking their code in this way is no big deal, but C++ philosophy is that working code with defined behaviour should continue to be working code with defined behaviour in the latest version of the language. As you can see, that can really be a challenge sometimes.

If you're a C++ person, I challenge you to read the papers Anthony links to. If you can't understand a word of them, you're missing a lot of what C++ is these days. While talk of "implicit invariants", rvalues, and a "throwing move" may take some effort to decipher, I think it's worthwhile. C++ is a language in which performance and correctness are both paramount. That's why the developers are expected to manage lifetimes themselves, explicitly state whether they want shallow or deep copies, and so on. Template libraries simplify much of this (shared_ptr and unique_ptr are the death knell for the characters d-e-l-e-t-e in my code) but understanding those lifetime issues, understanding rvalues and lvalues, understanding when temporaries are created and deleted are all fundamental to being a C++ developer. Understanding those things lets you write better C++ code than you otherwise would. I know there are other languages in which your understanding doesn't matter because it is always done the same way. I also know that the control offered by C++ enables performance gains in specific situations where the developer knows better. These things can both be true at once, and can make other languages a better fit for certain developers or for certain business problems. They are also what makes C++ a better fit for some developers and some business problems. But if you don't have those understandings, if you don't want to control your application at that level, then why are you using C++? Use something simpler that can't be controlled the way C++ can.

For those who are using C++ "on purpose", who are "unrepentant" as I say in other of my talks, knowing the language at this level is key to being good at it. Would you say that "Implicit Move Must Go" or not?

Kate


Friday, 22 October 2010 13:52:41 (Eastern Daylight Time, UTC-04:00)  #    
# Saturday, 16 October 2010
Jennifer Marsman has built a very nice list of Windows 7 developer resources. Of course, she had me at Code Pack (the very first item she lists as a matter of fact), but she carries on, drilling into both native and managed scenarios, covering libraries, SDKs, training materials, UX guidelines, samples, blogs - even Twitter handles!

There is a LOT of material out there and it's a little bit fragmented. This is a great post to help you find your way around. Remember, if you have a Windows app, it should be a Windows 7 app!

Kate

Saturday, 16 October 2010 13:07:42 (Eastern Daylight Time, UTC-04:00)  #    
# Thursday, 14 October 2010
According to Wired, C++ was born October 14th, 1985, with the publication of the first official reference guide by Bjarne Stroustrup. That's 25 years ago! I've still been "working in C++ since before Microsoft had a C++ compiler", as I like to say at the start of any C++ sessions I deliver. While that is a long time, it's not the full 25 years the language has existed - not quite, anyway.

Wired marks the anniversary with an interview with Bjarne. If you're curious about what kind of computer he uses day to day (a small Windows laptop) or what music he likes to listen to, now you can find out. Or this advice for young programmers:

Know your fundamentals (algorithms, data structures, machine architecture, systems) and know several programming languages to the point where you can use them idiomatically.

I'd call that "simple but not easy", as much advice is. C++, of course, is neither simple nor easy, but it is incredibly rewarding to those who take the time to learn it and use it well, and I hope it will continue to do so for at least another 25 years.

Kate

Thursday, 14 October 2010 11:10:13 (Eastern Daylight Time, UTC-04:00)  #    
# Wednesday, 06 October 2010

The Tech Ed Europe Session Catalog has been updated with my third talk. In the order they're happening, I have:

WCL322 - The Windows API Code Pack: Add Windows 7 Features to Your Application

DEV311 - Modern Programming with C++0x in Microsoft Visual C++ 2010

WCL329 - Advanced Programming Patterns for Windows 7

The first two I blogged earlier, but the third is new. Here's the abstract:

Windows 7 development in managed code can be very simple, especially for those using the Windows API Code Pack. But your integration with Windows 7 doesn't have to be limited to simple interactions with the new API. This session goes beyond the simple into aspects of Windows 7 development that have, in the past, been left for you to explore on your own. See how to create a jump list with a task that delivers a command to your application, as Messenger and Outlook do. Explore a simple and powerful recipe for connecting to Restart and Recovery, with minimal effort. Discover how Trigger Started Services can reduce your power footprint, while giving your users better responsiveness. Explore all that Libraries has to offer beyond "File Open", and learn why using a library is a better approach than having a user setting for "save directory."

It's going to be a great week!

Kate

PS: About the fourth item you might see under my name ... stay tuned! :-)

Wednesday, 06 October 2010 17:38:21 (Eastern Daylight Time, UTC-04:00)  #    
# Monday, 04 October 2010

I started paying attention to "app compat" around the time Vista was in beta. It stands for Application Compatibility and refers to all the various techniques for ensuring that an application continues to work when it's moved to a new environment, such as from XP to Vista or to Windows 7. Some of these techniques involve changing the source code of the application and rebuilding it, but others don't. And paradoxically, in order to be good at those no-writing-code techniques it helps if you're really a good developer. It really helps if you have strong skills in areas that the .NET Framework generally hides away or abstracts from you.

There are folks whose job it is to solve app compat problems. It's the kind of job that really appeals to me, where you aren't exactly sure how things are going to go each day when you get up, and you think on your feet and react to what you find. And now there's an opening to be such a person if that interests you. Aaron Margosis writes:

The job is basically to figure out why applications that are important to the customer and that work on earlier versions of Windows (typically running as admin) no longer work on Windows 7, and then to get the apps to work correctly without reducing security posture and (typically) without seeing or touching source code. Don’t worry – we will teach you the tricks.If you enjoy problem solving on the Windows platform, you will love this job.

Interested? Have some experience writing Windows apps in native C++ or C? Know a little about how Windows works? Think that being handed unknown problems and asked to fix them is more fun than a regular job? Then read the blog post and apply!

Kate

Monday, 04 October 2010 17:29:10 (Eastern Daylight Time, UTC-04:00)  #    
# Thursday, 16 September 2010

It took a while for the session catalog to update online, but it's official now:

DEV311 - Modern Programming with C++0x in Microsoft Visual C++ 2010

Session Type: Breakout Session
Track: Developer Tools, Languages & Frameworks
Speaker(s): Kate Gregory
Why wait for the C++ committee to finish the specification when you can enjoy much of the power of C++0x today! C++0x, the next C++ standard, is almost upon us and it contains the most important updates to the language since the mid-90s. It even accepts the existence of multiple threads for the first time in the history of the language. Needless to say, these new features bring more expressiveness and power to the native C++ developer. Visual Studio 2010 has added support for some of these key features in order to enable these modern programming techniques. This session clarifies what features are in Visual C++ 2010 and what is yet to come. It illustrates how new constructs such as lambda expressions enable better use of existing libraries and how your code can be simpler, safer and faster all at the same time. If you are itching to show off how C++ is one of the coolest languages on the planet, this talk is for you!

WCL322 - The Windows API Code Pack: Add Windows 7 Features to Your Application

Session Type: Breakout Session
Track: Windows Client
Speaker(s):Kate Gregory
Accessing new Windows 7 features is a challenge from managed (.NET) code. The level of interoperability required is out of reach for many developers. The Windows API Code Pack for the Microsoft .NET Framework is a sample library you can use in your own projects today that provides access to new user interface features (taskbar jumplists, libraries, sensor platform and more) as well as "behind the scenes" features that make your applications more aware and responsive (restart and recovery, power management and more.) Discover a shortcut to Windows 7 development for Microsoft Visual Basic and Visual C# programmers and get started today.

I've done talks with these titles and abstracts before, but I'm not repeating those this time. I'm rejigging the demos pretty substantially and generally rewriting the talks. Register now, and I hope to see you there!

Kate

Thursday, 16 September 2010 11:19:56 (Eastern Daylight Time, UTC-04:00)  #    
# Friday, 10 September 2010

Intel and Microsoft are offering free training:

Learn directly from Intel and Microsoft when you attend this free one-day course on parallelism and threading. This is a great opportunity learn about threading your applications for multi-core platforms. This course is targeted for Windows* C++ developers using Microsoft Visual Studio*.

The performance benefits of application parallelism on modern computing platforms will come from threading software. Learn how to develop software that utilizes many cores! Familiarity with threads is helpful, but not required (target is beginning- to intermediate-experience with threads, experts would not benefit as much from this course). 

They are going to cover concepts of parallelism plus instructor-led demos of Intel Parallel Advisor, Microsoft PPL, and Visual Studio 2010.

Sound good? The dates are coming up soon:

  • 20-Sept-2010 Montreal
  • 22-Sept-2010 Chicago
  • 28-Sept-2010 San Francisco
  • 29-Sept-2010 Seattle / Bellevue
Register as soon as you can!

Kate
Friday, 10 September 2010 09:29:16 (Eastern Daylight Time, UTC-04:00)  #    
# Sunday, 29 August 2010
I somehow missed this John Robbins blog post from back in May. He calls out an excellent presentation on writing data structure visualizers presented at BoostCon 2010. Here's the title slide:



Oh yes, this is a fun talk. I wish I had a recording, but the slides alone are entertaining and useful. I am already planning to put some of this code into practice, and I must find time to check the other talks, too. The links are in John's blog post.

Kate
Sunday, 29 August 2010 17:43:29 (Eastern Daylight Time, UTC-04:00)  #    
# Wednesday, 25 August 2010

I mentioned Hilo when it was first released. This is a cool project doing Windows 7 development in native C++ with no frameworks - not MFC, for example - so you can really see just how it is done. It's not just code, it's also a walkthrough of their design thoughts, and explanation of that code.

The next application, Hilo Annotator, is ready. It features a ribbon, it uses the Windows Imaging Component, Direct2D, and so on. While you probably don't need an image annotator, you may find the code useful in your own applications. And remember, this is all native C++ code.

Your best place to start is the Visual C++ Team Blog entry about it. It's rich in links and has a nice screenshot too.

Kate

Wednesday, 25 August 2010 15:38:57 (Eastern Daylight Time, UTC-04:00)  #    
# Monday, 23 August 2010

Have you ever heard of the All-in-One Framework? Well I hadn't. They've been around for about 18 months. Back in February, on their first anniversary, they described themselves like this:

...this initiative [has been] developed by the CodeFx Project Group to an "all-in-one code framework" that includes more than 300 code samples, covers almost all Microsoft development technologies, ranks 18th among 13000 open source projects on CodePlex, received numerous kudos from customers, proved its values in real support incidents, and created a lot of win-win opportunities within the corporation.

It looks like the participants are all Microsoft employees and they're collecting pieces of code for any language and platform that can be used to solve real world problems. On the CodePlex site, they elaborate:

Microsoft All-In-One Code Framework delineates the framework and skeleton of Microsoft development techniques through typical sample codes in three popular programming languages (Visual C#, VB.NET, Visual C++). Each sample is elaborately selected, composed, and documented to demonstrate one frequently-asked, tested or used coding scenario based on our support experience in MSDN newsgroups and forums. If you are a software developer, you can fill the skeleton with blood, muscle and soul. If you are a software tester or a support engineer like us, you may extend the sample codes a little to fit your specific test scenario or refer your customer to this project if the customer's question coincides with what we collected.

For example, they've written a summary of the ways to call native C++ code from managed code. You can find the pieces elsewhere, but having them all together makes it easier for you to compare and contrast. They often blog additions as they are completed.

Now as you can imagine, a big team creating hundreds of samples needs some sort of vision and structure to keep things consistent. That's where the style guide comes in. And now you can download it from CodePlex. It's an 87 page Word document that covers everything you might wonder about, for both native and managed code, including tabs-vs-spaces (no tabs, please), how much to comment (as I blogged recently and not so recently), Hungarian Notation (use it in native code if you must, but it's a relic; do not use it in managed code), smart pointers (yes, but don't bring in all of ATL for them - I look forward to this section being updated for C++0x), the right way to implement IDisposable, and an especially nice section on Interop at the end.

I don't care what language you work in - this is a document you should at least skim. It could settle some arguments at the office, improve your code, and spare you from some horrible bugs. Download it, won't you?

Kate

Monday, 23 August 2010 15:26:16 (Eastern Daylight Time, UTC-04:00)  #    
# Saturday, 07 August 2010
I got a call this week from a recruiter who is trying to find senior C++ developers for a firm with a growing need. He has placed people with them in the past and it's worked out well and they want more. They write performance-sensitive applications for the financial industry and need someone who's comfortable with templates, and has experience with applications that process high volumes of data. If you're interested, drop me an email and I'll forward it to him for you. Good luck!

Kate

Saturday, 07 August 2010 12:46:31 (Eastern Daylight Time, UTC-04:00)  #    
# Friday, 16 July 2010

I've had a chance to watch a number of the videos from the Windows Summit - an online event to help you with Windows development of all kinds. You can learn more about it and register at the main summit site, or check the lists of sessions for developers. The only trick is that once you've registered, you need to go to a different site to actually watch the sessions. Once you know that (and there is a link on the main site) you're all set.

I've been getting "Windows 7 for Developers" training since before the first public beta, so I had seen a lot of this before. But several sessions were noticeable improvements from the way that material had been covered in the past, and none of them were poorly done, so I recommend this as a way to learn the concepts that are important to anyone writing for Windows 7, and to learn the advantages that Windows 7 can offer to you as a developer and to your users.

I saw three different approaches to code in the sessions I watched:

  • Full on demos with Visual Studio involved
  • Code on the PowerPoint slides, and links to resources that include code demos
  • Mention the name of the API but don't show how to use it
I also saw a mix of native and managed code, with some sessions going all the way to the native side of the spectrum and some all the way to the managed side. Most of the sessions mentioned the Code Pack, of course, and call out a link to it in their resources.

Even if you know all about the taskbar, maybe you could learn about power management, or background services, using sensors, or writing location aware applications? It's really worth taking a look around.

Kate

Friday, 16 July 2010 13:46:01 (Eastern Daylight Time, UTC-04:00)  #    
# Saturday, 26 June 2010
If you use the Microsoft Visual C++ debugger, the team would like to hear from you. They have a quick (6 questions!) survey they would like you to take. Here's the survey, and the team's post about it, if you'd like to leave them a comment.

Kate

Saturday, 26 June 2010 19:25:31 (Eastern Daylight Time, UTC-04:00)  #    
# Wednesday, 16 June 2010
I've written about banned APIs before - for security reasons some C Runtime functions like strcpy should not be used, and instead you should use replacements like strcpy_s that perform some checking before trusting the strings they're handed. You might also know that I really like the extension capabilities in Visual Studio 2010.

So how can I resist a Visual Studio extension that gives you wigglies if you use a banned API?


You even get a handy tooltip suggesting replacements. This is a must-install for any C++ developer. You can get zip of the source (you'll need the Visual Studio 2010 SDK to build it) with a prebuilt VSIX in it from the Security Development Lifecycle blog. It doesn't seem to be on the Visual Studio Gallery yet, but it should be! If you haven't met the VSIX format yet, prepare to be pleasantly surprised - it's a self contained one step installation vehicle for a Visual Studio extension. Just double click it and Visual Studio does the rest.

Kate
Wednesday, 16 June 2010 12:03:40 (Eastern Daylight Time, UTC-04:00)  #    
# Thursday, 10 June 2010

Another terrific Tech Ed has come to a close. I never really got used to the weather in New Orleans, but I loved the food, I loved that we could walk to just about every dinner or party, and I loved the locals I met. I would have liked a little less walking within the convention centre itself - that building is a mile long and I had to go the whole length and back several times each day!

I have a few pictures from inside for you.

This is the "RD couch" in the community area. Good for hanging out while waiting to be on Channel 9. As you can see, non-RDs were hanging out here too.

The table for the Code Pack was giving away copies of the Code Pack on these slightly bizarre USB keys. I meant to keep one for myself but got carried away handing them out at my session (along with cards for a free trial of the Pluralsight On Demand! library). Also the shot-glass-on-a-string-of-beads is pretty brilliant for New Orleans swag. "Give it a shot!" they say.

This is the room for my C++ talk. That's Juval Lowy, who spoke right before me, up on stage. You can see he did a pretty good job of filling the room, which holds 1000. I got somewhat less than that, but was happy with the turnout and the evals for the C++ talk. Both my talks are available online already, by the way, which is astonishingly quick.

I love the "face time" with Microsoft people (including "my" product teams as well as folks in marketing, developer outreach and education, and so on), with my fellow RDs, MVPs, INETA folks, and speakers of all stripes, and with attendees. Booth duty, where you spend long minutes shifting your weight from foot to foot praying someone will come by, is a bit like of box of chocolates. An eager attendee comes forward, meets your eye, smiles ... for every "can you tell me where to find the blinky Windows 7 pen?" there is a good solid question or expression of interest in my actual technology. I got one question on Wednesday from someone who just wanted to know what booth to go to for it to be answered, only to learn it was this booth and that in fact I was probably the only person in building who could have answered it. I sure liked that one!

Next year, Atlanta:

But I may not have to wait a year for another Tech Ed experience. :-)

Kate

Thursday, 10 June 2010 10:09:42 (Eastern Daylight Time, UTC-04:00)  #    
# Wednesday, 02 June 2010
I posted a quick hit on MFC and Windows 7 back in April, mentioning the ribbon and showing you how simple icon overlays and jump lists are. Now Marian Luparu has a nice long article in Visual Studio Magazine. He covers tabbed thumbnails, the ribbon, multi-touch, jump lists, and shell integration for your own thumbnails, preview, and search integration. Then he manages to mention graphics and animation APIs and parallelization. Can't argue with his conclusion:

Overall, Windows 7 is an exciting release for developers. With thousands of new Windows APIs made available to native coders, Windows 7 provides an enhanced experience for desktop applications.Visual Studio 2010 is the IDE of choice to take advantage of the Windows 7 platform. With enhancements in MFC and the ATL and the addition of new IDE Designers and Wizards, Visual C++ 2010 gives you the opportunity to be on the cutting edge in terms of leveraging OS functionality.

Check it out!

Kate



Wednesday, 02 June 2010 14:09:59 (Eastern Daylight Time, UTC-04:00)  #    
# Thursday, 27 May 2010

Update: fixed the link. Thanks, Hanako Izumi.

C++0x is finally becoming real to me. I started demoing some C++0x features over a year ago; but now here is Visual C++ 2010 and it's just packed full of goodness. Does it have everything? No. Does any compiler? Good question.

Here is a handy table from the C++ team about what Visual C++ 2010 supports. The MSDN blog redesign seems to have borked the table a little, but the colours should probably be all you need if you know that the last column is VC10. Use View Source if you must know more. Scott Meyers keeps a spreadsheet, and is nice enough to export it out to the public web, covering gcc and VC, with handy links to more details on the features or a substitute (usually something from Boost) you can use if it's not there. He has plenty of helpful links on the cover page, too. There's also a wiki with less detail, but covering more compilers.

If you're wondering about the state of the standard, and whether x is going to end up being A, B, or C, your best bet is to read Herb Sutter's blog. He posted when the Final Committee Draft (FCD) was text-complete, and a pointer to how anyone can comment on it if they wish to.

If you haven't been paying attention, now's the time to catch up!

Kate

Thursday, 27 May 2010 13:39:39 (Eastern Daylight Time, UTC-04:00)  #    
# Friday, 21 May 2010

The C++ team gave me a heads up about a neat new initiative called Hilo. Here's a quick description:

“Hilo” is a series of articles and sample applications that show how you can leverage the power of Windows 7, Visual Studio 2010, and Visual C++ to build high performance, responsive rich client applications. Hilo provides both source code and the written guidance that will help you design and develop compelling, touch-enabled Windows applications of your own.

The articles are on MSDN - the first is there now - and the code is on Code Gallery.

I like this section from the article:

The rich user experience of Windows 7 is best accessed through a powerful, flexible language, and that means C++: by using C++ you can access the raw power of the APIs for Windows 7. To build the Hilo sample applications, all you need is Visual C++ Express and the Windows SDK for Windows 7, both of which are available as free downloads.

Hilo applications show how to design and develop an application for Windows 7. But while the code showcases the APIs for Windows 7, it is not wedded to any particular application framework. Instead, Hilo implement a lightweight common application layer that directly uses and highlights the APIs rather than obscuring them. This common application layer is used to support all of the Hilo applications. It illustrates the best practices for developing Windows applications, and while it is not complete—it was designed simply to provide the features needed by the Hilo applications—it does show the best practices used in designing re-usable frameworks and can be extended to provide additional features.

Looking forward to reading more!

Kate


Friday, 21 May 2010 22:52:48 (Eastern Daylight Time, UTC-04:00)  #    
# Wednesday, 19 May 2010

A colleague of mine who is not near Toronto has a client in Toronto who needs .NET developers. They would like to start out with a contract position and it could become permanent if it's a good fit for everyone. Here's the job description:

Position: Senior Programmer / Analyst

Pay: $7,500 per month contract (negotiable)

Applicant must be an expert or proficient in:

  • MFC
  • ATL
  • COM
  • .NET Framework  /  C#
  • .NET Services
  • Microsoft SQL Programming

Experience in the following areas would be helpful but not required:

  • WCF
  • WPF/SilverLight
  • ASP.NET
  • Visual SourceSafe
  • Mechanical engineering experience

Responsibilities:

The primary responsibility is to modernize a legacy C++ distributed application. This may include a redesign and possible rearchitect of the application. The final application should be an n-tiered application. The tiers would ideally be:

  • WPF/Silverlight  as the presentation layer
  • A business layer with business components (C#) exposed via WCF
  • A data layer

Where necessary, COM components can be preserved.

Other responsibilities include:

  • Move image files from file database to SQL database
  • Document the application
  • Handle ongoing change requests.

Someone who moved from C++ to C# but didn't forget their C++ would be perfect. They are looking for more than one person so it sounds like a fairly meaty project. This is strictly onsite work, no remote work, which is why I mentioned where they are (east of the DVP; west of Pickering.)

Anything you email to me about this I will forward to my colleague who will in turn forward it to the Toronto folks. Good luck!

Kate

Wednesday, 19 May 2010 16:19:23 (Eastern Daylight Time, UTC-04:00)  #    
# Thursday, 13 May 2010

Stack Overflow is an amazing resource. It's a place to ask questions and get them answered, but it's a lot more than that. Like any other online community, people get to know each other and some of them start to relax and have fun. In that spirit came the question "What is, in your opinion, the most surprising, weird, strange or really "WTF" language feature you have encountered?" with over two hundred answers. The current highest-voted answer is how C++ is fine with:

10[a]

(for some array a) and it just means the same as

a[10]

I also like the Javascript answer, in which a commenter points out that "111" - -"222" gives 333 and "111" + "222" gives "111222". And another answer I blogged about eighteen months ago. You could spend far too long reading all these and laughing.

Kate

Thursday, 13 May 2010 08:36:27 (Eastern Daylight Time, UTC-04:00)  #    
# Friday, 07 May 2010

Jani Jarvinen (a Finnish C# MVP) wrote a nice article about using sensors with Windows 7. He mixes and matches .NET 4.0 and Code Pack capabilities, and has links to plenty more information. I like the screenshots and the step by step approach. Windows 7 really does make this so much easier than it used to be. He gets you started with both an ambient light detector and some simple location code.

A little more exotic approach comes from "gleat" who has a Code Project article using a Wiimote as the accelerometer. He starts out simple - here's how to download and install the driver - and then goes into writing a client in C#, leveraging Code Pack of course. But then he says hey, were you wondering how to write a driver? and wham! you're hip deep in C++. It's all well explained, though, so if you want to learn more about this, what a terrific way to start.

If all of this is making you wish you had Windows 7 somewhere to play with, but you don't want to buy it, don't have an MSDN subscription, don't qualify for BizSpark etc, then what you need is a free 90 day evaluation of Windows 7, right? I found that link on this handy Doug Turnure blog post from earlier this year that includes some video links I hadn't seen before. Have fun!

Kate

Friday, 07 May 2010 12:14:02 (Eastern Daylight Time, UTC-04:00)  #    
# Wednesday, 05 May 2010

I was just looking up the session codes for my Tech Ed talks next month (my flight to New Orleans leaves a month today, at about this time actually) and spotted something unexpected:

DEV316 | Modern Programming with C++0x in Microsoft Visual C++ 2010
Session Type: Breakout Session

Track: Developer Tools, Languages & Frameworks
Speaker(s): Kate Gregory
Level: 300 - Advanced
Why wait for the C++ committee to finish the specification when you can enjoy much of the power of C++0x today! C++0x, the next C++ standard, is almost upon us and it contains the most important updates to the language since the mid-90s. It even accepts the existence of multiple threads for the first time in the history of the language. Needless to say, these new features bring more expressiveness and power to the native C++ developer. Visual Studio 2010 has added support for some of these key features in order to enable these modern programming techniques. This session clarifies what features are in Visual C++ 2010 and what is yet to come. It illustrates how new constructs such as lambda expressions enable better use of existing libraries and how your code can be simpler, safer, and faster all at the same time. If you are itching to show off how C++ is one of the coolest languages on the planet, this talk is for you!

WCL316 | The Windows API Code Pack: Add Windows 7 Features to Your Application
Session Type: Breakout Session
Track: Windows Client
Speaker(s): Kate Gregory
Level: 300 - Advanced
Accessing new Windows 7 features is a challenge from managed (.NET) code. The level of interoperability required is out of reach for many developers. The Windows API Code Pack for the Microsoft .NET Framework is a sample library you can use in your own projects today that provides access to new user interface features (taskbar jumplists, libraries, sensor platform, and more) as well as "behind the scenes" features that make your applications more aware and responsive (restart and recovery, power management, and more.) Discover a shortcut to Windows 7 development for Microsoft Visual Basic and Visual C# programmers and get started today.

The first digit carries meaning, but the last two don't. So I don't really know how they both got to be 316. Since I often have trouble remembering my session codes, this should halve the effort for me :-).

Kate

PS: I checked whether the Brian rule still applies. You can too, by just dropping down the "Speaker" box on the session catalog page. I'm happy to report there are 9 Brians and I reached 9 obviously female names (ignoring Alex, Chris etc) while I was still in the C's. Good news, in my opinion!

Wednesday, 05 May 2010 13:54:51 (Eastern Daylight Time, UTC-04:00)  #    
# Saturday, 01 May 2010

On Thursday night I was the surprise mystery guest for the St Louis installment of the .NET Rocks Roadtrip. What a fun little jaunt that was! We recorded an episode of .NET Rocks, (talking about Windows 7, C++, and educating developers) then Carl and Richard both did very interesting presentations. I had seen parts of Richard's before, but Carl's was all new to me and I will just say if you live in the half of the roadtrip that hasn't happened yet, you really need to make an effort to be there and be part of it!

Here's a blog entry by Nicholas Cloud, and another by Brian Williams, and a picture by fallenprogrammer of us getting set up.

The next morning featured breakfast at Cracker Barrel (an experience) and then a ride to the airport in the RV for me and Kindler Chase, who had joined them in Tulsa, before they headed Chicago-wards. It sure was fun to be part of it!

Kate

Saturday, 01 May 2010 20:22:11 (Eastern Daylight Time, UTC-04:00)  #    
# Tuesday, 27 April 2010

MFC had some Windows 7 support starting with the release in between Visual Studio 2008 and Visual Studio 2010. There was a ribbon, for example, though there was no designer. In Visual Studio 2010 there is a ribbon designer, very nice, and tons of UI fun as well. In this post I'd like to focus on some MFC support for taskbar interactions. Any idea what these two lines of code do?

HICON i = LoadIcon(NULL,IDI_WARNING);
SetTaskbarOverlayIcon(i,L"Warning");

Here's the visual evidence:

Yep, you load an icon and then you set it as an overlay icon on your taskbar. Nice and simple.

How about this:

m_jumplist.InitializeList();
m_jumplist.AddTask(L"http://images.bing.com",L"",L"Bing",L"",0);
m_jumplist.CommitList();

You need to know that m_jumplist is a member variable of type CJumpList - a new type in MFC. Here's what that code causes:

This is remarkably little code to be all up to date and modern, isn't it?

If you want more info on C++ and Visual Studio 2010, here's a nice article by Sumit Kumar and a Channel 9 talk with Pat Brenner. Enjoy!

Kate

Tuesday, 27 April 2010 11:28:09 (Eastern Daylight Time, UTC-04:00)  #    
# Friday, 23 April 2010

I like to introduce myself, in C++ circles, by mentioning I was using C++ before Microsoft had a C++ compiler. It's often interesting to watch people try to handle the concepts behind the sentence - mostly, that for some languages you can buy compilers from more than one vendor. And once upon a time, C++ existed as a language, and Microsoft sold compilers, but it didn't have a C++ one yet. Then eventually (OK, in 1992) the C product Microsoft sold became a C/C++ product (compiler, linker, debugger etc) and then the next year Visual Studio came along and with it Visual C++. And Visual C++ 1 included the Microsoft Foundation Classes 2, so that for a while the version numbers of Visual C++ and MFC were out of sync. Eventually there was a version skip to catch up (there was no Visual Studio 3). For quite a while we all worked with Visual C++ 1.52c and every speck of that version number was significant. So as you can see, the version of a product is not a simple question with one answer.

So, here we are, welcoming Visual Studio 2010. Lots of people called it Dev10 while it was under construction. But was the 10 short for 2010? It was not. It was just 10, as in the number after 9. Visual Studio 2008 was 9, and Visual Studio 2005 was 8. You can see these numbers on the shortcuts to your sln files, by the way:

OK,so VC8 means Visual C++ 2005? Basically. As long as you realize that it doesn't mean version 8 of the compiler. Because the C compiler transitioned into the C/C++ compiler, the version numbers came with it. VC8 includes version 14 of the compiler. Confused yet? If so, you're in good company. Here's a tabular explanation, though it only goes back a decade. You want more details? Wikipedia has them, of course. Me, I am going to enjoy Dev10 and watch for news of Dev11.

Kate

Friday, 23 April 2010 09:08:34 (Eastern Daylight Time, UTC-04:00)  #    
# Tuesday, 13 April 2010

Is it a good omen when mornings start out beautiful? I think it might be:

Normally, when I go to a conference, the first day is a little slow. I might go to the keynote, or I might not. If I do, I wander in to the back row 5 minutes before it starts (hey, I'm leaving plenty of seats for the paying attendees) with my coffee in my hand. So reaching the keynote room at 7am, full of pep and vigour, was fun!

I really liked the story the keynote demos told. If you haven't seen it yet, it's available online. The demos start with simple productivity boosts like multi-monitor support, Intellisense for Javascript, and so on, then move to some amazing C++ updates including Windows 7 support (yes, the demo went boom, but if you watch closely you'll see it was just that the app was still running, preventing a successful rebuild.) Then you see "SharePoint F5", a huge pain-saver for anyone, like me, who does SharePoint development. Over a dozen manual steps done for you when you press F5, and you can run SharePoint right on your laptop. But they're not done yet -- here comes an Azure demo with the Windows Phone 7 emulator and a real phone, and then Team Foundation Server and a ton of exciting new Application Lifecycle Management features in Visual Studio including (no kidding) time travel. Wow! I hope you all enjoyed it as much from the seats as I did from backstage.

No sooner was the keynote over than I was headed for the Channel 9 stage to record half an hour of Q&A with Twitter people.

That's available online too. And if you want more, some of the sessions are appearing on Channel 9, too. Not filmed on site, but the content matches. Get your Visual Studio 2010 from MSDN downloads, or if you're not a subscriber you can take the Professional Edition for a test drive.

Kate

Tuesday, 13 April 2010 11:38:04 (Eastern Daylight Time, UTC-04:00)  #    
# Friday, 09 April 2010

This trip to the launch gets more exciting by the minute! Check this out:

The Channel 9 team will be broadcasting live, unscripted, and 100% interactive from DevConnections 2010 in Las Vegas as part of the Visual Studio 2010 and Silverlight 4 launches.

Join us Monday April 12th, from 8AM (PST) for Bob Muglia's VS2010 Launch keynote then stay tuned for more than seven hours worth of Visual Studio 2010-themed demos, interviews and panel discussions on Channel 9 Live.

. . .

Day 1 Schedule April 12th 2010 (Pacific time)

8:00 AM DevConnections 2010 Day 1 Keynote.

10:00 AM Welcome to VS2010: Doug Handler and Brian Randell with Dan Fernandez.   

10:30 AM Live Q&A with Bob Muglia, President Server & Tools Division with Dan Fernandez.

11:00 AM VS2010: Native Code. Kate Gregory and Richard Campbell with Charles Torre.   

11:30 AM VS2010: Managed Code. Lisa Feigenbaum, Tim Ng Dustin Campbell with Charles Torre.

. . . then some other people, who I love, but I can't paste it all in here. . .

To be part of it, use Twitter with @ch9live somewhere in your message. We'll see it and that's all it takes to join the conversation!

I count 11 Regional Directors (many of whom are also MVPs) on the guest list. What a way to spend the day!

Kate

Friday, 09 April 2010 23:27:02 (Eastern Daylight Time, UTC-04:00)  #    
# Monday, 05 April 2010

I am so looking forward to seeing New Orleans for the first time. I am pretty sure this is my tenth Tech Ed North America. I have two sessions, one for native C++ developers and one for managed developers who want to use Windows 7 features. No surprise if you read my blog regularly, I suppose.

The C++ talk is called Modern Programming with C++0x in Microsoft Visual C++ 2010 and the abstract reads:

Why wait for the C++ committee to finish the specification when you can enjoy much of the power of C++0x today! C++0x, the next C++ standard, is almost upon us and it contains the most important updates to the language since the mid-90s. It even accepts the existence of multiple threads for the first time in the history of the language. Needless to say, these new features bring more expressiveness and power to the native C++ developer. Visual Studio 2010 has added support for some of these key features in order to enable these modern programming techniques. This session clarifies what features are in Visual C++ 2010 and what is yet to come. It illustrates how new constructs such as lambda expressions enable better use of existing libraries and how your code can be simpler, safer, and faster all at the same time. If you are itching to show off how C++ is one of the coolest languages on the planet, this talk is for you!

The Windows 7 one is The Windows API Code Pack: Add Windows 7 Features to Your Application and the abstract is:

Accessing new Windows 7 features is a challenge from managed (.NET) code. The level of interoperability required is out of reach for many developers. The Windows API Code Pack for the Microsoft .NET Framework is a sample library you can use in your own projects today that provides access to new user interface features (taskbar jumplists, libraries, sensor platform, and more) as well as "behind the scenes" features that make your applications more aware and responsive (restart and recovery, power management, and more.) Discover a shortcut to Windows 7 development for Microsoft Visual Basic and Visual C# programmers and get started today.

Registration is open, so plan to be there!

Kate

Monday, 05 April 2010 23:13:40 (Eastern Daylight Time, UTC-04:00)  #    
# Thursday, 01 April 2010
C++ developers generally care a lot about how fast their code runs. In many cases that's the reason they wrote the application in C++. Every release of C++ development tools (compiler, optimizer, linker etc) typically has some effort invested in producing code that runs faster, even if that means the tool itself runs slower. It's tempting to think that the gains would have levelled off by now - after all, C++ has been around for a very long time. But a recent post by Lin Xu of the C++ team shows how you can take you 2008 project and rebuild it in 2010 (using the right options of course) to see up to a 16% speed increase with no code changes by you. Lin also discusses the extent to which this will slow your build process.

Visual Studio 2010 and Visual C++ have a TON of important new features for native developers, which I'll cover shortly. But let's just start with this one - faster applications - for the moment.

Kate

Thursday, 01 April 2010 05:58:13 (Eastern Standard Time, UTC-05:00)  #    
# Wednesday, 24 March 2010
Today is Ada Lovelace Day, a day to celebrate the women of software. I've blogged about it before, and it seems like a good springboard to get started again. There's a nice post over on Toronto Girl Geek Dinners, too. I have been trying to go to an event there for at least 6 months, maybe a year - seems it's always on a day I'm out of town or otherwise unavailable. April 5th might work out - I hope it does.

What have I been doing for the last almost-4-months? Working hard. Speaking, mostly on Windows 7 things. Planning future speaking gigs. Writing code - real code - in VB, C#, and yes, C++. Some using STL and some using MFC as it happens. Project managing, which can be many times more satisfying than coding but also many times more frustrating. Tweeting (yes, I did - and I tweet personal stuff as much as technical stuff so if you don't care for that you don't need to feel obliged to follow me.) Publishing videos. All of these things will get blog posts of their own over the next little while.

Stay tuned!

Kate

Wednesday, 24 March 2010 20:46:38 (Eastern Standard Time, UTC-05:00)  #    
# Tuesday, 10 November 2009

Yesterday was the first day of Tech Ed. I went to Marian Luparu's talk on Visual C++ 2010. He did mostly demo, and showed a ton of hot new C++ features.

If you missed this one (it was the very first talk of the conference) be sure to look for the recording.

After lunch I headed out to be part of the anniversary celebrations. Despite the rain, it was a great outing, and the crowds were very orderly. I had a bratwurst and took a few pictures:

No place I'd rather be.

Kate

Tuesday, 10 November 2009 07:04:25 (Eastern Standard Time, UTC-05:00)  #    
# Wednesday, 21 October 2009

I remember, back in the day(*), being so confused about NULL. At first I thought it was a keyword, a special value of some kind. Then I learned it was just the same as 0. Or maybe 0L. I worked with people who said it was wicked to use it, and you should always type the 0 yourself. I worked with people who said it was wicked not to use it, because it made your intentions clear to humans. I even worked with people who used it in for things other than pointer-setting or pointer-checking. I argued with people who thought if(p) was or was not more clear than if (p != NULL) and, late at night when we'd been drinking, about what would happen if some other value than numerically zero meant "null pointer" and what that would do to the world's code, and how to write our code so that could never hurt us.

But that was long ago. These days I've pretty much internalized NULL (and for the record, I'm an if(p) gal) and no longer think about it. One of the reasons I don't have to think about it is that I don't write a template library that's used by millions of developers. If I did, I might have to worry about template-argument-matching and how compilers are supposed to deal with being given an int and knowing to match that up to a Something* -- but then again, only if the int has the value of zero. It's been a pretty clever trick for a really long time, but with the advent of perfect forwarding in C++0x (thanks to rvalue references) it just becomes impossible to always pull off that trick. Luckily, the same language changes that led to rvalue references also held the solution - the literal nullptr that isn't an integer with the value 0, but actually represents a pointer-to-anything that isn't pointing anywhere right now.

For the gory details, a wonderfully transparent look at how the team decides what to do in a release and what to hold for later, as well as some delightful glee at being able to do stuff, some amazing understatement ("somewhat arcane" indeed) and moments later "the world explodes!" you have to watch STL on nullptr. BTW, he deliberately pronounces it null-putter so people can tell he's not saying "null pointer" which would still be NULL. He even gets into nullptr vs nullptr in the land of /clr and how the double underscore (seriously) rides to the rescue. Major whiteboard action and in the end you'll know a little more about why the magical STL (the library) works, why it's faster in VC++ 2010, how the team (including the human STL) thinks and works, and the insides of my favourite language.

Kate

* that would be before Microsoft had a C++ compiler, over 20 years ago. Four and a half years ago I reflected that I was very close to having 20 years of C++ experience.

Wednesday, 21 October 2009 09:49:40 (Eastern Daylight Time, UTC-04:00)  #    
# Saturday, 17 October 2009
As C++ developers, we have a lot of options about how to link to libraries we use. We read sometimes that if we link statically, we will have more work to do if there's ever a security hole in the library, since we'll have to redeploy our app rather than just relying on the users to get the new library and use it dynamically. There's a great example of that in the ATL story that is now just wrapping up. A problem was discovered in July, and emergency updates were promptly released - just a day before the guys who discovered the problem spoke about it publicly. An article that same day pointed out that the error was almost a typo - an extra & in an expression - and warned that the patches "do not automatically fix software that was developed using the buggy ATL. Instead, vendors -- Microsoft as well as third-party firms -- must use the patched Visual Studio to recompile their code, then distribute the new, secure software to users." Well finally, Microsoft has finished their part of it with updates for the parts of Office that were using the old ATL. Have you done all of yours?

Kate

ps: love the "related twitters" at the bottom of the article - people may not tweet about the Active Template Library very often, but they sure do mention a certain airport / city that uses the same abbreviation :-)

Saturday, 17 October 2009 12:13:47 (Eastern Daylight Time, UTC-04:00)  #    
# Thursday, 15 October 2009
Inspired by the Visual Studio Documentary, Rico Mariani is writing his own history. So far he's up to 8 parts and they make for great reading. He goes into some of the technical challenges the teams faced, and talks about cancelled and sidelined projects along the way. He's made a category for it so you can read the whole thing start to finish ... but I'm reading as he goes and not waiting till it's done. Do read in order though, starting at Part 1.

Kate

Thursday, 15 October 2009 11:34:46 (Eastern Daylight Time, UTC-04:00)  #    
# Friday, 09 October 2009

You have to see these. Roughly half an hour each, featuring an RD and at least one former RD, it’s a cast of luminaries and also has some funny-looking-back archival footage. I learned a few things, remembered a whole bunch more, and smiled and laughed a lot. Check them out. Apparently there’s a whole series to follow with the full interviews with all those folks. I like this chronologicallish approach with different interviews interwoven, but I’m sure I’ll watch the long ones too when they come out.

Here’s who’s in it:

  • Anders Hejlsberg
  • Soma Somasegar
  • Dan Fernandez
  • Alan Cooper
  • Bill (archive footage)
  • Tim Huckaby
  • Tony Goodhew
  • Dave Mendlen
  • Jeff Hadfield
  • Jason Zander
  • Mardi Brekke
  • Dee Dee Walsh
  • Scott Guthrie

They are both on Channel 9 (and read the comments too): Part 1 and Part 2.

Kate

Friday, 09 October 2009 09:23:24 (Eastern Daylight Time, UTC-04:00)  #    
# Saturday, 22 August 2009
I've done several Tech Ed talks, in Europe and the US, in which I've demoed lambda expressions, a new language feature coming in C++0x and implemented in Visual Studio 2010. If you missed your chance last year to watch my Tech Ed Europe talk, it's still available on page 3 of the "last year's highlight's" page. But that's 80 minutes and covers more than just lambdas. If you would be up for investing a tenth of that time, try this Channel 9 piece featuring Thomas Petchel. He's obviously VERY familiar with the STL and he illustrates perfectly how writing dinky little functions to initialize arrays can be tedious and time consuming, and how lambdas make them faster. If you watch that and like what you see, go ahead and give my Tech Ed talk a listen as well.

Kate

Saturday, 22 August 2009 09:23:29 (Eastern Daylight Time, UTC-04:00)  #    
# Wednesday, 12 August 2009
There was a bit of a kerfuffle in the C++ standards world in mid July arising from the summer meeting of the ISO C++ committee. Agreement couldn't be reached on how to implement concepts. In the end it was decided not to include them in the next version of the standard.

What are concepts? They improve the experience for template consumers. C++ templates are amazingly powerful, but using them can involve a lot of guesswork and a lot of swearing. They're pretty easy to write, and just by typing a line of code you create a requirement, a pre-requisite, for anyone who wants to use your template. If you write a template that takes two instances of class T called t1 and t2, and then somewhere it says t1 + t2 or t1 < t2, then your template can only be used with types T that have the operator + or the operator <. Anyone who uses it for some other type is going to get an error message that might be useful, but might be your typical nasty template-related error message. That makes templates easy to write, but hard to consume. Short of actually reading through the code for the template, you can't know before you try compiling whether or not your consuming code actually meets the requirements for using the template.

Generics in .NET deal with this through constraints - the generic writer identifies the interfaces that must be implemented by any type that will use the generic - IComparable or IEnumerable etc. If you want to use the generic, you  implement the interface, and the compiler will help you get that done with readable error messages.

So that was the heart of concepts. Some sort of decoration you would put on your template to say "here is what I expect of those that use me." How important are they in general, and how important to C++0x?
  • concepts’ presence or absence in C++0x just won’t make much difference to most users - Herb Sutter
  • [concepts were yanked out and that is] a major setback for C++, but not a disaster - Bjarne Stroustrup
  • removing them was our best available option both for C++0x and for concepts as a language feature - Doug Gregor
  • Not the end of the world, but disappointing nevertheless - Alex Fabijanic
What do I think? I think that template consumers fall into two large categories - those who consume templates they wrote themselves, and those who consume the STL. If you wrote it, I hope you know what it needs, and if it's the STL, well you can paste your opaque error message into a search engine and someone's blog will tell you what you need to add to your class to use that template. I don't think there are a lot of people consuming poorly documented and sparsely used templates. I agree that concepts could result in that sector growing some day, but that few developers are walking around wishing for them or feeling the pain of not having them. I'm sure it's a disappointment to everyone who put so much work in to them, and who will continue to work on them towards inclusion in a future version of the standard, but the rest of us can relax and get ready to see the other C++0x goodies included in a standard where x might actually fit in a hex digit.

Kate

Wednesday, 12 August 2009 14:59:55 (Eastern Daylight Time, UTC-04:00)  #    
# Monday, 10 August 2009



Of course the most important sessions at PDC couldn't possibly be announced yet. The best are the ones that are TBD in the session list and schedule right up until the keynote. That's how you know something big is going to be announced. Imagine something where just hearing its code name, just knowing who was going to give the sessions, or even a single sentence of description would spoil the whole announcement. Those are the sessions you go to PDC for, so it's a bit like a Christmas present ... you can't know in advance what it will be.

But it's a four day conference with a lot of sessions and some of them can be announced in advance. I can see that this year some folks have decided to have slightly more interesting session titles (along with the more traditional titles):
  • Zero to Awesome in Nothing Flat: The Microsoft Web Platform and You
  • Windows Workflow Foundation 4 from the Inside Out
  • Windows Identity Foundation Overview
  • Windows 7 and Windows Server 2008 R2 Kernel Changes
  • Using Classification for Data Security and Data Management
  • Under the Hood with Microsoft SharePoint 2010 Programmability
  • The State of Parallel Programming
  • The DirectX 11 Compute Shader
  • Simplifying Application Packaging and Deployment with Microsoft SQL Server 2008 R2
  • Petabytes for Peanuts! Making Sense Out of “Ambient” Data.
  • Microsoft Visual C++ 2010: The "Accelerated" Way of Building Applications
  • Microsoft Unified Communications: Developer Platform Futures
  • Microsoft Silverlight Roadmap and Futures
  • Microsoft Silverlight 3 Advanced Performance and Profiling Techniques
  • Manycore and the Microsoft .NET Framework 4: A Match Made in Microsoft Visual Studio 2010
  • Development Best Practices and Patterns for Using Microsoft SQL Azure Databases
  • Developing xRM Solutions Using Windows Azure
  • Developing .NET Managed Applications Using the Office 2010 Developer Platform
  • Developer Patterns to Integrate Microsoft Silverlight 3.0 with Microsoft SharePoint 2010
  • Data Programming and Modeling for the Microsoft .NET Developer
  • Building Applications for the Windows Azure Platform
  • Automating “Done Done” in the Dev-to-Test Workflow with Microsoft Visual Studio Team System 2010
  • Accelerating Applications Using Windows HPC Server 2008

My favourite title in there is definitely "Manycore and the Microsoft .NET Framework 4: A Match Made in Microsoft Visual Studio 2010" but there are other contenders for sure. As for the topics themselves, I think many of us have still not given concurrency/parallelism/manycore the attention it deserves, and all of us are guilty of compartmentalizing what we learn about so I bet you have probably ignored something (Silverlight, or SharePoint, or Azure, or the full power of VSTS). That means these sessions alone will make us better devs. If these titles are enough to get you signed up, do it now while you can get a $500 (US) discount - from $2095 for the whole conference (except workshops) down to $1595 until Sept 15th. Wait till Labour Day to start bugging your boss about it and the discount will be gone, plus the plane tickets will be more expensive. (Oh, if you're a student or teacher, you pay only $595, which gives you an astonishing way to get head and shoulders above those around you.)

There are also some seriously intelligent workshops scheduled:
  • Getting the most out of Silverlight 3
  • Patterns of Parallel Programming
  • Developing Quality Software using Visual Studio Team System 2010
  • Architecting and Developing for Windows Azure
  • Microsoft Technology Roadmap
  • Software in the Energy Economy
  • Developing Microsoft BI Applications - The How and The Why
Four of those seven workshops are being given by RDs, meaning you'll get real world experience along with the technical product knowledge. What a way to get caught up on something you weren't paying attention to!

Going to conferences is getting harder and harder to justify in this climate. But that doesn't mean you stop going to conferences - it means you only go to those that are relevant to your work and offer amazing value (content, people, atmosphere, and otherwise-unavailable bits) in return for your registration fee, travel, and time away from work. The PDC offers just that for devs on the Microsoft stack. It's the only conference I've ever paid my own money to get to. Be there!

Kate
Monday, 10 August 2009 11:49:32 (Eastern Daylight Time, UTC-04:00)  #    
# Thursday, 06 August 2009
If you like to learn how to do things from material that is longer than blog posts, and videos don't work for you, then you probably still buy books. Here's one you might be interested in:



Authors, in case you can't quite read it there, are Yochay Kiriaty, Laurence Moroney, and Sasha Goldshtein. I am often tempted to link to every post Yochay makes - they are detailed, and useful, and crammed with more links. If you're developing for Windows you should be reading his blog and that's that. I read Sasha's blog regularly, too, and he is constantly coming across things I would never have thought of. I may not need that information that day, but reading it makes me a better developer. Both of them give attention to both managed and native code for extra points from me. Laurence is more a Silverlight guy, but I'm going to read his blog for the next little while anyway.

I haven't seen a preview of the book yet, but it's due Sept 30th, and you know the content will be good. A pound and a half of developer good stuff :)

Kate
Thursday, 06 August 2009 08:49:51 (Eastern Daylight Time, UTC-04:00)  #    
# Wednesday, 29 July 2009
I didn't even know there was a Visual Studio Project Team blog, but the entries lately sure have been C++ relevant:
Brian Tyler says "Our areas of responsibility are those surrounding projects and solutions in Visual Studio - specifically the C++, C# and VB project systems - but we're involved in other code bases in those areas as well." and explains that he's going to start the blog with these C++ topics because the conversion of the VC++ project system from VCBuild to MSBuild was a major effort in VS 2010.

I'm really happy about the VC directories thing. It made moving projects from one machine to another very brittle that things like which version of a header file you got were machine-specific instead of project specific. The blog as a whole is a must-read if you're going to do any C++ work in Dev10.

Kate

Wednesday, 29 July 2009 22:05:26 (Eastern Daylight Time, UTC-04:00)  #    
# Thursday, 23 July 2009

I admit it, I read my referrer logs. I want to see what kinds of searches bring people here, or who is linking to me. I think a lot of the single word searches (women, or shirt, or december) are blog spammers looking for posts to spam on. And some are clearly my name, names of my friends or folks I blog about, conferences I'm speaking at. The majority is things I know about, things for which I want to be your expert source: /clr:pure, windows 7 taskbar, uac manifest file, marshal_as and so on. Yay.

But this one was just plain odd: c++ standard limerick. Really? So I repeated the search, and found this:

When writing a specialization,
be careful about its location;
or to make it compile
will be such a trial
as to kindle its self-immolation.

OK, it's not spaced like that in the standard. But who'da thunk it?

Kate

Thursday, 23 July 2009 19:48:20 (Eastern Daylight Time, UTC-04:00)  #    
# Friday, 17 July 2009

It's been a while since I did a series of posts on debugging tips:

So here is not so much a tip as an announcement. You see , it's no coincidence that my examples for conditional breakpoints were numbers (some index into a structure is greater than 346, or Xid is 1234.) Until now, you couldn't really use strings in conditional breakpoint expressions. But the cool news is that, starting with Visual Studio 2010, you can!

You can't just call arbitrary functions including your own foo(whatever), but you can call a pretty impressive list of variants on strlen and strcmp. The details on are Habib Heydarian's blog. Just one more reason to want Visual Studio 2010!

Kate

Friday, 17 July 2009 12:27:15 (Eastern Daylight Time, UTC-04:00)  #    
# Sunday, 21 June 2009

Some simple truths about elevation (as in UAC):

  • A process, once running, cannot elevate itself. You are launched elevated or not.
  • A non elevated process can launch an elevated one. The easiest way is to make a separate exe and embed a manifest, then launch it with ShellExecute.
  • An elevated process, once running, cannot "drop back down" to being elevated. As in the first bullet, you are launched elevated or not.

There are some incredibly complicated ways to launch an elevated process but I don't use them because they are incredibly complicated. But you might have noticed there's a symmetry problem there. Can an elevated process launch a non elevated one? My first answer would be "it doesn't matter, because you shouldn't." My paradigm is that your core app should be non elevated, if at all possible, and if it has one or two admin-ish features, those should be refactored into a separate manifested exe that is launched (from a UI component decorated with the shield), does its stuff and gets out.

However, a case can be made for having some sort of admin app that wants to leverage some other installed application, like Internet Explorer, that could possibly be using a malicious plugin or the like. This admin app would be smart to do its leveraging with a non elevated instance of that application. So how can you do it? Well, according to Aaron Margosis, it's a seven step process in native code. Managed code is left as an exercise for the reader.

If you care, now you know how to do it. And even if you don't care, the symmetry is restored.

Kate

 

Sunday, 21 June 2009 17:30:28 (Eastern Daylight Time, UTC-04:00)  #    
# Friday, 19 June 2009

If you already know what NDepend is, all you really need to know is that you can now point CppDepend at some big legacy C++ codebase and start to get your arms around all that code a bit better. If you have vaguely heard about NDepend but weren't really listening because you're a C++ programmer, it's time to change that. You can start by reading an analysis of MFC that uses CppDepend to answer questions like what fraction of member variables have names that start m_ (answer: about half) or what kind of coupling the key classes tend to live with.

Beatiful visualizations and genuine insight. Sure, you're not going to refactor MFC yourself, but imagine pointing all this at your own library!

Kate

Friday, 19 June 2009 14:47:30 (Eastern Daylight Time, UTC-04:00)  #    
# Saturday, 13 June 2009

Early this spring I delivered several sessions of training for Microsoft. It was for ISVs who wanted to get rolling on Windows 7 as quickly as possible. It's good material that covers a mix of managed and native development to take full advantage of new APIs, new features, and new power in Windows 7. It relies on the Windows API Code Pack and some custom-written wrappers for Windows 7 functionality that isn't in Code Pack at the moment. And now it's available to anyone who wants it.

If you couldn't come to one of the courses I taught, consider this the next-best thing.

Kate

Saturday, 13 June 2009 21:18:13 (Eastern Daylight Time, UTC-04:00)  #    
# Thursday, 28 May 2009

Stephan has blogged some breaking changes to the STL in beta 1 of VS 2010. These are breaking in the sense that your old code, which worked, might not work when you move it to the latest release. I had this with a demo (not real code) that didn't bother #including <iterator> because it was including something else that included it etc. So my old code wouldn't build in Dev10. Simple enough fix to add the #include.

That alone (4 simple problems, and how to fix them) makes the post worth reading. But it's also a fantastic example of the transparency and visibility the team blog provides. Look at this sentence:

In VC10 Beta 1, I added operator->() to CAdapt, allowing v[i]->Something() to compile unchanged. 

Not "we added". Not "it was decided to add". Not "some faceless decider, whose motives and reasoning are not accessible to the mere mortals who just read our decisions, added". Simply "I added". Stephan, STL, a real person whose posts we can recognize by font alone, added an operator. I think as C++ developers we are a very lucky lot, to have this kind of window into how and why the tools change as time goes by.

The conversation continues in the comments, btw. On the C++ team blog, if a post interests you, you should always read the comments too. Folks ask stuff and team members (not always those who posted the original) answer.

Kate

Thursday, 28 May 2009 21:33:33 (Eastern Daylight Time, UTC-04:00)  #    
# Wednesday, 20 May 2009

I just could not keep from laughing when I read parts of this Register column on C++0x. And that's good, because that's what Verity no doubt had in mind. And it's mostly accurate, though not a good first reference on C++0x. I would recommend the Wikipedia page or the many excellent entries on the Visual C++ team blog (sorry about the order) to learn what it's really all about. But let's say you have actually read and understood what STL has to say about rvalue references - well done! Your reward for that will be to understand the humour in the Register piece :-). And if you haven't understood rvalue references, well all you really need to know is that they let template writers and library writers make their code "smokin' fast" for you.

Kate

Wednesday, 20 May 2009 15:43:46 (Eastern Daylight Time, UTC-04:00)  #    
# Monday, 18 May 2009

I have pretty well always sucked in air through my teeth when I see calls to memcpy. So much of the time it's a marker of premature optimization and a developer who is sure "my code is faster than what the stupid compiler emits". Even when that's not what's going on, it's so darn vulnerable to things changing size over the decades. It just scares me. As result, there isn't much (or even any?) of it in my code, so I'm not directly affected to read that memcpy() is joining the ranks of the "you shouldn't use it" functions, along with strcpy etc.

I blogged about strcpy and some cousins being replaced with more secure versions five years ago. (I had not thought it was that long, but it turns out it was.) Now it's memcpy's turn. The Security Development Lifecycle blogs this, and shows you how to deprecate things yourself. It's probably no surprise to be told you should use memcpy_s instead. There's a scary list of security bugs that are apparently due to misuse of memcpy that memcpy_s would have caught, so if you are an memcpy user, change your ways!

Kate

Monday, 18 May 2009 15:33:06 (Eastern Daylight Time, UTC-04:00)  #    
# Wednesday, 06 May 2009

I've made another appearance on DotNetRocks with Carl and Richard. Some links from the show:

And of course, the show itself. I dare you to listen at 1.4 or double speed.

Kate

Wednesday, 06 May 2009 19:57:02 (Eastern Daylight Time, UTC-04:00)  #    
# Thursday, 05 March 2009

A quick glimpse of what you'll find if you search for C++ on the Tech Ed Sessions page:

I'm looking forward to it once again!

Kate

Thursday, 05 March 2009 14:52:05 (Eastern Standard Time, UTC-05:00)  #    
# Saturday, 28 February 2009

I've been doing some training lately and of course conference season is on the way, so I'm starting to think once again about the mechanics of talking to audiences. One relatively recent change in audience is the popularity of Twitter. It is starting to create a far more public backchannel, one that even the presenter (or the presenter's colleagues) can read and respond to during the talk.

Private, even secret, backchannels are nothing new. I've been on many a conference call where 5 or 6 of us are on Messenger discussing the call itself (and we probably wouldn't want the speaker to read what we were typing.) I've also been in physical meetings where a small group of people are privately discussing the meeting itself, whether co-ordinating who will say what when, or just aimless snarking and wondering when we can leave.

But a public backchannel, maybe even one you have an obligation to monitor, is a very different beast. Some folks, like Olivia Mitchell on Tamar Weinberg's blog, think it's all-good all-round: better for the audience, the presenter, the world as a whole. Presenters just have to learn new reflexes: when your audience suddenly starts typing and looking at their screens, it doesn't mean you've lost them, just that you're so interesting and the information is so important that they feel the need to share with the world immediately. Ira Basen is not so sure, especially if the tweets are negative and going out in public before the talk has even finished and without asking the presenter any questions.

Different conferences will probably lead to different conventions and habits. I can imagine a lot of tweeting from a keynote where things are being announced or demo'd for the first time. But if I'm doing an hour on C++ 0x features, I can't really see why "OMG Lambdas r AWESOME" can't wait until the talk is over. "Now showing capturing the whole stack by reference" doesn't seem like a likely tweet. I can tell you that I'm not going to have a window open on my screen where I'm following "my channel" and that if you want to ask me a question, it's going to involve speaking aloud, at least for now. That said, it's a good idea to think about the impact of wireless internet in every room and instantly-constructed channels on speaking, on conferences, and on the way we all share information. I think there will be more room-switching early in talks if people learn that someone else is really doing a great job, and attendees may demand more agility in scheduling repeats and extra sessions on topics that were well received. As always, we live in interesting times.

Kate

Saturday, 28 February 2009 11:01:19 (Eastern Standard Time, UTC-05:00)  #    
# Friday, 13 February 2009

You know the blog, now watch the Channel 9 video featuring Damien Watkins, Rick Molloy, and Don McCrady. I like this one because they talk about how they ended up changing their minds over the course of development, moving from a language-based approach to a libraries-based one. They get into why that's better and what C++ 0x features they needed to make it possible. A nice way to spend a little under an hour.

Kate

Friday, 13 February 2009 16:20:06 (Eastern Standard Time, UTC-05:00)  #    
# Monday, 09 February 2009

We all face times when we have a picture and we want the text. Maybe we have a printout we can scan, but we don't have one of those cool photocopiers that scans to a true text format like PDF or XPS. Maybe we took a screenshot during a web cast and don't want to retype all the code. That sort of thing. There used to be OCR in Word, but in Word 2007 it seems to have disappeared. No worries though, it resurfaced in One Note.

Here's a screenshot from a private web cast last summer (the actual content is in a recent Visual C++ team blog, so no worries about revealing super secret info):

Now, I open a new One Note document, paste this jpg into it, then right-click:

 

You can hit paste right in One Note if you like, but it tries to capture formatting etc. I pasted into Notepad and got this:

Some samples
structXfl;
void meow(constX&)cout<<”meowconstX&):Copying.”<<endI;}
void meow(X&&) cout << “meow(X&&): Moving.’ <<endl;}
XfooOIreturn XO;}
const X bar() return X(); }
mt main()
Xa;
constXb;
meow(a); I/Copying
meow(b); I/Copying
meow(fooO); ii Moving
meow(barO); II Copying
}

OK, it needs some spaces, and it's not too smart about {} or //, but it's quicker than typing it all yourself. And if you have a boatload of ordinary typed text (say a paragraph from a printed RFP that you want to quote in an email to various folks, or a powerpoint presentation) then it's even more accurate. And it's probably on your machine already!

Kate

Monday, 09 February 2009 17:58:44 (Eastern Standard Time, UTC-05:00)  #    
# Sunday, 01 February 2009

While I was in Redmond I met Alon Fliess, who like me is a C++ MVP and is exploring Windows 7 (and Vista before it) from a native point of view as well as a managed one. About two months ago he mused about the "rebirth" of C++ in these times, not just because some of those operating system APIs are easier to get to from native code, but also because of new native capabilities (the continued MFC updates, the native Web Services library, the concurrency services) that just keep being added to the arsenal available to C++ programmers. (He has some helpful links in the blog post - you could also search through here if you like.)

I think it's a good point. If you know C++, now's a good time to use it. If you don't, then hang around (at least virtually) with those who do - we can point out some cool things. And thanks to the magic of interop, wrappers, and C++/CLI, perhaps we can make some of those cool things a little easier to get to from managed code.

Kate

Sunday, 01 February 2009 09:12:13 (Eastern Standard Time, UTC-05:00)  #    
# Wednesday, 21 January 2009

Continuing my theme of 2008 in review, the year was interesting because it featured the breaking of two rules I have long held to be utterly true. These rules are cynical and depressing and people generally do not want to believe them. I am known for my optimism and yet I assure you these rules are true and you cannot escape them:

  • There is no such thing as a “slow yes”.
  • You will never get paying work (or a sale) from that guy you sat next to on the airplane.

Let’s start with the mythical “slow yes.” All there really is in this world is the “fast yes”, the “fast no”, and the “slow no”. I am sure you have been asked to give somebody a donation, or to buy something, that you didn’t really want to give or buy, and so you said “can you send me a letter about that?” or “can you send me a proposal?” when what you really meant was “can I please get off the phone so I don’t have to face saying no to you?” It’s a “slow no.” We have all done this. Yet for some reason when we are trying to get the sales (or the donations, or to be hired) we get off the phone and tell our co-workers or family or whatever, “Success! He wants me to send a proposal!” or “Score! They’ve got nothing now, but he wants me to phone back in a month!”

I have been a consultant for over 20 years. When people want to hire our firm to help with a problem they’re experiencing, they hire us. Sometimes there’s an RFP to respond to, sometimes they need to show a written proposal to someone, but generally they say “I want you to do this” and then we talk about paperwork. When people don’t particularly want to hire us (and usually that’s because the conversation was my idea, and I am trying to sell work to people who were minding their own business) they ask for proposals, or they say “well, we would have to have a meeting about that but I’m really busy this week so how about I call you in two or three weeks?” This is the start of the “slow no”. They won’t ever say “no” or “go away” but they won’t ever give you work either. You can spend days and weeks and months thinking you are “working on sales” because you are emailing these people and asking if there’s been any change, you’re sending these people generic proposals (because you don’t know their specific problem, and that in turn is because they haven’t told you a problem they want you to solve, and you know why that is? They don’t have a problem they want you to solve), and you’re updating your tickle lists, all of which sure as hell feels like work, but is not in fact accomplishing anything.

So when I finally learned this lesson (and I believe I read it somewhere, and fought it for a while, and then came to know it was true) my life got simpler. I rarely phone or email strangers (or even former clients) and try to pester them into giving me work. If for some reason I do, and they’re not very interested in hiring us, I don’t put a lot of time and effort into trying to persuade them otherwise. I assume that people who want to hire us will make the effort to do so. This has lowered my stress tremendously.

But you know what they say about the exception that proves the rule? We got an RFP from some people we didn’t know, through a third party who felt we’d be good for it. It was highly specific about what technology to use – an Access application distributed as a single file to be installed on each workstation, a SQL backend to be shared by all these workstations, no offline story, a VB6 application to run in the system tray and notify you if another user added something to the shared repository you should know about, that sort of thing – and our first guess of effort doing it their way was well over (perhaps even double) what the third party believed was their budget. So we wrote back and declined to bid. Months later, we heard they were putting it out again. So we asked if it was ok to ignore all their tech specs and submit a solution to the underlying business problem, which was well described in their material. They said go ahead, so we did: suggesting a SharePoint store, some workflow to handle their special business rules, and some Reporting Services goodness for the managers. Total cost including buying all the SharePoint licenses at full retail was less than the whispered budget, and we were pulling in a raft of features that they had on their wishlist for v2 such as email notifications when things were changed. It was a great proposal.

Great or not, it got no response. After about 2 or 3 months I wrote to confirm that we didn’t get it. And was told “actually, we haven’t decided yet.” I imagined a conversation in a boardroom somewhere with one person saying “can she not read? We clearly said SYSTEM TRAY!” and another saying “look how much more solution to our problems we will get for the money!” Some more months went by and you know what? We got the gig. Well over a year from the first RFP to being hired for the project. It’s underway now. I will point out that although this was a slow yes, it didn’t get to yes as a result of pestering actions on my part. I patiently waited (while working on other stuff for real clients) and these guys came to me when their process had worked its way through to a decision.

The second rule that sales people need to learn is that those “hey cool your product sounds perfect for us why don’t you drop me an email” conversations on the plane just do not, in general, lead to sales. Again, the guy just wants to be nice and to go away in a pleasant and positive way. Pestering Mr 13B to see if he’s ready to pull the trigger on the order that will save your year may feel like work, but it isn’t getting you anywhere. If Mr 13B wanted your product, he would have taken your card, and he would have emailed you the minute he got his laptop on the network. That silence and absence of emails from Mr 13B is basically “he’s just not that into you” or in this case, your product.

That said, here’s the story that breaks the rule. Sasha, my MVP lead, spent some time last year in a customs lineup, and got chatting with the fellow next to him in line. That fellow needed some mentoring or consulting from a senior person with solid C++ and project management skills who could suggest a good architecture for his new product, and then help to get it built. Sasha took the guy’s card and sent me one of those “X, meet Y” emails. A conversation ensued, followed by meetings, and the end result: the product is very clever and I am delighted to be part of the team that is building it. We ended up with no C++ in the product, but that doesn’t worry me at all. It meets a genuine business need and supports the way people in that business need to do their jobs. And my client would not have found me if he wasn’t willing to chat to a complete stranger about the software he was trying to build.

I still say the rules are true, despite the specific exceptions I met this year. Or more accurately, that the smart way to live your life is as though these rules are true. Selling consulting services is not like selling timeshares or couches. You can’t bully people into it or catch them in a moment of weakness and trick them into saying yes. They have to want to choose you to solve their problems. That isn’t something you can persuade them to want by “following up” every two weeks. So I just plain do not do that. Some folks who I like and haven’t worked with for a while get a note sometimes (especially if I come across something that reminds me of them) but I don’t set out to make people buy our services. I don’t lose sales by spending less time “working on sales” and I certainly don’t lose sleep. If anything it frees my time to talk to people who genuinely want our help. That’s way more fun anyway.

Kate

Wednesday, 21 January 2009 22:14:22 (Eastern Standard Time, UTC-05:00)  #    
# Tuesday, 20 January 2009

Anyone who blogs on technical topics soon notices they get a lot more hits if they wander into non technical areas for a post or two. That’s just because there are more non technical people out there, searching for tips on stain removal or coupons for TGI Fridays, than there are people who want to know how to get a manifest on an executable or how to write a C++/CLI wrapper for native code or what’s coming in Visual Studio 2010. That’s why my top ten posts last year are:

1 - XPS Document Viewer – Nov 19th 2006
I guess people are still getting XPS documents and don’t know how to read them. OK. Not sure why my page would be the one that over 7000 people find, but what the heck, the information is still valid.


2 - Reading Office 2007 files – Nov 23rd 2006
Also from two years ago but people still need to know this. I send people this link whenever I get one of those “I can’t read your attachment because I’m not on Office 2007 yet” replies to an email. I didn’t send it out 4000 times though, so I guess a lot of people are searching for this stuff.


3 - Try Www.mappoint.com – August 18th 2004
I read recently that people don’t seem to realize they can type URLS into the address bar on their browsers, and have their home pages set to search engines, and actually type entire URLS into search boxes so they can click the result. I would deny this could happen, except many years ago I had a client who did just this, so I know there really are people who do this. I also can’t think of any other reason why over 2500 people would read a four year old post comparing MapPoint to MapQuest given that everybody these days uses either maps.google.com or maps.live.com.


4 - Introduction to Workflow in SharePoint 2007 – June 22nd 2006
Yep, workflow was a hugely important addition to SharePoint. We’re loving it in the SharePoint project we’re doing now. Again this is a topic that must surely be better covered somewhere else though. Still almost 2500 people stopped by to learn about workflow – I hope they followed the link to learn more, and learn something a little more recent – say from after the product was released?


5 - How to earn a million Aeroplan miles – Oct 1st 2005
Now this is really non-technical, but it caught my attention and I guess plenty of other people’s too. I have some other blog entries from time to time about Aeroplan miles, but I don’t really cover how to earn them. For that I highly recommend Flyertalk’s Aeroplan forum.


6 - Batch-convert Visual Studio 2005 projects to Visual Studio 2008 – Dec 17th 2007
The most recent entry yet in this top ten. It makes sense that something that gets hits all year does better than something that wasn’t even around for the first half of 2008. And this is a useful tip I haven’t seen many other places. All those searching people should just subscribe to John Robbins – searching only helps you if you know something exists and want to find it. Smart blogs like John show you things you hadn’t imagined existing.


7 - Another Way to Get the Shield on a Button (or Anywhere Else) – Jan 30th 2008
Finally, something from 2008 in the 2008 top ten! And this is a good tip from Daniel Moth. Remember, the shield on a menu item or button doesn’t bring up the UAC prompt any more than putting ... on a menu item brings up a dialog. And nothing puts the shield there for you if you trigger a prompt any more than something puts the ... for you when it sees you have code to show a dialog. All of this is just sensible developer tradition that helps users feel comfortable with the software they’re using. So please play along and help people know what to expect.


8 - Don't compile MFC apps with /clr:pure – Jan 17th 2007
This one seemed like a no-brainer – MFC includes native stuff, /clr:pure means I don’t have any native stuff, but I was getting emails asking for help and this kept turning out to be the issue. So I blogged it. A lot of my blog topics are the answers to random emails I get from people who are looking for help. This way an extra 1500 or so people saw the answer in 2008.


9 - Hot Laptop? Here's a tip – May 14th 2006
It’s still good advice for working with an overheating laptop. I’m not sure if the searchers all had that problem or were using “hot” more metaphorically.


10 - Adding a manifest to a Vista application – Oct 3rd 2006
This is mostly a link over to Catherine Heller’s Visual Studio 2005 instructions, except that I really wanted to call out how much less work it was for Visual C++ compared to C# and VB.NET. Anyway it’s all a ton easier with Visual Studio 2008 these days.


What else can I tell you from my stats? I got almost a million visits over the year, and they averaged 2.71 requests – meaning most folks clicked around a bit once they arrived. That’s heartening. In 2008 I set myself a goal to blog every day. I didn’t achieve that – there were several long gaps in there – but I did post 135 times. I still like the quote from my post on June 1st, resuming after a four-month gap: “Blogging, like speaking at a Quaker meeting, is something one must do only if the spirit moves one.” I’m looking forward to having my spirit move me hundreds of times in 2009.

Kate

Tuesday, 20 January 2009 22:07:58 (Eastern Standard Time, UTC-05:00)  #    
# Wednesday, 26 November 2008

I mentioned Andy's blog a few entries ago. Now he is selling some funny shirts to raise money for two deserving charities: one that treats and prevents blindness and another that provides low cost prosthetic feet. Excellent causes.

  

You know you want one...

Kate

 

Wednesday, 26 November 2008 10:39:09 (Eastern Standard Time, UTC-05:00)  #    
# Sunday, 23 November 2008

Because Visual C++ is a great tool for making Windows applications (and has been for well over a decade) a lot of the Visual C++ users I meet are Koolaid drinkers like myself. We use Microsoft tools to write software for a Microsoft platform, and a fair number of us use Word and Outlook and Powerpoint and rarely touch an application that didn't come from Redmond. But one of the cool things about C++ as a language (contrasted to VB and C# for sure) is that it is also used by people who don't use any Microsoft tools, or who use Visual Studio but nothing else, and people who are not developing for Windows. These people are not drinking the Koolaid and their opinions can be very helpful. They keep track, for example, of which standards features have been implemented in which compilers.

I came across this article on the future of C++, and the article itself didn't have much extra information for me (though the insight into the "bias" of StackOverflow was interesting.) But the comments! Wowza. I'll be reading Andy's blog from now on, and I recommend you read at least this post. It's a good one.

Kate

Sunday, 23 November 2008 09:14:21 (Eastern Standard Time, UTC-05:00)  #    
# Saturday, 22 November 2008

Soma is blogging about C++ again. I liked this quote:

Over the years, we have heard a lot of C++ developers refer to the old days of Visual C++ 6.0 as the glory days of Visual C++ tools.  Many of the comments reminisce about the snappy and productive IDE.  With Visual C++ 2010, we strive to create a new benchmark for Visual C++ IDE productivity.  We will couple this IDE with our superior support for the C++ language and significant improvements to the libraries.

He talks about Intellisense, the build system, tools for exploring a large codebase, the native Parallel Patterns Library (PPL), lambdas, and MFC updates. There really is a ton going on in Dev10. A lot of it was covered at PDC so if you haven't watched those videos yet:

https://sessions.microsoftpdc.com/public/timeline.aspx search for "C++", "MFC", and "native". Enjoy!

Kate

Saturday, 22 November 2008 09:05:57 (Eastern Standard Time, UTC-05:00)  #    
# Sunday, 16 November 2008

Also on Code Gallery, in addition to the Vista Bridge, you can find an interesting bit of guidance for those developing Windows 7 applications. This is 43 pages of "what is special about Windows 7" written for developers. Curious about touch and multi touch? Ink? The new taskbar, ribbon, jump lists? Libraries? How to handle previews and thumbnails for your file type? Wondering what Windows Web Services are and how they differ from WCF? (quick answer - WCF is managed, Windows Web Services is native C++ - expect more on that from me when life calms down a little.) It's all in here, with plenty of screenshots. From here you will know where you want to drill more deeply, and you will know the names of features, which is usually key to figuring out how to use them.

http://code.msdn.microsoft.com/Win7DeveloperGuide is a good starting point, and you can join discussions and so on. The Downloads tab will get you the document in Word or XPS format.

Kate

Sunday, 16 November 2008 07:51:18 (Eastern Standard Time, UTC-05:00)  #    
# Friday, 14 November 2008

Tech Ed draws to a close and the website of videos gets updated. This is a general-access-no-login-required highlights site. The mechanism for extracting individual links seems broken, so I'll show you what to click on:

Thursdays wrapup includes footage of the Norway country party (North American speakers typically pick a country to visit for country drinks, and my gang chose Norway) and the Speaker Idol finals (I was recruited as a last minute replacement judge for the finals only.) Speaker Idol impresses me every year because it shows all of us (speakers, track chairs, etc) people who are really good but have not spoken at Tech Ed before. How good? I have a session in the top ten this year, and one of the very few people who is outscoring me is last year's Speaker Idol winner, Jeff Wharton.

The afore-mentioned session in the top ten is here, the full video. Doesn't seem to be downloadable, so set aside 80 minutes and learn about shared_ptr and lambdas. The abstract is inaccurate - I didn't do anything on STL/CLR or marshalling - that was last year. The attendees didn't seem to mind that I tossed out half my planned talk and replaced it with content that had been announced at the PDC :-).

There are 63 videos all told (though 5 are from last year) and they range from a few minutes long to, well, 80 minutes. See what you missed, and maybe see you next year!

Kate

Friday, 14 November 2008 07:39:38 (Eastern Standard Time, UTC-05:00)  #    
# Monday, 10 November 2008

There is an older, deeper meaning for "cut and paste" and this sticker, on the laptop of a member of the C++ team, shows it nicely. The sticker was a gift, btw - somebody made it for the team member. I like it.

Kate

Monday, 10 November 2008 10:14:09 (Eastern Standard Time, UTC-05:00)  #    
# Thursday, 06 November 2008

Jesse Kaplan gave a GREAT talk at PDC called Managed and Native Code Interoperability: Best Practices. I really enjoyed it, and it actually covers a great deal of ground. Sure, some of the diagrams expressed concepts I have expressed before, but that's a vote of confidence as far as I'm concerned.

This is a dense talk that assumes a fair amount of background knowledge, but well worth the hour to watch. And then he plugged my marshal-as site, too!

Dude, you had me at "interop boundary" and it just got better from there. But this was a great finish!

Kate

Thursday, 06 November 2008 08:10:34 (Eastern Standard Time, UTC-05:00)  #    
# Saturday, 01 November 2008

One of my demos (OK, more than one) for my upcoming Tech Ed Europe talks is a console application. I find when you're doing complicated concepts like C++ templated code, that adding the plumbing to talk to a Windows application (whether MFC, Windows Forms, WPF or whatever) can obscure what's going on. Generally speaking people can follow cout << i << endl; just fine and it reduces the header files and so on that are needed to use the sample.

I had one problem though - on this machine, when debugging a console application I couldn't get the Properties of the command prompt to come up when stopped at a breakpoint, and of course the command prompt disappears as soon as the program finishes running. I could change the properties in the command prompt you get for "start without debugging" but they had no effect on the debug one. The font was too tiny to use in a presentation:

Here's what I did. I brought up any old command prompt, right-clicked in the title bar, and chose Defaults instead of Properties. This affects every command prompt on your machine at once. I switched to Lucida Console and a bigger size, and closed the command prompt, then debugged my console application again:

Do I care that the font is now big in all my other command prompts? Not really. I suppose if I did I could deal with their properties one by one.

Kate

Saturday, 01 November 2008 11:01:15 (Eastern Standard Time, UTC-05:00)  #    
# Friday, 31 October 2008

An interesting thing happened towards the close of Thursday's MFC session at PDC. Damien Watkins was taking questions, and as so often happens, some of the questions were really more comments or suggestions, feature requests and so on. It's rare for the speaker to be the person who can act on these requests. Normally we're reduced to saying "send me an email and I'll forward it to the right people." Sadly, very few attendees do that. I know it takes a great deal of initiative and even courage to ask a question at a big conference (I do remember my pre-speaker days) and when asked to send email instead, that is sometimes too high a hurdle. As a speaker I can try to make a note of it, but if it's outside my area I may not write down the most important word of the request and that may leave the team unable to respond.

So during Thursday's session, after the third or fourth "OK, I'll pass that along," Damien volunteered:

I know you're thinking "he's just nodding his head and not paying any attention", but if you're using the mike it's all getting recorded. Everybody back on the team says "hey, as soon as it's online, let us know so that we can go ahead." It is getting recorded so it's all going back.

After the talk, Damien told me that they recorded the MVP Summit sessions and replayed them frequently to hear the attendee comments in context and with precision. For the PDC talks, when they need to share comments with another team, it's as simple as sending them a URL and a minute mark and asking them to listen. In fact I've done that myself this week when asking a question of someone in Redmond who couldn't attend - I sent the URL to the talk, a screenshot of the slide, and the minute mark. One of the easiest followup emails to compose ever. It really makes it possible for the conversation to continue long after the conference. I hope the trend spreads to all my conferences.

Kate

Friday, 31 October 2008 07:43:37 (Eastern Standard Time, UTC-05:00)  #    
# Wednesday, 29 October 2008

Even those of us who are here can't see all the sessions we want to. I have three and four stacked across in most timeslots - and then I might end up spending that timeslot getting some vital "face time" with an RD or blue badge I don't otherwise get to see. But never fear, they're online within about 24 hours of happening! And what's more, you don't have to be registered to see them!

So, that Parallel native C++ talk that put me in the overflow room? http://channel9.msdn.com/pdc2008/TL25/ - watch the video, download the deck. The terrific Boris Jabes talk I lined up for? http://channel9.msdn.com/pdc2008/TL13/ - same deal. The MFC talk that hasn't even happened yet? The page is waiting at http://channel9.msdn.com/pdc2008/PC26/ and the video should probably show up Friday.

Want to find some more? https://sessions.microsoftpdc.com/public/timeline.aspx. This is just an amazing thing to do. It really increases the value for me of being here because it lowers my stress and worry about choosing the right session. It lets me concentrate on going to talks where I want to meet the speaker or ask the speaker a question, on going to the Labs and Lounge area to meet product team folks, and on enjoying the experience instead of frantically taking notes (or snapping pictures of demos).  I think this makes me MORE likely to attend future PDCs, believe it or not.

Kate

Wednesday, 29 October 2008 10:57:45 (Eastern Standard Time, UTC-05:00)  #    
# Tuesday, 28 October 2008

An astonishing thing happened to me on the afternoon of Day 1. I went to the room for the "Parallel Programming for C++ Developers in the Next Version of Microsoft Visual Studio" talk, and the redshirt guarding the entrance said "the room is full you have to go to the overflow room." I tried logic with her "It's a C++ talk! It's can't possibly be full!" but she chose to believe her own eyes. So I walked the hundred miles or so to the overflow room, which itself became full. The audience really enjoyed seeing how simple it can be to take advantage of multicores using templated functions. Lines and lines of boilerplate goo disappear into a library instead of your code, which means people might actually do this. Nice stuff.

Having learned my lesson, I lined up immediately for "Microsoft Visual C++: 10 Is the New 6." The room filled up just as fast:

I don't think I had heard Boris Jabes present before. He was very good indeed. The slide you see in this picture lays out the mission statement for "Dev10", the next version of Visual Studio, as far as the C++ team is concerned: Make VC10 the most productive IDE for native development. Then he proved it to us. Since it was the last talk of the day, people stayed with questions for a long time afterwards. I really enjoyed listening in on those.

Tuesday started with a keynote that really impressed me. Azure is amazing but the gritty details are not there yet. But Windows 7 - it's on the hard drive! It's real! So they showed it to us. Then they started talking about client development. Ray pointed out a number of advantages of writing a Windows application instead of (or as part of a suite that also has) a web app.

I loved the Windows 7 demo. Lots of features there I really want right now. I love Vista, but this is even nicer. And I hear the stability is great already so you could really use it. Julie plugged the Engineering 7 blog I've plugged myself.

Scott Guthrie said C++ five times. I don't think I've ever heard him say it once before.

 

Don't worry, he talked about managed code too. You may think of ScottGu as "the web guy" but he gave client development in general, whether C++ or WPF, some serious love in this talk. Great announcements too - grid control for one!

Want one more inside joke explained? (I just love the RD alias for this sort of stuff!)

David Treadwell's shirt had 0x007FFF embroidered on it. Think of it as 00 7F FF. RGB. Go try it in some HTML. Then think back to Day 1.

Update: better picture of the shirt by Angus Logan. Subtle-as-a-brick demo of the colour by Steve Clayton.

Missed the keynote? Based on the URL to day 1, try http://channel9.msdn.com/pdc2008/KYN02/

Kate

Tuesday, 28 October 2008 13:41:07 (Eastern Standard Time, UTC-05:00)  #    
# Saturday, 25 October 2008

My Tech Ed Europe sessions are confirmed (have been for a while actually) so I had better tell you about them:

See you there!

Kate

Saturday, 25 October 2008 13:18:39 (Eastern Daylight Time, UTC-04:00)  #    
# Thursday, 23 October 2008

Actually I know what it is ... it's a large code base, fully available, very graphical, and with reasonable performance demands. So many years ago, Vertigo ported Quake II to managed C++ to show how performant the app was and how easy it was to integrate something that is quick to do in managed code - a partially transparent bad-guy locator if I remember correctly. That was five years ago, before C++/CLI, so it was a thicket of underscores and general hard-to-read misery.

About a year ago, Greg Dolley did it to C++/CLI. And then in January of this year he did Quake III Arena.

Well, now Julien Frelat has done it in Silverlight! He was apparently inspired by someone who did it in Flash. This is Quake I, but he has plans for II. Adam Kinney has an interview and video.

What else can Quake be ported to?

Kate

Thursday, 23 October 2008 19:29:20 (Eastern Daylight Time, UTC-04:00)  #    
# Wednesday, 22 October 2008

Rico, who like me wonders from time to time "am I old?", muses about how things tend to come on around again. Is C++ too old to bother learning now? Rico says no. But he also says:

...the real need facing C++ programmers is somewhat the same as what faced COBOL programmers say 25 years ago.  It's not that the language is out of joint -- it isn't.  I mean, ok maybe you like or don't like COBOL syntax but that doesn't doom a language and surely C++ syntax is not the zenith of wonderfulness.  But that isn't what's holding C++ programmers back.  The biggest problem, at least in my opinion, is one of accessing new/modern runtime features that may have a different programming environment from the context of an existing environment.

Now, what does that translate to in terms of action items for you? Good question.

Kate

Wednesday, 22 October 2008 19:01:38 (Eastern Daylight Time, UTC-04:00)  #    
# Tuesday, 21 October 2008

As you know if you attended the talks at Tech Ed USA and Tech Ed Europe, or listened to me on DotNetRocks, MFC now supports a Ribbon user interface. You can take some MFC application you haven't touched for a decade or more, add a few lines of code, leave all your command handlers and such untouched and -tada!- you can have a user interface from this century.

But it's one thing for me to demo for you what a tiny amount of code it takes to add a ribbon, and another for you to design a sensible ribbon that will lead your users effortlessly through your UI. Some guidance has now been released. For example, they are very clear that this is a bad ribbon:

There are tons of images and annotations to help you devise something your users will enjoy using. Please read it before doing any Ribbon work, whether in MFC or not.

Kate

Tuesday, 21 October 2008 17:09:44 (Eastern Daylight Time, UTC-04:00)  #    
# Saturday, 18 October 2008

Some schedules I have flagged with "must attend" in my calendar:

TL13 Microsoft Visual C++: 10 Is the New 6
Boris Jabes

Get more done. The next version of Visual C++ is all about improving developer productivity for large-scale applications. Learn about the IntelliSense and browsing experiences, changes to the project and build system, project-less browsing, collaboration through remote symbol indexing, and custom visualization of symbolic information.

Tags: Advanced, Languages

PC26 Microsoft Visual Studio: Building Applications with MFC
Damien Watkins

The next release of MFC will provide encapsulations around a number of new Windows platform features. With this functionality you can easily build applications that integrate into features such as desktop search, application restart and recovery functionality, leverage the new Windows UI metaphors such as Live Icons and Rich Preview. These features represent one of the most significant updates to MFC in years. Come learn the details on all these new classes so you can rapidly build Windows applications that stand out from the crowd.

Tags: Advanced, Visual Studio

TL25 Parallel Programming for C++ Developers in the Next Version of Microsoft Visual Studio
Rick Molloy

Build more responsive C++ programs that take full advantage of multicore hardware. We demonstrate how the new Parallel Pattern Library (PPL) enables you to express parallelism in your code and how the asynchronous messaging APIs can be used to separate shared state and increase your application's resilience and robustness. Finally, we take a look at some of the new capabilities of C++0x and Visual Studio to help you efficiently code and debug your multi-threaded applications.

Tags: Advanced, Parallelism, Visual Studio

Kate

Saturday, 18 October 2008 14:32:09 (Eastern Daylight Time, UTC-04:00)  #    
# Friday, 17 October 2008

The concept of "a whole bunch of thingies" is a vital one in just about every programming language. Some languages support it right in the language itself. For example in C++ you can have an array of integers, or Employee objects, or Customer pointers. And when you use an array, you know that it's a continuous block of memory, and it's possible to interact either with just one element of the array or with the entire array. VB has arrays, and so does C#, and while the syntax is different between them, the essential concepts are not.

The thing is, an array is only the simplest and most accessible way to say "a whole bunch of thingies". It's important that you learn other ways to express that concept - typically by using a class of some sort that someone has written to represent it. There are a ton of these depending on whether order matters to you, does insertion speed matter more than traversing/iterating speed, and so on. Some folks, having learned one way to say "a whole bunch of thingies", look at all the other options, roll their eyes up into their heads, and stick with the one way they know.

This is bad. Not just because your code could be faster, neater, and easier to write, but also because arrays are really poorly suited for certain tasks. They especially hamper parallel programming - and you know that the future is concurrent, right?

Eric Lippert has written a cogent and compelling explanation of why arrays are rarely the right choice, and what you should do instead. It's written, naturally, from a C# perspective, but it's applicable to C++ and VB too. It boils down to this: Object Oriented Programming is the norm. Start trusting object writers. Use a class that someone else wrote and provided with your compiler, and you'll be a happier developer. And if you don't have some neurons fire over the phrase "considered harmful", here is a history lesson on that.

Kate

Friday, 17 October 2008 14:07:24 (Eastern Daylight Time, UTC-04:00)  #    
# Monday, 13 October 2008

Believe it or not, this code (snipped from something larger) compiles:

  unsigned int c = ( o-----o
                     |     !
                     !     !
                     !     !
                     o-----o ).area;
  assert( c == (I-----I) * (I-------I) );
  assert( ( o-------------o
            |L             \
            | L             \
            |  L             \
            |   o-------------o
            |   !             !
            !   !             !
            o   |             !
             L  |             !
              L |             !
               L|             !
                o-------------o ).volume == ( o-------------o
                                              |             !
                                              !             !
                                              !             !
                                              o-------------o ).area * int(I-------------I) );

Not only does it compile, the asserts succeed. What's more, o is not some instance of a class, and neither is I. As you might imagine, there's some bizarro stuff behind this. Templates, operator overloads, ... it's all reasonably silly and impressive at the same time. Needless to say, the ! and -- operators do not "do as the ints do" in this case.

The files you need are at http://www.xs4all.nl/~weegen/eelis/tutorial.cpp and http://www.xs4all.nl/~weegen/eelis/analogliterals.hpp. There's an explanation of sorts at http://www.xs4all.nl/~weegen/eelis/analogliterals.xhtml but my IE7 refused to load it, so I saved it on my machine and renamed .xhtml to .html. To test the code I used VS 2008, made a Win32 console app and just pasted the body of Eelis' main into my generated main, and the body of the header into an empty header file. No strange settings required and no warnings on compile.

Try it yourself!

Kate

 

Monday, 13 October 2008 07:52:20 (Eastern Daylight Time, UTC-04:00)  #    
# Wednesday, 08 October 2008

I know, I know, what could we possibly learn about C++ in 2008 by reading yet another interview with Bjarne? Well, as it turns out, I did learn some new things, so you can too. Like that the name was chosen to be short because some folks were calling C "old C" to distinguish it from "C with Classes" which was too long to say often. And after quite rightly disclaiming that "what would you do differently if you could do it over" is an unanswerable question, he answers among other things "I would have developed templates (key to C++ style generic programming) before multiple inheritance (not as major a feature as some people seem to consider it) and emphasized exceptions more." Wow! Or how about this quote:

If you look at some of the most successful C++ code, especially as related to general resource management, you tend to find that destructors are central to the design and indispensable. I suspect that the destructor will come to be seen as the most important individual contribution -- all else relies on combinations of language features and techniques in the support of a programming style or combinations of programming styles.

Another way of looking at C++'s legacy is that it made abstraction manageable and affordable in application areas where before people needed to program directly in machine terms, such as bits, bytes, words and addresses.

I do love destructors and deterministic destruction, can't deny it. The article is definitely worth a read!

Kate

Wednesday, 08 October 2008 08:24:43 (Eastern Daylight Time, UTC-04:00)  #    
# Monday, 06 October 2008

Strange Maps has, well, a strange map of the island of San Serriffe. Here's a snip of it:

Semi-colonial, indeed!

Kate

Monday, 06 October 2008 14:41:26 (Eastern Daylight Time, UTC-04:00)  #    
# Friday, 03 October 2008
This pair of podcasts snuck onto the web over the summer. This was a single interview that's been split into two parts, both pretty large files (over a hundred meg.) I talk about C++, Vista, the marshaling library and marshal-as.net, the MFC update, and plenty of other things I've blogged about here before.

Let me know what you think!

http://www.informit.com/podcasts/episode.aspx?e=3a744e05-7893-408d-91de-d73b77ddb832

http://www.informit.com/podcasts/episode.aspx?e=fc209a80-bdd7-42b4-b555-514ce882178b

These are MP4 files. The web page bugged me to install QuickTime and I did and that's what played them. You may have your own preferences - there are download links on each page.

Kate

Friday, 03 October 2008 09:20:07 (Eastern Daylight Time, UTC-04:00)  #    
# Thursday, 25 September 2008

Steve, a former C++ guy and current PCP guy, tells stories very well... just three of the reasons I like him. He blogs very infrequently, but when he has an update it's worth reading. This one is funny and informative. Plus, it features links to videos of presentations about the Parallel Computing Initiative. I've linked in the past to videos in English that are hosted on a page in French, so I know you can all handle it. Consider it Canadian Content even though the videos are from Paris. Go, read, watch, you'll enjoy it.

Kate

Thursday, 25 September 2008 08:47:15 (Eastern Daylight Time, UTC-04:00)  #    
# Sunday, 21 September 2008

One of the most mind-clearing features of C++, C#, VB, and their ilk are exceptions. Rather than constantly checking a cascading series of return values, looking for false, -1, null, and whatever other error-signalling values you made up on the day you were writing the code, you can write relatively clean and neat code knowing that catastrophic errors (we have no more memory, the file you just chose from a list no longer exists, apparently I'm not allowed to write to the hard drive at all) will be handled. In C++, the "unwinding the stack" aspect of exceptions, with the memory cleanup and destructor-calling done for you, is a big part of writing clean code that is also memory-leak-free.

But have you ever thought about what happens to half-constructed things when an exception goes off? That is, when the constructor throws an exception before its work is done? I have had people tell me "oh simple, never throw an exception in a constructor." Wrong! A major motivation for the existence of exceptions is the existence of methods (like constructors) that don't have a return value to check. The rule you're half-remembering is "never throw an exception in a destructor" and the reason for that is to prevent weirdness when an exception triggers an unwinding and some destructors and then one of them throws another exception.

So what does happen to a half constructed object when an exception is thrown in the constructor? Who better to ask than Herb Sutter? He shows how C++, C#, and Java all answer this question... and his commenters toss in some other languages too.

Kate

Sunday, 21 September 2008 08:17:44 (Eastern Daylight Time, UTC-04:00)  #    
# Monday, 15 September 2008

At the moment I only have one fall speaking commitment settled and it’s one of my favourites - Tech Ed Developers Europe. Barcelona will be warm, both in the temperature sense and the personal interaction sense (though I do predict exposure to pocket-picking, bag-lifting, and other forms of theft once again). The attendees will be energetic and appreciative. The other speakers will be fun to hang around with. The ancillary events will be fun fun fun.

My topics are the Vista Bridge, and some new C++ features. We’re still working on the abstracts and titles, so I’ll post an update when they’re locked.

See you there!

Monday, 15 September 2008 17:06:49 (Eastern Daylight Time, UTC-04:00)  #    
# Saturday, 13 September 2008

Or put another way, is VB just C# without semi colons? Well, yes and no. If you work in the big wide world of many different programming languages, frameworks, libraries, and operating systems then C# and VB are so close as to be almost indistinguishable. They both have great support from Visual Studio, they both produce managed code that runs on the CLR, they call the same framework functions, they have keywords for the same CLR concepts, and they both have a community of support, sample code, tutorials and the like. But those communities aren’t twinned – some samples are available only in VB, and others only in C#. For historical reasons there are a lot of C# programmers inside Microsoft, and perhaps that’s why VB samples can be a bit thin on the ground.

This less-than-100%-overlap between the samples, tutorials, and so on for the two languages results in people who are proficient in one language trying to read (or worse, write) in the other. Sometimes a great C# developer will be asked "where’s your VB sample? Quick, translate your C# one right away!". Other times a great VB developer will be trying to write their own VB code while reading samples or tutorials written in C#. It can go in the other directions, too.

But although these two languages have a great deal in common, they are different, and in more than just syntax. There are features in each that aren’t in the other. There are natural idioms, too. Idioms are a way of writing things that are natural to one language or identifiably belong to one language. Choosing an example not from the VB/C# world, but from C++ or C, it used to be just so normal to write

if (p=SomeFuncThatMightReturnNull())
{
//do something that relies on p not being null
}

That’s C++, and a deliberate single equals sign. I am assigning p the return value from the function. Then I am testing that value. (Quibble: I am testing what the = operator returns, which is the value just assigned for all well written = operators.) If it’s not null, we’ll do the stuff in the braces. Sometimes I used to come across this instead:

p=SomeFuncThatMightReturnNull();
if (p)
{
//do something that relies on p not being null
}

Or even

p=SomeFuncThatMightReturnNull();
if (p != null)
{
//do something that relies on p not being null
}

Now these other ways of doing it aren’t wrong, they will compile and work, but they demonstrate a lack of familiarity with C++ idioms, with a C++ way of thinking. They are usually written by people who aren’t very comfortable with pointers.

Similarly, in VB, I have seen more than once this sort of thing:

        Dim retval As Boolean = False
        If x > y Then
            retval = True
        Else
            retval = False
        End If
        Return retval

Again, that’s not wrong exactly, but it’s not what I like to write. I prefer just:

        Return (x > y)

Sometimes people say I write C++ in VB, because that's a very C++ way of writing things. But I find it not just easier to read -- it's less bug-prone. (Copy and paste errors like having True in both clauses, for example, will make you crazy.) I know that it’s kind of a C++-ish way to express myself, but it feels natural to me and it works. People who are less comfortable working with Booleans tend to prefer the first, more verbose way. They can see the whole thing laid out for them. It’s not wrong, just different.

Well, it turns out those who try to write VB when they’re proficient in C# are likely to run into a lot of differences in thinking and expression when they take on that task. It might be syntax tripups, missing the use of a helpful VB feature that isn’t in C#, or just writing code that doesn’t use the VB idioms. Kathleen Dollard has amassed a huge list (77 at the moment) of things you should know if you want to write VB code. Required reading for C# people who have to write VB, entertaining for those who like VB, and what's more, plenty of experienced VB developers could learn a thing or two from it (I did.)

Kate

Saturday, 13 September 2008 11:26:18 (Eastern Daylight Time, UTC-04:00)  #    
# Sunday, 07 September 2008

The guys call me a regular now, and I suppose I am. Here’s another hour of rambling and fun covering Vista (especially the Vista Bridge) the Vista things you’re not allowed to implement in managed code, C++, the MFC update, concurrency, and whatever else popped into my head while we were talking.

KateP>

Sunday, 07 September 2008 10:03:39 (Eastern Daylight Time, UTC-04:00)  #    
# Wednesday, 03 September 2008

In case you were worried that Microsoft efforts like the Parallel Framework (PFX) would be aimed only at managed developers, leaving native developers sitting at the little kids table again, take a look at the Parallel Programming in Native Code blog. It hasn’t been updated terribly often, but perhaps some feedback would encourage them (or is it just Rick?) to keep it current :-). The one downer: "this is technology we're currently exploring and I don't have any ship or CTP dates to announce." Stay tuned, I suppose.

Kate

Wednesday, 03 September 2008 09:52:03 (Eastern Daylight Time, UTC-04:00)  #    
# Wednesday, 02 July 2008

I enjoyed meeting some friends from the C++ team at Tech Ed and taking a turn in the booth. Li Shao and Marian Luparu were there when I was, and plenty of customers came by. Now you can read a nice summary of the customer conversations on the C++ team blog. The comments keep the conversation going. They are reading, so go ahead and join in!

Kate

Wednesday, 02 July 2008 12:21:01 (Eastern Daylight Time, UTC-04:00)  #    
# Tuesday, 01 July 2008

If you have some native code that you have sweated long and hard to create, and now you want to make a shiny new user interface using managed code (WPF probably) or expose the engine to web services (WCF probably) or the like, I hope you know how to do that. Most of the interop discussion out there is focused on that direction. But what if you have a native application and you want to use some cool capabilities from the .NET Framework? Most people really only know how to do it through COM. Your native code can pretend the .NET object is a COM component. But there are other options.

I've referred before to reverse P/Invoke - this is when a .NET delegate is made into a native callback function and handed to native code. It works, but in a way it's still managed-calling-native since the managed code has to start things off by making the delegate and handing it over.

There is a third way. It's a little complicated, but I bet it's faster performing than COM interop, and parts of it could be automated. Essentially, you wrap a C++/CLI managed class around some C# or VB managed class, and then you wrap a native class around that using gcroot<>. It's all explained with diagrams and samples by Sasha Goldshtein. Take a look!

Kate

Tuesday, 01 July 2008 11:24:58 (Eastern Daylight Time, UTC-04:00)  #    
# Sunday, 29 June 2008

Lately some people I know have been revisiting the "why are so many Microsoft samples in C#" question. They are VB programmers, and they're just not feeling the love. Man, I know how that feels :-). Several recommendations of Instant VB reminded me that I had been meaning to try Instant C++. This is a $139 product that converts C# to C++/CLI (there is also a version to convert VB to C++.) There's a demo available, and it serves as an excellent example of what is both good and bad about code converters. Here's a comparison of the source and converted code for a demo I use to illustrate UAC in Vista programming:

Sure, it's boring as all get-out to change string to System::String^, though I would probably have done a using for the namespace and just said String^. (In fact, there's a using namespace System; in there already, but the converter doesn't seem to take advantage of it by omitting namespaces.) But there is so much here I don't like. First, I'm a String^ s person, not a String ^s person. Then there's how it handles the using. Hello? Stack semantics anyone? No? And where's my project file? I pointed this at a .csproj file, but I don't seem to get a .vcproj file in return, so I'll need to create a project and add the converted code into it. That's probably ok if I just want to convert sample code to paste into my real project, slightly less ok if I wanted to convert the sample project and test it.

Still, if you're using a relatively new technology, and you need to get to it from C++/CLI because you're writing a wrapper for legacy code or the like, and you get SOOOOO BOOOORED going through samples changing . to :: and new to gcnew and adding ^, then this is a cool tool to save you hours of that kind of thing. Just don't skip the step where you actually make it read like proper C++ code.

Kate

 

Sunday, 29 June 2008 09:38:12 (Eastern Daylight Time, UTC-04:00)  #    
# Thursday, 26 June 2008

This delightful article by Maria Blees slipped by me during my most recent blogging hiatus. It presents a handy framework to run unit tests on native code, some macros to hook you into VSTS code coverage, and some excellent guidance on the reality of testing and refactoring. It also recommends some nice resources. (How fun is it to read a plea (in a pdf she recommends) for designing to be testable and not to put real code in your event handlers, then realize it's from six years ago?) If you write C++ code, go read this article now. It has plenty of real meat in it, and concludes with this paragraph:

My goal has been to show that unit testing native C++ can be easy, fun, and you can get started right now. To give you an idea of the power of WinUnit, take a look through the TestWinUnit project, where I used WinUnit to test itself. Those examples are completely real world and will show you advanced usage you can apply to your own unit tests. If you've been struggling with your native C++ unit testing, WinUnit makes it easy—and any time you can make testing easy, you're far more likely to actually do it.

Mission accomplished, Maria!

Kate

Thursday, 26 June 2008 21:44:07 (Eastern Daylight Time, UTC-04:00)  #    
# Tuesday, 24 June 2008

P/Invoke (aka DllImport) signatures are not the world's most fun things to create. You start with a native declaration, and then hand-map native types to the equivalent (you hope) managed types. If at all possible, you head to www.pinvoke.net and look up the API you are calling and paste in whatever some kind soul put on the wiki. If not, well you have some mechanical work to do.

But now the Interop team has a little tool for you! Look up the API you want, choose a language, click the Generate button and -tada!- your declaration is ready to be copied and pasted. (Even has doc comments explaining the params.) Not calling a well-known API (maybe it's your own code from a native project?) No problem, paste in your native C++ signature and translate. Need to go the other way around (what native signature corresponds to a managed one?) No problem.

Sweet. The code it generates isn't pretty (for example it doesn't add any using/Imports statements, so everything gets the full dotted name every time, and everything is explicitly declared) but then again, who reads generated code? Stick a comment in front of it saying you generated it and leave it alone. Even if it needs a little hand tweaking now and again (and I honestly don't know whether it does or not) it will still save a TON of time. It's on CodePlex, so go get it.

Kate

ps: The list of APIs is in a XML file, and I noticed the Vista-only ones I tried (restart and recovery related mostly) weren't found, so if you wanted to make a contribution to the project...

Tuesday, 24 June 2008 19:56:13 (Eastern Daylight Time, UTC-04:00)  #    
# Sunday, 22 June 2008

So imagine you have some managed code, and it calls some other managed code, and that lower level code tries to do something that requires a certain level of code access security. Maybe it wants to write to the files system, or open a network connection, for example. You probably know that there is a stack walk to make sure that everyone has the appropriate permissions. But what if that stack includes some native entries? Managed code called native code (maybe with P/Invoke; maybe with IJW-style C++ interop) and then the native code called managed code (probably with COM interop though there is also "reverse P/Invoke" I suppose. What happens then? Shawn Farkas knows. The whole blog is good reading if Code Access Security and the way the runtime actually works are things you should know more about, but haven't investigated. Bite size pieces of intruiging questions, along with definitive answers. Nice.

Kate

Sunday, 22 June 2008 13:54:08 (Eastern Daylight Time, UTC-04:00)  #    
# Friday, 20 June 2008

Well, to be honest, the BBC probably didn't sit down and say "We hear Herb Sutter and the gang are going to show Bill Gates all about their plans for lambda functions in C++0x, we have got to get on a plane and capture footage!" They were probably like everyone else "blah blah retiring blah blah career retrospective blah blah dig out those embarrassing old photos" but they happened to capture this meeting. And I actually quite liked the entire episode, really. It's an hour long, stuck up on YouTube as 6 ten-minute segments and a 6 minute one (As each ends you'll get links to the next.) The review meeting with the C++ team gets splonked in repeatedly in between the stuff you've heard a million times about the founding and the dropping out and the early big sales and so on. But there are things I hadn't heard, like just when that picture of everyone looking impossibly young, geeky, and hairy was taken, or how they re-enacted it years later. It's an entertaining and informative recap.

I spotted Herb, Soma, Bill Dunlap, and Ronald Laeremans in the meeting. Any sharper-eyed people who can provide more names?

Kate

Friday, 20 June 2008 22:29:37 (Eastern Daylight Time, UTC-04:00)  #    
# Sunday, 08 June 2008

One of the questions I got in the booth at Tech Ed was about First Chance Exceptions. The attendee was getting these messages in the output window in Visual C++ warning about "first chance exception" and was concerned about it. A long-long-neglected neuron fired. I think I ran an article in a journal I edited 10 or so years ago in which Mike Blaszczak covered this. And I think the bottom line was "don't worry." So I ran a quick search and found this knowledge base article that indeed says "don't worry." The debugger gets the exception first, before your code. It just writes to the screen that it got it. Then your code handles the exception and life goes on as before. If your code doesn't handle the exception, then the debugger gets it again, and then perhaps something interesting happens. But first chance exceptions are nothing.

Having a long memory for tiny details is handy sometimes.

Kate

Sunday, 08 June 2008 18:20:53 (Eastern Daylight Time, UTC-04:00)  #    
# Friday, 06 June 2008

In addition to the talks with C++ in the title (3 of them) and with C++ or a related word in the abstract (3 more) I listed in an earlier posting, I spotted this in a Tech Ed deck:

Heh. That sure isn't C#. What talk is it?

MBL302 Building Windows Mobile Applications That Work with Windows Vista Sync Center

The new Sync Center in Windows Vista will become the hub for all data synchronization between the PC, Mobile Devices, and online services. Take a closer look at the development framework, as well as the end-user experience that Sync Center helps create. This session dives into the code you need to write in order to plug your application into the Sync Center user interface. If you're writing an application for Windows today that has any synchronization components, you should not miss this session.
 
The speaker has a blog entry that states his pro-C++, pro-COM position unambiguously:
This is easy, this is Windows software development like it has been for at least 10 years. It is well defined, well known and well supported...go and learn C++ and COM, it is how many of the Windows Vista features are exposed to developers and with good reason. If you are not prepared to learn how to program your computer then you should question why you are in the software development business.
I think easy might be an overstatement, but I do certainly agree that "old style" programming techniques still have real value in the Vista universe. Keep your skills sharp!
 
Kate
 
Friday, 06 June 2008 09:20:52 (Eastern Daylight Time, UTC-04:00)  #    
# Thursday, 05 June 2008

How many C++ talks are there at Tech Ed this year? Well if you just run your eye down the titles, you'll see these:

MBL202 Maximizing the Usability and Compatibility of Your Mobile Microsoft Visual C++ Application

This session is targeted towards native (C++) developers. The next version of Windows Mobile will have a radical new look, with lots of new common controls and UI capabilities. This session helps you understand what you can do today to minimize backward compatibility issues. We also share many tips and best practices for improving the usability and overall quality of your mobile applications.

TLA327 Parallelize Your Microsoft Visual C++ Applications with the Concurrency Runtime

Introducing concurrency into native Visual C++ applications has long been the domain of true experts and gurus. Yet, as the hardware industry shifts toward multi-core and manycore processors, all developers will need to be able to write robust and scalable parallel applications. As part of its work on Visual C++ and Visual Studio, the Parallel Computing Platform team is building a key set of technologies that will enable the development of such applications. In this talk, we explore libraries for expressing concurrency, a set of messaging APIs that allow developers to consistently build parallel applications that are robust and resilient, and a shared user mode runtime for scheduling and for coordinating system resources. Come learn about these exciting new technologies that will help bring concurrency to the masses.

TLA403 Microsoft Visual C++ 2008 for Unrepentant C++ Developers

Visual C++ 2008 is packed full of changes for those who prefer the C++ language syntax and power. This session covers STL/CLR, the new extensible marshalling library, and changes coming in the C++ standard, specifically TR1. If templates don’t scare you, Boost has intrigued you, and you’re the one everyone turns to for mixing managed and native code, this session is for you.

But there are others, they just don't have C++ in the session title.

TLA321 Microsoft Visual Studio 2008 IDE Tips and Tricks

Harness the power of the 2008 IDE using new tips and tricks used by top Microsoft MVP developers and Microsoft employees. We look at new keyboard shortcuts, new options, the powerful "Quick Command" system, macros, tweaking IDE performance, and more that will make any developer using Visual Studio instantly more productive. The entire session is hands-on inside the IDE and applicable to any language, including Microsoft Visual Basic, Visual C#, and Visual C++. If you've been using Microsoft Visual Studio 2005 or have never touched Visual Studio, you're guaranteed to walk away a VS power user.

WIN312 Windows Presentation Foundation and Legacy Code

Yes, legacy (MFC/Win32) applications can interoperate with a Windows Presentation Foundation (WPF) user interface. Companies that have large Microsoft Visual C++ codebases can modernize their legacy applications by giving them a contemporary user interface. They can do this without having to rewrite the core of their codebase. This talk presents "best practices" for how to modify an application so that the native code operates correctly with a new WPF-based managed user interface. The talk covers such questions as "Can MFC applications move to use WPF," "Does it make more sense to rewrite or upgrade the UI," and "How do you design an interop solution between MFC/Win32 and WPF?” As the talk unfolds, it includes a number of "do's" as well as "don'ts."

TLA326 MFC Updates for Microsoft Visual Studio 2008 and Beyond

This session demonstrates the new features added to MFC in Visual Studio 2008, including support for Windows Vista Common Dialogs, Vista Common Controls, the 2007 Microsoft Office system look and feel (including support for an Office Ribbon-style interface), Office and Visual Studio-style Docking Toolbars and Tabbed Documents.


If you're here and you missed one of these, grab the slides on CommNet and see if you can find the speakers on site. If you didn't come to Tech Ed this year, consider ordering the DVD of all the sessions.

Kate

(note to self: add "C++" to abstract of any future MFC talk I deliver :-).)

 

 

 

Thursday, 05 June 2008 09:05:40 (Eastern Daylight Time, UTC-04:00)  #    
# Tuesday, 03 June 2008

It's one hour till my first breakout session. There isn't time enough to start anything, like actual work from the office at home. It's pointless to worry about my session - I'm well prepared for it anyway but if I wasn't, there isn't time to add a demo or change the deck or anything like that. I just have to sit and wait. It's one of my poorest skills. So I sit and stew instead, which is nowhere near the same thing.

But if you're reading this, and it's not 4:45 yet, come on to S230C and learn about MFC Updates. Why not?

Kate

Tuesday, 03 June 2008 15:48:23 (Eastern Daylight Time, UTC-04:00)  #    
# Monday, 02 June 2008

I've been talking with attendees already and thought I would share some ideas I've been passing along. Planning is key to getting the most out of this week. The last thing you want is to be wandering the endless halls of a huge convention centre wondering where you should go next.

Start by planning your sessions with the schedule builder. You should put at least two sessions into almost every slot. Here's why: some of the sessions you plan to go to will not be right for you. They will be too introductory, or too advanced. They will cover just one little part of a technology that you don't know enough about, or a giant overview when you've already decided to concentrate on one corner. This should be clear about 5 minutes into the talk, and then what you need to do is leave. The slides will be on CommNet or the attendee DVDs, so you can get your overview or introduction later. But this hour of your life spent in the same room with someone who knows the topic needs to be spent carefully. So you quietly leave, and head to the other session you planned for this time slot. There really isn't time for you to start flipping through the catalog for possibilities once you've already ducked out. On the other hand, if the session you chose is amazingly great, stay, and plan to get the slides for the other talk instead.

As the week goes on, you'll learn the leveling codes. Every session has a code like TLA326 (my Tuesday afternoon talk.) TLA means Tools and Languages, which is appropriate since my talk is about MFC updates the team has just delivered. the "26" part doesn't really mean anything, it's just an identifier, but the 3 is the most important part of the session code. It means this is a 300 talk. These talks are advanced level, for experienced developers. They are supposed to include:

  • Drilling into how a Product / Technology is designed 
  • Real world examples
  • Complex coding, known issues and workarounds (sample code/examples)

Compare that to a 400 level talk (like my TLA403 late Friday.) These are expert level, and likely to have:

  • Advanced coding considerations/challenges
  • Design considerations/challenges
  • Architecture considerations/challenges
  • Troubleshooting techniques at the debug level

The best description I've heard is that a 400 level talk will make your head hurt, in a good way. But really you just have to start attending talks and then you will start to see the difference. You will also start to recognize key phrases in talk titles and abstracts such as A Lap Around and know what to expect from that session.

The next tip is that sooner or later you will have a timeslot with no sessions. Maybe you ducked out of one, and then ducked out of your second choice too. That's OK! Head down to the lowest level and wander by the product team booths in the TLC, or the Community Lounge, or do a Hands On Lab. These things are often the most important part of Tech Ed. More on that later!

Kate

Monday, 02 June 2008 10:48:37 (Eastern Daylight Time, UTC-04:00)  #    
# Tuesday, 29 January 2008

Yes! Finally one of my favourite conferences comes to one of my ... er ... nearest cities! DevTeach, star of Montreal and recently Vancouver, is coming to Toronto and bringing many of my friends and colleagues with it. I’m speaking there too... the sessions are at http://www.devteach.com/Session.asp. My talk needs it’s abstract tweaked but the title is good: What's New in Visual C++ 2008. Register before February 1st for the early bird deal. As always, Jean Rene is offering deals to user group members and other community people, so check with your contacts if you have any.

If you’ve never been to a technical conference before, and you aren’t sure anyone would pay travel and hotel for you to go to one, DevTeach is a great way to prove the value of conferences to yourself and your boss. World class speakers (many of whom will be delivering on the same topics at much bigger and more expensive conferences just a few weeks after DevTeach), topics that are relevant to your work right now, and a marvellous delegate-friendly atmosphere combine to attract attendees and speakers – why not you?

Kate

Tuesday, 29 January 2008 11:50:23 (Eastern Standard Time, UTC-05:00)  #    
# Monday, 28 January 2008

This year for the first time I am speaking at SD West. This is a conference I have watched from afar and often wanted to attend. I’m delivering a half day tutorial on Vista Programming, and a new breakout session called Practical Visual Studio Team Systems.  In between I will be at Sutter and Stroustrup on C++ and a host of other feed-my-brain sessions that you might also want to attend. Check the full session list and register quickly... the early bird deadline is February 8th.


The Vista Programming abstract is:

Windows Vista is the most compelling operating system release in nearly a decade. With major improvements in the areas of security, user experience, and performance, Windows Vista offers a robust and dependable platform for building a breadth of solutions. This half day seminar prepares you for building a new class of applications that take advantage of these improvements. Come and see how to take advantage of some of the most interesting new native APIs, inter-op techniques, and .NET Framework 3.0 technologies. Learn how to build the next generation of smart client applications with the Windows Presentation Foundation (WPF), and improve user experiences with technologies like task-based dialogs, sidebar gadgets and customized Windows search functionality. Learn inter-operability techniques with managed wrappers and how to leverage the Vista Bridge. Dive into the best practices for upgrading existing applications, and understanding User Access Control (UAC). Learn how to build more reliable and secure applications with technologies like Application Restart/Recovery. And lastly, learn how to build more connected systems with Windows Communication Foundation (WCF) and RSS platform support.

The Team Systems abstract is:

The real strength of VSTS is its adaptability. Our small shop (no professional project managers, everyone’s a developer of some kind, not-officially-agile-but-not-CMMI-either) has learned a lot about making VSTS and TFS fit the way that we work. Topics include knowing which project people are working on without asking them, adding your own fields to those provided out of the box, writing your own queries and reports, and customizing your project portal. This session will help you get up to speed with the features the most practical features VSTS has to offer, and best practices will be suggested.

See you there!

Kate

Monday, 28 January 2008 11:48:43 (Eastern Standard Time, UTC-05:00)  #    
# Tuesday, 22 January 2008

Well, if not gone at least transformed into a concurrency blogger. Steve Teixeira, who speaks and blogs on C++ topics and has a wicked sense of humour, has joined the Parallel Computing Platform team. On the one hand, this is great news, because concurrency is hugely important to me and having Steve there will be good for it. But on the other hand, who is blogging C++ things now? Sigh.

Kate

Tuesday, 22 January 2008 11:36:39 (Eastern Standard Time, UTC-05:00)  #    
# Sunday, 23 December 2007

You know something is mainstream when it starts to get named. I've been talking about concurrency matters for over two years now. And now it seems almost every day somebody comes out with something you just have to read or watch on this matter. An attendee at Tech Ed Developers in Barcelona asked me "isn't it confusing and wrong that people are doing such different things in this space?" I don't think it is. Some folks are trying things with libraries, with compiler directives, with new language keywords, with whole new languages, with frameworks, with the operating system, with the hardware, ... with everything you can think of. And I don't know which things will work out and how the various things will work with each other. None of us do! But it sure is fun to watch it happen, and it's probably the only way to do it.

So, some links for you, accumulated over the fall:

Herb's advice is good. He says "Expect at least dozens of major product announcements and releases across the industry, before the toolset expansion phase is fully underway and approaching some maturity. We the industry have undertaken to bring concurrency to the mainstream, and as with OO and GUIs it will take multiple years, and multiple major releases, across the industry on all platforms." Bring it on!

Kate

Sunday, 23 December 2007 19:33:00 (Eastern Standard Time, UTC-05:00)  #    
# Tuesday, 18 December 2007

Soma blogged this before Tech Ed Developers and I actually snagged a few bullet points to add to my slides, but I never posted a pointer to the original. It's nice to see some firm numbers and as always nice to see "higher ups" remembering C++.

Kate

Tuesday, 18 December 2007 13:48:14 (Eastern Standard Time, UTC-05:00)  #    
# Saturday, 15 December 2007

I can't remember where I heard about this now... I had thought it was Steve Clayton but I just searched without success. So, unattributed then, here is a cool thing:

Thats's from http://www.google.com/trends?q=c%2B%2B%2C+c%23&ctab=0&geo=all&date=all&sort=0

The top pair of lines is searches (blue C++, red C#) and the bottom is news references. You can run this on a single thing to track it over time or on a set of things to compare them, whatever works for you. Here's what you might demonstrate with a single term:

http://www.google.com/trends?q=katrina&ctab=0&geo=all&date=all&sort=0

I bet you those blipups are anniversary articles. Anyway, imagine what you can do with this! Have fun!

Kate

Saturday, 15 December 2007 10:25:49 (Eastern Standard Time, UTC-05:00)  #    
# Friday, 14 December 2007

I've mentioned before that sometimes when I search for information about topics that matter to me, the search results frustratingly include mostly things that I wrote. That's annoying when you're trying to learn more! But from time to time that same search turns up things I've forgotten, like this interview from over four years ago with Stephen Ibaraki. He's a good interviewer and it's interesting what the interview covers. People ask me all the time "how can I be a speaker too?" or "what does a Regional Director do, anyway?" There are some answers to those, and some tips about writing, interop, porting a project over to .NET, running small business, and more too. It's pretty cool!

Kate

Friday, 14 December 2007 09:13:53 (Eastern Standard Time, UTC-05:00)  #    
# Tuesday, 11 December 2007

At Tech Ed Developers Europe, one of my talks was on STL/CLR and the marshaling library. There are three super cool things about the marshaling library that all C++ developers need to know. The first is that the random boilerplate code we used to write to convert between two kinds of strings is now taken care of for us:

char* stringfromnativelibrary;   //gets set somehow
ManagedFunctionExpectingSystemString(marshal_as<String^> stringfromnativelibrary);

The second is that it's just templates, meaning it is fast at runtime and intuitive for a C++ developer. The third is that because it's templates, we can write our own specializations, and convert between any two types we feel we will be using - typically on either side of the managed/native border, though that's not a requirement at all.

This last part is really exciting to me. Imagine you have some library you wrote ages ago that takes a RECT and does something with it related to your business logic. But you've replaced your UI and now you have a System::Drawing::Rectangle to represent what your user selected. Wouldn't it be cool to write:

oldfunction( marshal_as<RECT> RectangleFromWinForms);

That's not a problem as long as someone has written that specialization. You can do it, or you can try to find one someone else already wrote.

Date and time, arrays, anything related to screen position, these are going to be types everyone uses. Why not share the effort of writing these conversion functions? That's the thought that hit me at the end of my talk. So I came home and set up a site -  www.marshal-as.net - to use for just this purpose. I've had a few submissions from Jason, who was at my talk and was there when I thought of it, and a wish list from a "little birdie". The C++ team knows what I'm up to and they are excited too. Now what I need is submissions and lots of them!

So, drop me an email, comment on this post, or (better) comment on the first post over at www.marshal-as.net. I'll post the specializations one per post and we'll build a library. I'm inspired by pinvoke.net and would like to see this as the destination for finding a specialization instead of writing one. Can you help?

Kate

Tuesday, 11 December 2007 07:38:37 (Eastern Standard Time, UTC-05:00)  #    
# Friday, 07 December 2007

Last year at Tech Ed Developers in Europe, I had a very impromptu Channel 9 interview. A “shop talk” conversation broke out in the lobby of the Hilton, and Charles decided to film it. This year we planned it in advance and I sat down with Steve Teixeira and Ale Contenti of the C++ team. Watching the video, I love watching the two of them get visibly happier as they start to talk about the product and the big changes and news they announced at Tech Ed. Steve was really quite sick and depending on throat lozenges to be able to talk at all. Despite that, it turned out to be a really fun interview.

Kate

Friday, 07 December 2007 16:15:53 (Eastern Standard Time, UTC-05:00)  #    
# Thursday, 06 December 2007

Here’s a little video I did with Paul Foster on C++ and Vista topics. 15 MB, 2.5 minutes. Short but sweet!

Kate

Thursday, 06 December 2007 16:14:03 (Eastern Standard Time, UTC-05:00)  #    
# Tuesday, 04 December 2007

Have you been missing your fix of Ale Contenti at the whiteboard?  Are you unclear on the differences between try and __try? Or between exception handling and structured exception handling? Watch two guys who really understand how all this works and learn why not handling an exception can be as important as handling one.

Kate

Tuesday, 04 December 2007 16:10:53 (Eastern Standard Time, UTC-05:00)  #    
# Wednesday, 28 November 2007

Nick Wienholt took over my column at CodeGuru several years ago, and has written roughly as many columns now as I did. Yet the URL for the column still has my name in it, a discrepancy he pretended to complain about in an August blog post. He has a nice look at the marshalling library ... something you’ll be hearing more about from me too.

Kate

Wednesday, 28 November 2007 15:40:15 (Eastern Standard Time, UTC-05:00)  #    
# Tuesday, 27 November 2007

Eric Lippert talks about some choices that were made in creating C#. He emphasizes repeatedly that C# is not “C++ with the X parts taken out” – where X might be “stupid” or “complicated” or “reserved for smart people” depending on who you talk to. And I agree with him. C# is its own language with its own strengths. It enjoys a big advantage, too: it came from a blank page and wasn’t constrained by an existing code base. For example, one subtle source of bugs in C++ applications is that the order of subexpression evaluation is not enforced by a standard. If I write x=f(y) + g(z); it’s possible that one compiler (or one version of a compiler) might evaluate g(z) first, while another evaluates f(y) first. If these functions have side effects, this matters. I’ve always advised developers that if your functions have side effects, and you care what order they go in, split these expressions up into lines that happen in the order you want: x1= f(y); x2 = g(z); x = x1+ x2; for example.

Eric asks, “is there any benefit to the user of having this order of operations be unknown?” and of course there is not. The reason the order is unspecified in C++ is because there were compilers (from more than one vendor) before there was a standard. That’s not a constraint the C# team faced, so they laid down the law – subexpressions are evaluated from left to right. [Yes, I know some people claim it is a benefit to the user that the compiler is free to optimize by adjusting the order of evaluation. I just fail to see an optimization available by doing things in a different order.]

Two morals of this story. First, new languages can do some things older ones can’t, and that’s a good thing about those languages. Second, you really need to know how your language works, or some day it’s going to bite you.

Kate

Tuesday, 27 November 2007 15:36:58 (Eastern Standard Time, UTC-05:00)  #    
# Tuesday, 31 July 2007

A former Softie friend of mine IM'ed me about this job. Sure, you need C++ skills, but there's more to it than that. They need a variety of skills because you'll get to do a variety of work... off the top of his head he listed:

  • multiplayer game infrastructure
  • chat and presence application
  • drm / installer
  • IE toolbar
  • flash applets
  • a bunch of other stuff

There's a Craiglist ad, which includes application instructions. This is in Seattle, by the way.

Kate

Tuesday, 31 July 2007 17:30:21 (Eastern Daylight Time, UTC-04:00)  #    
# Sunday, 29 July 2007

If you want to get started in C++ development, or try some parts of it you haven't tried before (remote debugging, perhaps?) then you should take a look at these little video lessons on MSDN. They're adding more as they go, so keep an eye on it...

Kate

Sunday, 29 July 2007 18:47:49 (Eastern Daylight Time, UTC-04:00)  #    
# Saturday, 28 July 2007

Check it out ... sessions are starting to appear. I've been looking at the Tools and Languages track... there are some talks here I'll be sitting in on for sure.

It's going to be a fun fall!

Kate

Saturday, 28 July 2007 22:56:00 (Eastern Daylight Time, UTC-04:00)  #    
# Wednesday, 25 July 2007

Hey, this is fun! Want to write an application? In C++? For Vista?

Maybe it should have a split button:

Or a drop down with a cue banner:

Or ... well how about you read the article? It's by Kenny Kerr. It's the start of a new column for him -- look for it every other month in MSDN Magazine.

Kate

Wednesday, 25 July 2007 21:11:34 (Eastern Daylight Time, UTC-04:00)  #    
# Tuesday, 24 July 2007

I like to tell the "C++ is still sitting at the grownups table" story whenever I can. Sometimes that gets hard -- people ask why there's a C# wizard or designer for something, and a VB one, but no C++ one. For example, in Visual Studio 2005 the class designer could understand C# and VB code, but not C++. Well that one at least is somewhat fixed. I'm sure you can guess that C++ code is harder for a diagramming tool to understand, so perhaps that's why it had to wait a version.

Please take the survey from the Visual C++ team blog!

Kate

Tuesday, 24 July 2007 20:21:05 (Eastern Daylight Time, UTC-04:00)  #    
# Sunday, 15 July 2007

Roy Osherove is looking for a Test Driven C++ trainer who lives in Israel already. He can make you a better trainer, he can get you the TDD background you need, but you need to have the C++ chops already and to be in the area. If you're interested, read his blog entry and make yourself known to Roy directly.

Kate

Sunday, 15 July 2007 16:48:25 (Eastern Daylight Time, UTC-04:00)  #    
# Saturday, 14 July 2007

This is actually something that got settled during Tech Ed USA but my June schedule meant a lot of things I intended to blog didn't get blogged. Now I see myself listed on the Featured Speakers page (I told them, "flattery will get you everywhere" and they're going for it) so it's official.

My talks? The C++/Vista talk I did in the USA, plus a managed-code Vista one. We're still working on an abstract for that.

This will be my third trip to Barcelona. Will this be the year I do the Gaudi-tourist thing? Sure hope so!

Kate

Saturday, 14 July 2007 15:43:33 (Eastern Daylight Time, UTC-04:00)  #    
# Saturday, 16 June 2007

I brought home a paper copy of MSDN magazine from Tech Ed and found this as one of the cover stories: An Inside Look At The Next Generation Of Visual C++. It's by Tarek Madkour and definitely worth a read. Were you wondering if MFC's wrapper for the new file dialog would be tweaked so you get the all-singing all-dancing new Vista common file dialog? Yes it will. Will there be a class to represent a Command Link? Yes. And a split buttton? Yes. Pretty much all the new controls and dialogs are in the new MFC. There's also resource editor support for PNG, for 32 bit images, and for large icons.

As I mentioned in my blog post about Sarita's Channel 9 Video, UAC support is also a lot easier. Then there's the marshaling library and STL/CLR. Toss in faster builds, and make developers everywhere happy. Roll on, release day.

Kate

Saturday, 16 June 2007 10:08:09 (Eastern Daylight Time, UTC-04:00)  #    
# Friday, 15 June 2007

Herb Sutter reports on the April meeting of the ISO C++ standards committee. They are now consistently referring to C++ 09 not C++ 0x (with a hope that x would not be hex, which seems to be turning out ok.) The meeting added features to the draft standard for the language itself (template aliases aka typedef templates, variadic templates, and unicode) and for the standard library (variadic templates, unicode, and rvalue references.)

The next meeting is July 15th - 20th in Toronto. I am trying to plan to be there.

Kate

Friday, 15 June 2007 09:53:54 (Eastern Daylight Time, UTC-04:00)  #    
# Sunday, 10 June 2007

During my blogging gap, some good channel 9 videos came out. I wanted to highlight Ale Contenti: VC++ Safe Libraries and More. Ale is the new Martyn Lovell and he wants to show you the safe libraries and how to write sensible C++ code. If you like to see C++ code written live on the whiteboard (no intellisense, no compiler to find your typos) this is the video for you :-)

But wait, there's more. How about a C++ program without pointers? Well, without explicit use of pointers. Check it out.

Kate

Sunday, 10 June 2007 15:28:53 (Eastern Daylight Time, UTC-04:00)  #    
# Saturday, 09 June 2007

Visual C++ is hiring a development manager. They have some reasonably high expectations on experience, proven track records, and so on. If you think you want the job by all means check it out. If you don`t think you want the job, but just want to keep on making C++ code and know there will be a product and a team there for you, read this quote from the job description (bolding by me):

The top 1,500 ISVs generate over 80% of worldwide software revenues. In addition to driving the global Windows ecosystem, these companies are directly responsible for $5B-$7B of yearly Microsoft revenue. Central to the success of these customers, as well as Microsoft's own internal development, is Visual C++. Given the strategic importance of the ISV segment, the Visual C++ team is on a mission to revolutionize our toolset in providing a much more productive and successful native developer experience.
We are looking for a strong Visual C++ Development Manager to drive adoption and satisfaction among professional C++ developers. We are in the starting phase of a major reinvigoration of the experience for C++ and native development targeting very large and complex development projects. The added demands of security and the advent of many-core processing create significant challenges and opportunities to create market leading technologies and tools.
The Visual C++ team is working hand in hand with the Windows division on enhancing the appeal of Vista and Windows 7 for ISV developers and with the CLR team to create a technology stack that allows layering of services to provide a seamless spectrum from native code over type safety and garbage collection to the full .Net stack.

Responsibilities
The Visual C++ DM position features leadership opportunities across multiple areas, including Technology and Architecture Leadership and Execution, Team Building and People Leadership.
You will lead a world class C++ compiler team and C++ IDE team embarking on a virtually top to bottom re-architecture of the tools stack. In addition, you will lead a libraries team that is re-inventing the MFC and client libraries for the next decade together with the Windows WEX and Developer Division UIFX teams. You will grow a strong cross-PU architect team and a development organization.
The Visual C++ DM plays an important role in cross-team relationships (Windows, CLR, UIFX, Office, SQL) and cross-company relationships (Intel, AMD, C++ standards work).

Wow! Looks like we`re all in for a great ride. If you really know your stuff, go help. If you just like to use it, hang on!

Kate

Saturday, 09 June 2007 15:01:12 (Eastern Daylight Time, UTC-04:00)  #    
# Tuesday, 05 June 2007

My Tech Ed USA talk this year was "Vista and C++/CLI - a Natural Fit". A lot of Vista goodness is hard to get to from managed code. In the precon I showed you how leveraging other people's work (specifically the Vista Bridge and the Preview Handler Framework Stephen Toub wrote for MSDN Magazine) can eliminate some of that difficulty. In my C++ talk I drilled a little further, into things like property handlers that can only be in native code (same for thumbnail providers though I didn't show one) and flukes of the IDE that (for Visual Studio 2005 anyway) make adding a UAC manifest easier for C++ developers. The slides should be on CommNet for registered attendees, and if you want the code samples you can drop me a line. The property handler sample is straight out of the SDK so I don't need to send you that.

Kate

 

Tuesday, 05 June 2007 16:11:58 (Eastern Daylight Time, UTC-04:00)  #    
# Saturday, 02 June 2007

A while back the blogs went nuts with the FizzBuzz game. It all started with a discussion of asking people to write code in job interviews. I do this, and I feel it really helps me to hire good people. However I ask something that appears to be much simpler than FizzBuzz, and I get interviewees who completely and utterly mess it up. I don't just mean that they write code the compiler would reject -- they write things that are too complex or that aren't in the language we just agreed they were going to write it in -- and when they look over what they've written on the whiteboard they don't see a problem.

Why the blogs went nuts is that commenters to the original post just couldn't resist trying to submit a solution. The general form was "man, you're an idiot, that problem is way too simple, it's just four lines of code! Like this:" immediately followed by a solution that DID NOT WORK. This unintentional hilarity continued with people trying to correct each others solutions and often failing. Then as that started to wind down, the language zealots came along to prove that FizzBuzz solutions posted by random commenters only had errors in them because of the languages the commenters chose, and that a Ruby version or the like would be much easier. Some of those had errors too. Assembly language, Cobol, Perl, ... I'll let you search out those solutions (quality varies) yourself.

But one in particular I really like for its spectacular uselessness while demonstrating great strength with the tool. Can you believe FizzBuzz in C++ compiler error messages?

 T0=boost::mpl::int_<0>,
 T1=boost::mpl::vector<boost::mpl::int_<1>>,
 T2=boost::mpl::vector<boost::mpl::int_<2>>,
 T3=Fizz,
 T4=boost::mpl::vector<boost::mpl::int_<4>>,
 T5=Buzz,
 T6=Fizz,

Take a look at what Adam Petersen has done. Would I hire him? You betcha.

Kate

 

Saturday, 02 June 2007 09:19:01 (Eastern Daylight Time, UTC-04:00)  #    
# Thursday, 31 May 2007

It's time to get serious about planning my Tech Ed time next week. So far I have these immovable rocks, some of which I hope will be a don't-miss for you too:

I will be spending time at the RD Booth too so if you miss me at one of my sessions, look for me there! I'm hoping to have a fantastic week meeting developers and talking about Vista, C++, and interop in my real world and in yours. I'm also hoping to stay INDOORS as much as I can. Here at home it's in the high 20s even low 30s (Celsius, in other words HOT) but the humidity is nice and low. I know that's not what I'll find once I get to Orlando.

Kate

Thursday, 31 May 2007 11:52:54 (Eastern Daylight Time, UTC-04:00)  #    
# Thursday, 29 March 2007

Nikola Dudar has posted his talk and demos from the MVP Summit and SD West. If you would like to put the STL/CLR through its paces this is a great starting point.

Kate

Thursday, 29 March 2007 12:03:37 (Eastern Standard Time, UTC-05:00)  #    
# Wednesday, 28 March 2007

Apparently your project hash table can get corrupted, and if this happens to you, during a build you will go to 100% CPU and Visual Studio will stop responding. Yuck! There's a hotfix if you need it.

Kate

Wednesday, 28 March 2007 11:59:43 (Eastern Standard Time, UTC-05:00)  #    
# Saturday, 24 March 2007

Oh yes! I have been waiting for the marshaling library for ages! And I just pointed to a VC++ team post about the common controls changes for MFC. Here's the marshaling library in a nutshell:

Back and forth between all the different kinds of strings, various managed and unmanaged types, all the stuff about where things are allocated and how they are freed ... it's usually just 4 or 5 lines of code each time but it's gross and you have to look it up every time. Now these templates will take care of it for you. Beautiful! And on top of that, it's sometimes even faster than doing it yourself the old way!

And check this out, all those who are allergic to angle brackets:

Watch the whole video, of course. Go, Sarita!

Kate

Saturday, 24 March 2007 11:54:14 (Eastern Standard Time, UTC-05:00)  #    
# Thursday, 22 March 2007

The Visual C++ team has an update for you about their Orcas plans around MFC and the Common Controls in Vista. There are a lot of new APIs in Vista compared to XP, but just as important there are new styles (like the style that makes a button a CommandLink) and messages (like the message to a button that tells it to draw itself with a security shield.) Right now to work with these new "thingies" (my technical term for them) you need to send Windows messages. In Orcas there will be design time support for all this and more. Even the new Common File Dialogs will be yours as if by magic.

Looking forward to it!

Kate

 

Thursday, 22 March 2007 11:41:17 (Eastern Standard Time, UTC-05:00)  #    
# Wednesday, 21 March 2007

I have such a good time when I do .NET Rocks with Carl and Richard! I'm sitting around chatting with my buds, doing a little shop talk, sharing horror stories -- the time flies by. I hope one or two of you enjoy listening to it, too. Some things I heard myself say that sound pretty funny now:

  • you're out of feet, i'm taking over
  • it's the speed of light -- we're screwed

That first one is the CLR talking to people who messed up constantly on memory management. The second is of course the concurrency story. Along the way we talked about Vista (a lot) and covered plenty of ground. Why not give it a listen?

Kate

 

C++ | Concurrency | RD | Speaking | Vista
Wednesday, 21 March 2007 11:39:22 (Eastern Standard Time, UTC-05:00)  #    
# Wednesday, 14 March 2007

Yikes! How can an API call be banned? Well, these functions from the C Runtime Library (CRT) will trigger warnings from the compiler in Visual C++ 2005 and beyond. I've blogged about this before, and linked to an older paper about it too. Now Michael Howard has an updated article that lists all the "banned" CRT calls and suggests what to use instead. He also clarifies the role of the StrSafe functions and compares them to the _s versions of the insecure CRT functions. Definitely recommended reading if you're maintaining an older code base and worry about it a little.

Kate

Wednesday, 14 March 2007 10:33:16 (Eastern Standard Time, UTC-05:00)  #    
# Tuesday, 13 March 2007

First, this Information Week article says "there's a greater call for IT professionals in the New York and New Jersey area than there is in Northern California". Then they say something really strange: "When it comes to programmers, the C and C++ languages were the most popular with 18,290 job postings, while Microsoft's .Net drew 14,807." Wow. Ignoring the fact you can do C++ on .NET, that's still quite a dramatic ratio. It's partly because the jobs include other operating systems, like Linux, and C++ is The cross-platform language. But I know (because people email me asking to help them find staff) that C++ programmers are getting hard to find. Who'da thunkit?

Kate

 

 

Tuesday, 13 March 2007 22:53:35 (Eastern Standard Time, UTC-05:00)  #    
# Tuesday, 06 March 2007

Hey, this is great, my Tech Ed talk was accepted this year. This is the earliest I've known I'll be speaking at Tech Ed USA. (I know, I already knew I was headed there for the pre-con, but now I have a breakout.)

C++/CLI and Vista: a natural fit

Vista brings a host of new features that developers can use to create beautiful, powerful, and intuitive applications. Some of these features are easy to access from managed code while others are more of a challenge. These features are generally easy to access from native code. By using C++/CLI, a developer can call either native or managed APIs with maximum ease. This session will demonstrate a variety of different Vista features to illustrate the strengths of C++/CLI.

This should be a level 300 talk and I'm really looking forward to it!

Kate

Tuesday, 06 March 2007 08:45:39 (Eastern Standard Time, UTC-05:00)  #    
# Sunday, 25 February 2007

One of the things that C++ can do that C# can't is MSIL linking from the IDE. Normally when you have a solution with two projects, a build creates two assemblies (one .exe and one .dll) for you to deploy. Sometimes you want to deploy only a single file, but you want two projects. Sometimes you want the advantages of static linking while you're creating MSIL and deploying onto the CLR. So how do you do it?

I created a tiny little solution with two projects, both in C++. One is a console application and the other is a library. I set the library to compile as /clr:safe and the console app as just plain /clr. In the console app I added a reference to the library.

At this point if I build and run I will have HelloWorld.exe and Library.dll.

Now I went to the Library project settings and made a few changes. First, on the Advanced tab of Linker options, I turned off assembly generation:

This gets the linker to make an assembly fragment called a .netmodule rather than an assembly. Next I changed my output file name:

Then I deleted the reference in the console application, and re-added it but this time to Library.netmodule instead of Library.dll. One more thing, the linker inputs in the console application need to include the .netmodule:

 

At this point I can build the solution, and delete Library.netmodule, Library.dll and the like and HelloWorld.exe will run just fine. I don't need to deploy Library because it's actually inside HelloWorld.exe - that's MSIL linking.

I have a mentoring client who is using this right now. They have an MFC application with a mix of native and managed code and it can't be compiled /clr:pure. They want to add some WinForms controls to that application, and the designer can only work with verifiable assemblies. So now one project is the user controls, and it's /clr:safe, and the the main exe is a mixed assembly. Yet they only deploy a single file in the end.

Kate

Sunday, 25 February 2007 19:18:55 (Eastern Standard Time, UTC-05:00)  #    
# Saturday, 24 February 2007

Man, the hits just keep on coming at Channel 9. This time it's Rico Mariani, nominally on performance but in my opinion really on how to have a successful career. Reminiscing about the University of Waterloo, computer stores in Toronto, the amazing Ontario Science Centre, and a Commodore PET (all things from my past though I didn't work at these places I just visited them) he somehow works into every sentence how being a nice person and wanting to help is a recipe for success. Later he starts talking about creative leaps and eventually about how to make your programs faster.

Want to be seen as an expert? Want to be put in charge of something? Want to make a difference in someone's life? Watch it! It's a huge download - over 800 meg - but so worth it.

Kate

Saturday, 24 February 2007 18:37:15 (Eastern Standard Time, UTC-05:00)  #    
# Friday, 23 February 2007

Who knew that picking up enough programming knowledge to teach it to talented kids at a summer camp could lead to a career doing some of the geekiest and most detailed work there is in this business - testing the compiler itself to make sure it still works the way it's supposed to? That's just one of the nuggets of information in this latest Channel 9 C++-land interview:

Meet Marina Polishchuk, a software engineer on the VC++ quality control team. Her mission: Outsmart the compiler with clever programs that confuse and or break it. Fun stuff. Here, we learn about what she does, why she does it and how she got here. Enjoy!

Kate

Friday, 23 February 2007 07:06:13 (Eastern Standard Time, UTC-05:00)  #    
# Monday, 19 February 2007

Channel 9 has discovered C++ land and just doesn't want to leave. This time it's Nikola Dudar's turn and he talks about STLCLR (which has had various other names in the past):

If you write STL code and want take advantage of the BCL while still being able to write STL code, then you're in luck. How so? Well, Nikola Dudar, program manager in the VC++ Libraries Group explains, in detail, the Orcas STLCLR library. We also dig into the evolutionary trajectory of VC++, and discuss some other interesting Orcas C++ libraries. Tune in. Lots of great stuff going on in VC++ World...

Keep 'em coming, Charles!

Kate

Monday, 19 February 2007 15:40:09 (Eastern Standard Time, UTC-05:00)  #    
# Tuesday, 13 February 2007

Here's another C++ video on Channel 9. And this one is about strategy and vision:

How will VC++ evolve? How has the advent of managed code affected the evolutionary trajectory of VC++? What's the VC++ team up to these days, anyway? How much time are they spending innovating C++, the native language?

Tune in and learn first hand from two people who know the answers to the above questions (and much more); Steve Teixeira, Group Program Manager, and Bill Dunlap, Program Manager.

If you want to know where Visual C++ is heading, then you definitely want to watch this interview. If you are a C++ developer, the message should be very loud and clear: Microsoft has not forgotten about you!

These guys know you don't want to throw your old code out and it isn't broken. You want to keep working with it. You want to extend it to pick up new shiny good stuff, but you don't want "step 1: port the whole thing to C#." They also know you love the language and you want Microsoft to love it and love you. And they realize that C++ doesn't need to be all things to all people, because most folks who have mastered C++ can pick up the C# or VB they need when necessary. So if you accept those two premises - that native code is super important, and that not every single UI wizard needs to support C++ - where do you think that leads? Watch and find out.

Kate

Tuesday, 13 February 2007 11:39:05 (Eastern Standard Time, UTC-05:00)  #    
# Monday, 12 February 2007

Aaron Stebner has a blog post and an update on installing the C++ redistributables (msvcr80.dll, atl80.dll and the rest.) You can choose

  • the user doesn't need to do anything, but there's a progress dialog and it has a cancel button
  • the user doens't need to do anything, there's a cancel dialog, but no cancel button
  • there's no ui at all and nobody knows what's happening

Turns out the command line you use varies a tiny bit for redistributable packages you installed with Visual Studio or those you get from the web, so read both posts.

Kate

Monday, 12 February 2007 11:24:12 (Eastern Standard Time, UTC-05:00)  #    
# Saturday, 10 February 2007

Visual Studio 2005 SP1 included new versions of some C++ libraries. Your application's manifest specifies what versions of the DLLs it wants -- so if you build with SP1, the application is going to look for SP1 versions at runtime. That has consequences for your deployment strategy, since non developers are unlike to have SP1 versions of those DLLs yet.

Nikola Dudar has gathered some questions and answers on this topic. I'll give you the questions, read his blog for the answers:

  • It looks like with VS2005 SP1 if a new version of VC++ libraries is installed, all apps start using it. Is this new policy for VS2005 SP1?
  • When my application is rebuilt with VS2005 SP1 it runs only when SP1 versions of VC++ are installed. Why does not it run when RTM versions of libraries are installed? Is this new policy for VS2005 SP1?
  • This behavior of VC++ libraries in VS2005 SP1 is it only specific to SP or is it going to be same in future releases of SP and hotfixes?
  • Wasn't the whole point of manifests to allow applications to specify the versions of VC++ libraries they want to load?
  • My application is using a DLL that is built with VS RTM. The application links against import library of that DLL and call exports of that DLL at runtime. Is this going to work with VS2005 SP1 and other SPs?
  • My final product is a set of DLLs. If I release a version of my DLLs built with VS2005 SP1, can my users who use VS2005 RTM to use these libraries?
  • My application is linking to static library party is built with VS RTM. Is this going to work with VS2005 SP1 and other SPs?
  • I see VS2005 SP1 has installed SP1 version of VCRedist*.EXE. Should I send it to my customers and ask them to install it?
  • I am using MSMs to redistribute RTM versions of VC++ libraries. Should I sent SP1 version of VCRedist.EXE to my customers and ask them to install it?

If these questions matter to you, then you have a blog post to read, don't you?

Kate

Saturday, 10 February 2007 11:07:33 (Eastern Standard Time, UTC-05:00)  #    
# Friday, 09 February 2007

Bruno van Dooren, C++ MVP and general nice guy, blogged recently on "Is C++ still a viable language?" He makes lots of good points about interop, templates, and control. He points out that some UIs are a lot easier to build with C#. Then, out of the blue, he says mean things about VB. I know he's only joking, but I just felt I had to defend VB's honour.

Here's the thing. C#, it's mostly just VB with semicolons, you know? And that's not an insult, you shouldn't gasp when you read it. VB's a good and useful language. [Of course I mean VB.NET, come on, we're coming up to our fourth release, the default VB is VB.NET now.] It's no secret I do far more work in VB than in C#. Once in a blue moon I want to do something in VB that would be easier in C# (last week I wanted to delay hooking up button handlers until some initialization was in place, something the Handles keyword isn't going to do for me) and if I did more C# I would probably find the occasional thing that would be easier in VB. Big deal! I can always find a way to do those things anyway. What matters is the framework, and that's the same in VB, C#, or C++/CLI. I like the synactic sugar of Dispose=destructor more than the synactic sugar of "using" or "Using" but the underlying mechanism is the same in all three cases.

Kate

Friday, 09 February 2007 11:00:29 (Eastern Standard Time, UTC-05:00)  #    
# Thursday, 08 February 2007

Herb updates us on the next C++ standard:

I'm happy to report that work on "C++0x", the much-anticipated Version 2.0 of the ISO C++ standard, has dramatically picked up steam over the past few months. The ISO C++ committee has now published the first partial draft of C++0x and plans to publish a complete public draft before the end of 2007.

As part of the push to get this done, the committee is having extra meetings, including one in Toronto in July. Hmmmm.....

You need to read Herb's blog post yourself for the details on what's in C++ 0x (Concepts, Garbage Collection, Memory Model for Concurrency, Concurrency Libraries) and what's not (Modules, Dynamic Libraries) with helpful links to even more details. This is our future -- and you can be sure, C++ has a future.  

Kate

Thursday, 08 February 2007 10:46:46 (Eastern Standard Time, UTC-05:00)  #    
# Tuesday, 06 February 2007

I missed this article when it first appeared. Mary Jo Foley talked to Jason McConnell, me, and David Johnson about getting to all the new exciting Vista goodies, and how it's a bit easier from C++ because you can mix and match native and managed so simply. Watch for more guidance and guidelines on this from Microsoft coming soon.

Kate

Tuesday, 06 February 2007 10:33:14 (Eastern Standard Time, UTC-05:00)  #    
# Sunday, 04 February 2007

These are nice ... posters of all the Visual Studio keyboard shortcuts (language specific, according to your Visual Studio settings) are now available. Here's a snip of the C++ colour one (there's a black and white one too.)

Go get it!

Kate

Sunday, 04 February 2007 12:35:14 (Eastern Standard Time, UTC-05:00)  #    
# Thursday, 01 February 2007

[Sorry about the blogging gap - nothing dramatic, just a little case of overworked and underslept. Good excuse to start up again though.]

Imagine a room with a table, no computers, and four really smart people who care tremendously about helping people write software, and who tackle questions like "what keywords should be in this language" every day -- and whose decisions actually will get implemented. A full hour of amazing conversation appeared recently on Channel 9.

How will imperative programming languages evolve to suit the needs of developers in the age of Concurrency and Composability? What role can programming languages play in enabling true composability? What are the implications of LINQ on the furture of managed (CLS-based) and unmanaged(C++) languages? How will our imperative languages (static) become more functional (dynamic) in nature while preserving their static "experience" for developers? 

Answers to these questions and much more are to be found in this interview with some of Microsoft's leading language designers and programming thought leaders: Anders Hejlsberg, Technical Fellow and Chief Architect of C#, Herb Sutter, Architect in the C++ language design group, Erik Meijer, Architect in both VB.Net and C# language design and programming language guru, and Brian Beckman, physicist and programming language architect working on VB.Net.

This is a great conversation with some of the industry's most influential programming language designers. Tune in. You may be surprised by what you learn...

Some quotes and paraphrases that caught my attention:

  • "No language can ignore concurrency and stay successful for mainstream programming over the next five, ten years."
  • our entire industry is based on composable software and we manage to do composable software with the languages, libraries and frameworks we have now. it's rather amazing that we can do it.
  • "all you can do as a language designer is slow down the accrual of new features that will eventually lead to cave in."

Now if you aren't sure you know what a lambda expression is, or what makes a language functional as opposed to imperative, or what LINQ would have to do with that, or what composability is, then you may think you don't want to watch this video. But you'd be wrong! Spend this hour with these gentlemen and not only will you learn all those things, you'll learn why it affects you and why you should be following, at least a little bit, the current work in this area.

Watch it!

Kate

Thursday, 01 February 2007 20:05:14 (Eastern Standard Time, UTC-05:00)  #    
# Wednesday, 17 January 2007

Try this. Open up Visual Studio and make yourself an MFC app. It doesn't really matter what kind of application it is - a dialog app is probably the quickest to create but you could use some more complex MFC app that you happened to have lying around if you preferred. Build the app and run it to prove to yourself that it's fine.

Now bring up the project properties, and under Configuration Properties, General set Common Language Runtime Support to Pure MSIL Common Language Runtime Support.

Click OK and build the application. Blam! Errors everywhere. My little nothing dialog application got 18 and they all look like this:

1>C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\include\afxv_w32.h(242) : error C3641: 'DrawState' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe

1>C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\include\afxv_w32.h(260) : error C3641: 'DrawStatusText' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe

1>C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winbase.h(1849) : error C3641: 'FreeResource' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe

What does this mean? Well, every function has a calling convention. These include __stdcall, __clrcall, __cdecl, and so on. Many of the functions in the MFC libraries (look at the include files for which these errors occur) are declared to be __stdcall, meaning that they are common-or-garden native C++ functions. But when you compile your application /clr:pure, you are saying "I don't have any common-or-garden native C++ functions in here. Everything is managed."

Since you can't change MFC, you have to change your compiler options. Change the CLR support to just "Common Language Runtime Support (/clr)" and build again. All the errors go away.

Kate

Wednesday, 17 January 2007 12:05:53 (Eastern Standard Time, UTC-05:00)  #    
# Tuesday, 16 January 2007

Thottam R. Sriram has an article in the January MSDN Magazine called CLR Inside Out: Introduction to COM Interop. As the introduction says:

COM is a wonderful technology. One aspect of the common language runtime (CLR) that makes it an extremely powerful platform is that it allows seamless interactions between Microsoft® .NET applications and unmanaged COM components. However, when I searched the Web, I found few working samples demonstrating the very basic concepts of COM interop. The purpose of this column is to illustrate those basic concepts in order to provide solid working examples that can jump-start users in this technology.

I'll start off with a simple Active Template Library (ATL) COM server and try accessing methods in this server using an unmanaged COM client, then do the same thing with a managed client. I'll walk through the various DLLs to illustrate the translation from unmanaged to managed, and I'll show how to access an exported method in an unmanaged DLL using P/Invoke. The toughest part of this is to figure out marshaling of complex structures, which I don't cover exhaustively in this column-it would be a complete column (or book) on its own. I'll show you how unmanaged code can call back into managed code using interfaces. (You could do this with delegates as well, but I won't cover that in this column.)

Finally, I'll discuss debugging your COM interop project using public symbols. This will give you very basic introduction to WinDbg.exe, unmanaged debugging, and managed debugging using SOS. I'll demonstrate the stack from managed to unmanaged as calls are made in either direction.

The managed client is in C# -- when you write your clients in C++/CLI you don't have to figure out how to declare and marshal complex structures, after all. And seeing how to call back from native code to managed code is helpful indeed. I'm not sure if Reverse P/Invoke is the official name for this, but it works for me. You set up an interface in your C# code and decorate it with attributes for COM. Then you implement that interface in your code and use tlbexp to make a COM Callable Wrapper around your .NET object. Then you hand-define the same interface as a COM interface in your native code and you're all set. The .NET code can P/Invoke some native function and pass in a reference to the .NET interface. By the time it's unmarshaled over in the native world, it's become a smart pointer to that COM interface and you can invoke the method from the native code. It's a little tricky, but it's not hard - once you've seen it done.

Since the article wraps up by touching on Windbg, there's something for everyone. Check it out!

Kate

 

Tuesday, 16 January 2007 11:42:47 (Eastern Standard Time, UTC-05:00)  #    
# Sunday, 14 January 2007

Here's another reason to install Visual Studio SP1 - it fixes one class of "intellisense stops working" problems. Intellisense stops working a lot for C++ developers. It doesn't happen very often for me, but people mention it quite often when I speak and some of my coworkers are less lucky than I am because it happens in their day to day work.

If Intellisense stops working for you and you're working on a C++ project, the workaround is to close Visual Studio, find and delete the .ncb file, and re-open Visual Studio. As you can imagine, that cuts into flow quite a bit. Now a KB article mentions that SP 1 fixes "In a Microsoft Visual C++ 2005-based solution that includes multiple projects, the IntelliSense of a project does not work correctly if the project references types from another Visual C++ or Visual C# project." Cool!

Kate

Sunday, 14 January 2007 21:48:29 (Eastern Standard Time, UTC-05:00)  #    
# Wednesday, 10 January 2007

Eric Lee has spotted the Vista-programming-is-easier-with-C++/CLI phenomenon for himself.

... I have really come to enjoy the second incarnation of managed C++, now called C++/CLI. Unless you are really good at .NET marshalling, a lot of great Windows Vista features just aren't that accessible from .NET.  This is where C++/CLI really comes into its own.

He gives a nice example featuring a preview handler. Preview and thumbnail handlers are really cool in Vista, but you have to implement some COM interfaces to do it. His final conclusion:

I'm pretty pleased with how C++/CLI gave me a way to mix what C++ and ATL do pretty well (COM, Shell Extensions, etc) with what .NET does pretty well (user interfaces, dnd design, etc).

Best of both worlds! I have a slide or two that say that :-)

Kate

Wednesday, 10 January 2007 20:21:10 (Eastern Standard Time, UTC-05:00)  #    
# Tuesday, 09 January 2007

The January Orcas CTP is ready. The new C++ features include .NET Framework Multitargeting (allows the user to target different versions of the .Net framework from a single instance of Visual studio) and Library Versioning (renaming assorted libraries with 9 in their names because they differ from the current versions.) There's a handy list of Orcas features and which CTP they first appear in on MSDN. To view the documents, you'll need an XPS viewer unless you're already using Vista day to day.

Community Technology Previews are not as fully tested as betas, but they're here now, and you can provide feedback after working with them, so why not take a look?

Kate

Tuesday, 09 January 2007 07:38:48 (Eastern Standard Time, UTC-05:00)  #    
# Sunday, 07 January 2007

Let's see, I got dinged (so far) by

If I don't step up and produce my Five Things pretty quickly, there won't be anyone with a blog left for me to tag!

  1. I have a PhD in engineering -- Chemical Engineering to be precise -- from the University of Toronto. My thesis title had way too many "of"s in it and was about modelling the very first steps in blood coagulation at a surface. Simultaneous partial differential equations! Boundary layer! Non-Newtonian fluids! Woo hoo! My undergrad work was also in Chemical Engineering, at Waterloo.
  2. If you don't count co-op jobs while an undergrad, TA-ing while a grad student, part time lecturing, and the like, I have held only two "real" jobs in my entire life, one for two years between graduating from my undergrad and starting my grad work, and the other as partner here at Gregory Consulting ever since.
  3. I am an elder in a martial arts system, one of only six in that system. Don't try to beat me up though... we'll both be sorry.
  4. I never lie. I sometimes say I can't talk about something, or I say something that I know is deceptive but is technically true, but I do not lie. For example, I only say "this demo worked on the plane!" if it really did. But I might say "they haven't announced anything" knowing that you will conclude I don't know, when in fact I do know but can't tell you. Sorry.
  5. I adore my kids, and put them first in just about everything I do. I've turned down conferences because it conflicted with family things, and followed a lower-salary career path so I'd have time to be hugely involved in what they do. I even homeschooled one of them half days for an academic year. I just don't talk about them much in my blog to give them some privacy. As a result many people think I don't have kids! Trust me, when we're together in person and it's not all being archived for some future romantic interest of theirs to read 20 years from now, I'll talk your ear off about these sweet, funny, smart, hardworking, reliable little angels!

There.

Now, my victims. Who on my favourites list is not already playing, but knows me enough to take a tag from me?

Kate

Sunday, 07 January 2007 14:18:56 (Eastern Standard Time, UTC-05:00)  #    
# Saturday, 06 January 2007

Joe Duffy has moved from the CLR team to Parallel LINQ. How do you like this offer:

We're looking for supersmart technical people to join the team and help change the face of programming for anybody writing code on the CLR or VC++. PLINQ isn't the only project. Solid CS skills are a must, but you don't necessarily have to be a concurrency guru (right away).

Help change the face of programming? Sounds (almost) irresistible to me!

Kate

Saturday, 06 January 2007 13:41:16 (Eastern Standard Time, UTC-05:00)  #    
# Tuesday, 02 January 2007

The nice folks in the MVP program have decided I am still a Most Valued Professional for C++. Or to be specific, "Visual Developer - Visual C++". It's a delight as always to be among such company and I notice the C++ crowd has grown a bit this year. I really value my membership in this program.

Kate

C++ | MVP
Tuesday, 02 January 2007 13:10:02 (Eastern Standard Time, UTC-05:00)  #    
# Tuesday, 12 December 2006

Gee, ten minute talks on very specific technical topics... where have I heard that concept before? It really is something technical people need. Here are a bunch from MSDN in the UK along with a pretty nice UI to let you filter by technology, content level, even presenter if that's important to you. They seem to upload more about every other month.

I took a quick listen to "Wrapping Windows APIs with C++/CLI" and I liked it.

Kate

Tuesday, 12 December 2006 14:29:29 (Eastern Standard Time, UTC-05:00)  #    
# Sunday, 10 December 2006

The title isn't mine, it's Charles Petzold's, and I would be quite surprised if you didn't learn things about C++/CLI just by learning things about the .NET Framework. In other words, you don't need to plan to switch to C# to get some benefit of this free e-book. It was originally supposed to be a chapter, but ended up over 250 pages long.

I know people still need this material. I have a new mentoring client with an established team of C++ developers who are just looking at moving to the .NET Framework. I came and did a "what is .NET" talk for them, with diagrams like this:

 

If you already recognize these pictures and realize what they are supposed to illustrate, then you don't need the e-book. But if you haven't really paid much attention to the .NET Framework, then this is a fairly painless way to learn a lot of it. The thing is, it's all C#. My suggestion to you is to bear with that -- a C++ programmer can read C# without too much difficulty -- and then come on back here to see how to do the same things using idioms you already know and love, and how to drop back into native code any time you like for various reasons include control over your application's performance.

Kate

Sunday, 10 December 2006 13:45:07 (Eastern Standard Time, UTC-05:00)  #    
# Saturday, 09 December 2006

I was just looking at some old-style MC++ to convert a sample into C++/CLI. I had to convert this sort of thing:

public __gc class PostCodeChecker
{
public:
    virtual String* Check(String* code)
    {
        String* error = S"OK";
        return error;
    }
    Boolean Test(String* code)
    {
        Boolean ret = false;
        String* error = Check(code);
        if (error->Equals(S"OK"))
        {
            ret = true;
        }
        return ret;
    }
};
Into this sort of thing:
public ref class PostCodeChecker
{
public:
    virtual String^ Check(String^ code)
    {
        String^ error = "OK";
        return error;
    }
    Boolean Test(String^ code)
    {
        Boolean ret = false;
        String^ error = Check(code);
        if (error=="OK")
        {
            ret = true;
        }
        return ret;
    }
};

This is pretty mechanical work and just the sort of thing you might like to hand off to a tool. The VC++ team has been working on one, but it hasn't been a top priority. Now they've decided to release it as-is to those who might have some use for it, rather than holding onto it until it's perfected:

To set expectations correctly, the tool was going to be a “help” rather than a complete solution and in the push to complete other projects the tool was never fully completed, tested or documented. We are happy to release the tool “as is” as a few initial tests with external users have shown that they received benefits from using the tool even if: 1) it does not provide complete translation between the two different syntaxes and 2) manual modify of the outputted source code is still required to complete the conversion. The tool does come with source code so that users who wish to modify or extend the functionality to better suit their code bases can. The tool is totally unsupported by Microsoft.

If you have some oldstyle Managed C++ to convert, why not see if it can help you? It's a 5 meg download.

Kate

ps: one of the side effects of the more readable nature of C++/CLI is that after the mechanical work was done I just had to do this:

Boolean Test(String^ code)
{
    return Check(code)=="OK";
}

 

Saturday, 09 December 2006 07:44:38 (Eastern Standard Time, UTC-05:00)  #    
# Friday, 08 December 2006

Do you read Raymond Chen's blog? You really should. Like so many of the blogs I read these days, it is also going to be available as a book.

Ryamond says:

Luckily, I found a sympathetic ear from the folks at Addison-Wesley Professional who were willing to take a chance on my unorthodox proposal. But I caved on the length, bringing it up to 500 pages. Actually, I came up with more like 700 pages of stuff, and they cut it back to 500, because 700 pages would take the book into the next price tier, and "There isn't enough of an audience for a book that big!"

Eighteen months later, we have The Old New Thing: Practical Development Throughout the Evolution of Windows, following in what appears to be the current fad of giving your book a title of the form Catchy Phrase: Longer Explanation of What the Catchy Phrase Means.

It's a selection of entries from this blog, loosely organized, and with new material sprinkled in. There are also new chapters that go in depth into parts of Win32 you use every day but may not fully understand (the dialog manager, window messages), plus a chapter dedicated to Taxes. (For some reason, the Table of Contents on the book web site is incomplete.)

Oh, and those 200 pages that got cut? They'll be made available for download as "bonus chapters". (The bonus chapters aren't up yet, so don't all rush over there looking for them.)

This is a kind of trend really - many writers have put energies into blog posts instead of books, only to look up and discover that some of the posts, rearranged into an approrpriate order and with a little writing to connect them, make a pretty cool book. It's not clear whether it will be out in time to ask for it as a Christmas present, but it would be a cool way to use any booky gift certificates people give you.

Kate

Friday, 08 December 2006 11:04:21 (Eastern Standard Time, UTC-05:00)  #    
# Thursday, 07 December 2006

In Barcelona, I was on the panel for the Barcelona Girl Geek Dinner. Now, lest anyone be under the illusion that these panels are carefully peer-selected and reviewed, that there's some committee somewhere finding the cream of modern geekhood -- well maybe that was how the others were chosen but for me, I was hanging out in the speaker room when Sarah, who I'd only just met, asked me if I'd do it and I said yes.

I had a lovely time at the panel and we all spoke about our experiences, advice to newbies, how nice it is not being "the only one in the room" from time to time, and so on. I was sitting with Catherine and Cyra, two of my fellow panelists, and Charles Torre of Channel 9 was with us, and we talked over dinner and wine the way in my experience geeky women always do -- a fast paced mix of very technical shoptalk and personal getting-to-know-each other material. (I learned a lot from Cyra and wish we had had more time together.) When the event ended, the four of us walked together across the street to the speaker hotel, but it was such a short walk and we weren't finished talking. Someone expressed an interest in dessert, and we decided to see what the lobby bar had to offer. We kept on talking, and at one point Catherine and I were trying to convince Charles that "the compiler is your friend" -- that strong typing and early binding have big advantages. Charles kept saying "I can't believe I'm not filming this" until eventually he picked up the camera and started to film. He asked us questions he knew we cared strongly about and off we went.

The resulting video is now on Channel 9. It seems to kind of start in the middle because, well, we started in the middle. I suspect it's the only video on Channel 9 featuring gestures with a glass of Scotch. It's one of the very few that doesn't feature exclusively Microsoft employees, so I am honoured to see it there. Those of you who have heard my line "I stay up late over too much red wine arguing about deterministic destruction" can now see that in action. We don't introduce ourselves till the very end, so if you need to know who's who, download the whole thing, skip to the end, then go back to the beginning and watch us.

Kate

Thursday, 07 December 2006 10:51:37 (Eastern Standard Time, UTC-05:00)  #    
# Sunday, 03 December 2006

Technology Review has an interview with the father of C++. Some notable quotes:

  • There has to be languages for those experts to use--and C++ is one of those languages.
  • I want elegant and efficient code. Sometimes I get it. These dichotomies (between efficiency versus correctness, efficiency versus programmer time, efficiency versus high-level, et cetera.) are bogus.
  • There are just two kinds of languages: the ones everybody complains about and the ones nobody uses.
  • The main reason for C++'s success is simply that it meets its limited design aims: it can express a huge range of ideas directly and efficiently. C++ was not designed to do just one thing really well or to prevent people doing things considered "bad." Instead, I concentrated on generality and performance.

Read the whole thing!

Kate

Sunday, 03 December 2006 15:03:02 (Eastern Standard Time, UTC-05:00)  #    
# Wednesday, 29 November 2006

To follow up on my post about pinning pointers, let me ask one of those tricky questions that someone asked me. If I have an array of things, how do I pin the whole thing? If I ask for a pinning pointer based on element #3 of the array, can I use pointer arithmetic from that pinned pointer to reach elements #4 through #11? Do I have to pin each element one at a time?

The answer is that pinning any element of an array pins the whole array, and that once you have a pinned pointer to one element of the array you can do the usual pointer things. This includes not only incrementing it to move through the array, but if it's a char* you can pass it to things that expect strings and those things will never know the difference. Here's an example from MSDN:

array<Byte>^ arr = gcnew array<Byte>(4);
arr[0] = 'C';
arr[1] = '+';
arr[2] = '+';
arr[3] = '\0';
pin_ptr<Byte> p = &arr[1];   // entire array is now pinned
unsigned char * cp = p;
printf_s("%s\n", cp); // bytes pointed at by cp will not move during call

This sample prints out ++.

Kate

Wednesday, 29 November 2006 08:42:29 (Eastern Standard Time, UTC-05:00)  #    
# Monday, 27 November 2006

I use search engines for a variety of reasons. Sometimes I want to find out how to do something. Other times, I want to find the official page about something so I can link to it here or send it to someone. Since most of the things I want to learn are related to things I already know, and since I blog about a lot of what I know, I have a bit of an occupational hazard:

One of my mentoring clients complained about this to me. "I decide to search the Internet instead of calling you to ask and what do I find? A bunch of stuff you wrote!". Believe me, it's worse when all I can find is a bunch of stuff I wrote. And Peter Near, a fellow MVP, Flyertalker, and Ontarian, has the same problem.

I would get in the habit of excluding gregcons.com from my search results if not for two things: first, a lot of my stuff is published on other sites, and second, from time to time my old words help me remember something I'd forgotten. So I guess I'm stuck with it.

Kate

Monday, 27 November 2006 07:25:06 (Eastern Standard Time, UTC-05:00)  #    
# Sunday, 26 November 2006

I've recently been asked (again) about pinning pointers so I decided to blog it, so that next time I can just email the link and save everyone a little time :-)

When you're working in C++/CLI, there are two kinds of indirect access to objects: handles and pointers. A pointer is that good old friend (fiend?) we've known for so long and it holds the address of a place on the native heap or the stack. You get a pointer by using the new operator with a type, or the address-of operator, &, with an instance:

Customer c("Microsoft");
Customer* pc1 = &c;
Customer* pc2 = new Customer("CTV");

Pointers stay still. You can cast them to ints, stick those ints into collections, do whatever you like to them, and later cast them back to pointers and dereference them and if they were pointing to something on the heap, like pc2 does, they will still be pointing to the same place on the native heap the whole time. What's more, the instance they point to will not have gone anywhere unless you explicitly delete it yourself.

Handles are the new kid on the block and they sorta-point-to a place on the managed heap. You get a handle by using the gcnew operator with a type, or the make-me-a-handle operator, %, with an instance:

Employee e("Kate", "Gregory");
Employee^ he1 = %e;
Employee^ he2 = gcnew Employee("Brian","Gregory");

Handles don't stay still. If you found a way to get the value out of them and then stuck it somewhere and let the handle itself go out of scope, the garbage collector might clear away the item on the heap, making the number meaningless. Even if you kept the handle in scope, the garbage collector might move the item to somewhere else, making the number meaningless.

Now normally this is nothing more than an interesting fact, one of the differences between handles and pointers. But what if you have some information contained inside a managed instance and you need to pass it to some native code that doesn't know about handles? Now you not only need to convert somehow, you also need to ask the garbage collector not to move that heap item while you are holding a pointer to it. This is called pinning. Let's switch to simpler types so you don't have to worry about what's in an Employee object. I need this most often with strings - I have some managed code that gives me a String^ and I need to pass it to some native code that needs a LPCWSTR or the like.

String^ title=HandyLibraryFunction();
{
   pin_ptr<const WCHAR> str = PtrToStringChars(title);
   NativeFunction((LPCWSTR)str);
}

PtrToStringChars is a handy function you will find in <vcclr.h>. Those brace brackets are important -- when the pinned pointer goes out of scope, the garbage collector is allowed to move the item again. You really need to minimize pinning time or you will ruin your app's performance, so I've artificially shortened its lifetime to release it as soon as possible. And whatever NativeFunction does, it better not take a copy of the pointer it's given and save it away for future use, because it will be a dangling pointer once str has gone out of scope -- even if title is still in scope.


The concept is much the same when you want a member variable from a managed instance. Grab hold of it and use the pin_ptr template to pin it and give you a pointer, which you can then work with following all the rules of pointers. Let go of it as soon as you can.

Kate

Sunday, 26 November 2006 17:51:25 (Eastern Standard Time, UTC-05:00)  #    
# Saturday, 25 November 2006

Here's a little oddity I happened across. It's a patent application:

The present invention provides a system and/or method that facilitates expanding keywords within an existing computer programming language by employing a whitespace keyword containing embedded whitespace. A whitespace component can receive code, and create a whitespace keyword based at least upon a successive comparison of adjacent tokens. The whitespace component creates a whitespace keyword by replacing more than one token with a single token containing embedded whitespace. Moreover, the whitespace component can utilize a lexical analyzer to group code into tokens and a parser component to parse the code.

This actually makes sense to me (assuming you accept that the idea of software patents in general makes sense.) It was a huge leap to take a language like C++, where keywords are separated by spaces, and extend it to become a language where some of the keywords actually contain spaces. After all, so many of us already have words like ref and value as variable names: the only way for C++/CLI to work is the conceptual leap that says "ref isn't the keyword, ref class is the keyword." If you wonder how that's actually done... read the patent application.

Kate

Saturday, 25 November 2006 14:54:42 (Eastern Standard Time, UTC-05:00)  #    
# Tuesday, 21 November 2006

When Microsoft discovers a bug in a product, whether it's Windows, Visual Studio, or some other product, they typically fix it. And once that fix is tested and working, the question becomes how to deploy it. Sure, you can put the corrected code into the next version of the product, but that might be years away. There are service packs, but they are pretty far apart, and for good reason. So the first deployment vehicle is the hotfix or QFE (Quick Fix Engineering.) These are typically available only from support and only after you've convinced support you're facing the problem that the hotfix takes care of. (At least, that's the theory. Since a hotfix is a single file, people can and do share them although I suspect you're not supposed to.)

Now there's a new pilot program underway where some hotfixes are being made public, so that you don't have to wait for a service pack. Of course you should approach this with caution, but it can make investigating those hard problems a little smoother. At the moment I see seven hotfixes there: three are for Visual C++.

Kate

Tuesday, 21 November 2006 12:56:15 (Eastern Standard Time, UTC-05:00)  #    
# Saturday, 18 November 2006

Microsoft's Developer Division is really taking this transparency thing seriously. First it opened much of the spec for Orcas, the next version of Visual Studio, to the MVPs, and now it's opening it to the public. Seriously! And not only that, but they're asking you how you feel about these features:

Which features do you think are important? Are we making the wrong assumptions about how you will use Visual Studio and .NET? Are we forgetting about your scenario?

This page lists specifications for Visual Studio and .NET "Orcas". These specifications document the new features you will find in CTP's and provide an opportunity for you to give feedback. Please remember, some features specified below may be cut and others may be significantly altered. We'd love your feedback to help us with this decision process. Your feedback will be delivered into our bug database and shared with the feature team. The team will use your feedback to develop the specification or make improvements to future releases of Visual Studio.

So how important is STL/CLR to you? Or friend templates? Read the specs and scenarios, try them out in the September CTP, then speak up!

There are two things you should know about these documents. First, they can be quite large. The STL/CLR one is 38 pages. Second, they're XPS. On my Vista development machine, with IE7 and Office 2007, I just click to read them. On my XP machine with IE6 and Office 2003, it's not so seamless. Time to get me an XPS document viewer for the laptop.

Kate

Saturday, 18 November 2006 07:40:13 (Eastern Standard Time, UTC-05:00)  #    
# Thursday, 16 November 2006

The nice folks at Microsoft Denmark have uploaded most of the materials from my recent talk. Thanks to Nikolaj for the link. All of this is in Danish but I suspect most of you will figure it out... my materials are in English once you get them. Højere produktivitet will soon be yours!

Kate

 

 

Thursday, 16 November 2006 10:03:01 (Eastern Standard Time, UTC-05:00)  #    
# Sunday, 12 November 2006

Data tips are really cool. It's fun to drill down into containers and complex objects and really see what's going on:

So imagine you're in the debugger. You've expanded all this stuff, and you really understand what's in mapVectString now. It has two entries, each is a vector of strings, and you're looking at entry #1 and it has three strings, and you have a good mental picture of the object. Nice. So when I'm debugging, my next step is to say to myself what the code is going to do, given what the object holds. I know most of us do that -- we solve the bug before control even reaches the bad line. But there's one problem... these delightful data tips are covering up the code!

Now, you could move your mouse off the tips, let them fade, read the code, and bring them back again, but that isn't exactly fun or efficient. So try this instead. Press Ctrl. Nothing else, just press Ctrl by itself.

See that? the data tips go almost (but not completely) transparent. Let go of Ctrl and they come back! I bet the first time you try this you will press and release Ctrl a bunch of times with a silly grin on your face. I know I did. Enjoy! BTW, it appears to be Visual-Studio-wide so feel free to apply this tip to your VB and C# programming also.

Kate

Sunday, 12 November 2006 11:56:08 (Eastern Standard Time, UTC-05:00)  #    
# Friday, 10 November 2006

One of the comments in the evals for my Barcelona talk was "extend it to a day!" Well that's just what Microsoft Denmark chose to do, giving me an entire day to talk about C++/CLI, moving to managed code, interop, combining MFC with WinForms, incredible IDE tricks that I promise you never knew, and the importance of concurrent programming going forward, along with some guidance about how to get there.

I had such a great time I forgot to be tired.... for a while.

I found that Danish has one thing in common with Spanish: I can kind of read it if I try. (Example: Danish for "fire" is "brand".) And I saw a LOT of bicycles. This is a country that gets just as cold as Canada, but people don't insist on driving everywhere. I spoke at a movie theatre and took this picture just outside:

That's right, a separate indoor parking lot for bikes. And it's full, so they're all over the sidewalk. Apparently all the visitors take pictures of the bikes.

I really enjoyed the talk. If anyone is reading this who thinks their local DPE group would welcome a C++ day, please drop me a line. Having a full day to do all the demos I don't normally have time was a marvelous experience.

Kate

Friday, 10 November 2006 13:17:41 (Eastern Standard Time, UTC-05:00)  #    
# Thursday, 09 November 2006

I had such a good time this week at Tech Ed Developers! I really enjoyed delivering my talk to a PACKED room (148 evaluations and apparently 155 chairs, how's that for interest in C++) as well as participating in the DotNetRocks panel on agility. This is my room, during my tech check (love that yellow highlight):

A week for me of old friends and new faces, and general good moods all around. And from what I read in the blogs, a week of real interest in C++ and especially C++/CLI.  Steve has a roundup over on the VC++ team blog. Bruno van Dooren, a C++ MVP, blogged all the talks and even though he said some overly flattering things about me I will still give you a link to his blog. Don't worry, my head still fits through normal-sized doors.

Here I am with Arfa, the eleven year old (look at the poise! And she's incredibly well spoken in English, her SECOND language) who has two Microsoft Certifications already. She actually did a demo in the keynote and when I complimented her on how she did, she turned it around and complimented me on how I handled panel duties at the Girl Geek Dinner. (Stress-wise, I had the way easier gig.) Keep your eye on her, she's going places.

Kate

C++ | MVP | Speaking
Thursday, 09 November 2006 13:05:59 (Eastern Standard Time, UTC-05:00)  #    
# Sunday, 05 November 2006

How much story can you pack into six words? Apparently Hemingway wrote "For sale, baby shoes.  Never used." Aaaawww, so sad.  But for true pathos, how about the sad laments of cast-off programming languages? Who says "They’ll come crawling back. You’ll see!" or "I was it once! What happened?" Let me try my own for C++ right now:

Unmanaged APIs everywhere. It Just Works.

What do you think?

Kate

 

Sunday, 05 November 2006 06:27:53 (Eastern Standard Time, UTC-05:00)  #    
# Thursday, 02 November 2006

Lots of C++ content in this talk with Soma on Channel 9. I spoke to Charles about this interview and he told me he really didn't know where it was going to go when it started, and it didn't need any editing, which is unusual for a VP. Soma also blogged it.

Thursday, 02 November 2006 05:47:59 (Eastern Standard Time, UTC-05:00)  #    
# Friday, 13 October 2006

Not enough people know about the code definition window in Visual Studio 2005. I see them trying to understand code by getting editor tips on the classes and functions they see in use:

A reasonably clever trick is to use Ctrl+Shift+Space to get parameter tips for the function:

But the tips are transient, they go away when you use your mouse and try to do some work. So most people fall back on good old Go To Definition:

Sure, this isn't transient, but it leaves you sitting in another file and needing to flip back and forth from file to file when you're just trying to understand what a particular function call does. What I like to use in this case is the code definition window. It's on the view menu:

And here's what it gives you:

It also works to show you the code for a function you're calling. Once it's open, just click on the thing you want to see in the code definition window:

Once you get in the habit of just glancing down to the bottom of the screen to get a little more information, you'll wonder how you ever did without it.

Kate

Friday, 13 October 2006 05:15:57 (Eastern Daylight Time, UTC-04:00)  #    
# Tuesday, 03 October 2006


Under Vista, an application can have a manifest that identifies the privilege level it needs to run. These manifests can serve other purposes, too: they're also known as fusion manifests and can be used to identify dependencies among other things. Adding one to your application starts with adding a file to your project (right click and choose Add, New Item: depending on the language you're using you might be able to choose XML file or else Text file will do.) Then you put appropriate XML in it, like this:

<?xmlversion="1.0" encoding="utf-8" ?>
<
assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<
assemblyIdentity version="1.0.0.0"
processorArchitecture
="X86"
name
="Sample"
type
="win32" />
<
description>Sample Manifest Test Application</description>
<
trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<
security>
  <requestedPrivileges>
 <!--
<requestedExecutionLevel level="requireAdministrator" /> -->
 
<requestedExecutionLevel level="asInvoker" />
 <!--
<requestedExecutionLevel level="highestAvailable" /> -->
 </requestedPrivileges>
 </security>
 </trustInfo>
</
assembly>

You save the file as ApplicationName.exe.manifest. (When I intend to embed the manifest, I tend to call it app.manifest instead. If you plan to embed it, the filename doesn't really matter, but then if you change your mind and want an external manifest you'll need to remember to rename the file.)

At this point, you can follow the instructions in Catherine Heller's blog. The thing is, when I first read them I thought she skipped a step or something in explaining how to do it with Visual C++ 2005. After all, the other approaches had tons of steps!  There are .rc files, and .res files, and custom build steps, and unloading projects so you can open them differently, and never-mind-the-error-message notes, and all of that. And then for C++ it's just "open the project properties dialog, on the left-hand pane expand the Configuration Properties->Manifest Tool node and select Input and Output. You can enter the name of an external manifest file in the Additional Manifest Files field." But you know what? That's it! You make the manifest, put its name in the dialog, build the project.

Presto, your app has a manifest. Depending on the value you enter for requestedExecutionLevel and the account under which you run the app, you will see different behaviours at runtime.

Kate

Tuesday, 03 October 2006 07:35:51 (Eastern Daylight Time, UTC-04:00)  #    
# Sunday, 01 October 2006

A client of mine, International Time Recorder, is hiring in Etobicoke. Here's the job description:

Job Title:  Senior Application Developer

Senior developer responsible for contributing to the design, development and implementation of commercial software solutions to a diverse marketplace.

Duties
• Contribute to the analysis and design, while being accountable for the support, development, testing and implementation of solutions and enhancements to software systems.
• Design and develop software components and features.  This includes working with stakeholders in developing Detailed Functional Specifications, designing certain key components of the product and implementing the solutions.
• Support and design of maintenance and test procedures and test cases for the product.
• Participate in schedule development and ensure timely product delivery.
• Assist in the creation and implementation of concrete procedures for tracking and releasing product updates.
• Coach and mentor junior development team members in best practices for support, development, testing and implementation of software solutions conducting code reviews as needed.

Qualifications
Education:  University Degree in Computer Science, or equivalent experience
Experience:  8 – 10 Years

Required Skills:
• Familiarity with the following technologies: C#, ASP.NET, C++,  ADO.NET, ADO, Web Services (SOAP/XML), RPC, all Windows Operating Systems, IIS, COM, Active Reports
• Two years experience in .NET development in commercial software development using C#, ASP.NET, ADO.NET
• Eight years experience in commercial Windows Application Development
• Experience in Scaleable Distributed Application design
• Three years experience in designing SQL Server databases
• Proven experience in developing database-driven Web and Windows applications with demonstrated flair for design and layout
• Two years experience as a project lead

Nice-to-Have Skills:
• Time and attendance industry experience
• Experience with Microsoft Visual Studio Team Systems.
 

The firm is doing active development in both C++ and C#. If you're looking for a place to use both old and new skills (and a chance to get regular mentoring from me :-) ), drop me a line and I will forward your information along.

Kate

Sunday, 01 October 2006 13:28:10 (Eastern Daylight Time, UTC-04:00)  #    
# Saturday, 30 September 2006

Woo hoo! STL/CLR is back! It made an accidental brief appearance in a Whidbey beta, but wasn't ready for prime time at all and went off for some retooling. If you grab the September CTP of Orcas, you can give it a whirl yourself. Here are some links stolen from Nikola's blog announcing it:

http://www.microsoft.com/downloads/details.aspx?FamilyID=82243606-d16d-445c-8949-9ee8c10cda2e%26DisplayLang=en to download the CTP.

http://connect.microsoft.com/VisualStudio/ to report bugs or issues with the CTP including STL/CLR.

http://blogs.msdn.com/vcblog/archive/2006/09/30/777835.aspx  Known issues and some workarounds.

So many paying projects to finish... but I will get working with this soon. Time to adjust my November talks to stop using the old unofficial version and start using the CTP version.

Kate

 

 

Saturday, 30 September 2006 15:22:26 (Eastern Daylight Time, UTC-04:00)  #    
# Wednesday, 27 September 2006

I've been dying to announce this one. I'm leaving Tech Ed Developers one day early to go to Copenhagen and do a C++ day November 10th. There's an announcement in Danish on the msevents site now. Here's the agenda:

Agenda 

Kl. 9.00-10.15:                   Visual C++: Højere produktivitet med Visual Studio 2005

Visual Studio 2005 indeholder en lang række produktivitets-forbedringer for C++ udvikleren. I denne session ser Kate Gregory nærmere på de mange nye features og forbedringer Visual Studio 2005 tilbyder. Endeligt viser hun en række tips og tricks, som ingen C++ udvikler bør være foruden.

Kl. 10.15-10.45:             Pause

Kl. 10.45-12.45:             Sådan flytter man C++ applikationer til .NET

Se hvordan man flytter C++ projekter til .NET og CLR’en uden at skulle porte eller genskrive hele koden. Lær hvordan man nemt kan migrere eksisterende native C++ kode – inklusiv MFC applikationer – til at køre under .NET. Kate Gregory vil også gennemgå strategier til at vælge hvilke dele af applikationen, der skal forblive i native kode og hvilke der skal flyttes til managed kode (.NET). Og endelig viser Kate hvordan du kan bruge .NET’s klassebibliotek og du kan bygge managed ”Wrappers”, som muliggør genbrug af eksisterende C++ klassebiblioteker.

Kl. 12.45-13.30:             Frokost

Kl. 13.30- 14.30:            Fremtiden er nu

Så længe, der har været software, har der været pc’er med stadigt stigende clockfrekvenser. Nu lader det til at den tendens er stoppet – i dag bliver maskinerne hurtigere ikke fordi clockfrekvens stiger, men forbi de får stadigt flere CPU’er. Det betyder at selv enkeltbruger-applikationer bliver nødt til at være multi threaded. Det skræmmende ved dét, er at de fleste udviklere ikke kan skrive thread safe kode. Kom og se, hvad det kan få af betydning for fremtidens software udvikling!

Kl. 14.30-15.00:             Q&A

Kl. 15.00:                      Tak for i dag

I will be speaking entirely in English. (I'm not sure what "Sprog: Dansk" means but I hope it doesn't mean Language: Danish.) So far I have learned the word "Tak" and hope to use it extensively. I believe "Tak for i dag" means "thanks for the day" and that is going to be my motto this fall. Should you happen to live in Denmark, or near enough to it that you could attend this, and yet not know enough Danish to muddle through this agenda, I will tell you the titles of the sessions as I submitted them:

  • IDE Features for Visual Studio 2005
  • Moving C++ Applications to the Common Language Runtime
  • The Future is Concurrent

See you there, I hope!

Kate

Wednesday, 27 September 2006 14:19:15 (Eastern Daylight Time, UTC-04:00)  #    
# Tuesday, 26 September 2006

You can search sessions and see the schedule now, at http://www.mseventseurope.com/Teched/06/Pre/static/Developers/SessionSearch.aspx. Here's how my talk looks there:

Some names I know in the speaker list:

  • Anders Hejlsberg
  • Ayman Shoukry
  • Brian Randell
  • Carl Franklin
  • Catherine Heller
  • Christian Weyer
  • Clemens Vasters
  • Ingo Rammer
  • Jackie Goldstein
  • Jan Tielens
  • Jay Schmelzer
  • Jeff Prosise
  • Kimberly Tripp
  • Mike Fitzmaurice
  • Patrick Tisseghem
  • Richard Campbell
  • Scott Hanselman
  • Stephen Forte
  • Steve Teixeira
  • Steve Lasker

RDs, blogs I read, MS people... it's going to be a great time!

Kate

C++ | RD | Speaking | Travel
Tuesday, 26 September 2006 13:52:10 (Eastern Daylight Time, UTC-04:00)  #    
# Monday, 25 September 2006

Shankar Vaidyanathan, who's been on the VC++ team for over 12 years, talked to Channel 9 in late July about why C++ devs actually do use and care about the IDE. He also shares some of the challenges for writing an IDE for very demanding customers. Watch this one immediately after the Boris one and you'll be an IDE guru!

Kate

Monday, 25 September 2006 16:13:53 (Eastern Daylight Time, UTC-04:00)  #    
# Sunday, 24 September 2006

I don't know why I didn't see this earlier, but then again I had a tough summer. Here is Boris talking about the C++ IDE and a lot of the tips that were in my Tech Ed IDE talk ... the one with no slides. If you weren't at my talk then I guarantee you will learn something about VC++ from this video, and even if you were, you still might.

Update: I really should have included this link to Boris' blog. Maybe he will update it more often if he gets more traffic.

Kate

Sunday, 24 September 2006 15:40:29 (Eastern Daylight Time, UTC-04:00)  #    
# Thursday, 21 September 2006

How many Visual Studio Developers know about autoexp.dat? My guess is not many. This file, located in C:\Program Files\Microsoft Visual Studio 8\Common7\Packages\Debugger for a typical install, controls how the debugger shows values in the Data Tips, locals window, auto window, etc. The file is yours, it's on your own computer, and you're free to edit it. Here's how to do so for a really simple (and redundant) type, Point:

class Point
{
private:
 int x, y;
public:
 Point (int xx, int yy)
 {x=xx; y=yy;}
 int getx()
 {return x;}
 int gety()
 {return y;}
};

I ran a really simple app that constructed a point, and paused in the debugger for a data tip:

Then I edited autoexp.dat, adding this line:

Point =(<x>,<y>)

I saved it and ran the debugger again, and now the tip looks like this:

You can do this for any class you write. It's your program, you might as well make your debugging life easier.

Oh, if you're wondering why my data tips are actually readable instead of in some tiny 3 point font, I blogged that earlier this summer.

Thursday, 21 September 2006 13:29:07 (Eastern Daylight Time, UTC-04:00)  #    
# Tuesday, 19 September 2006

Some people don't like the different kinds of punctuation in C++. I do. I like having :: and . and -> instead of always dots. And in C++/CLI I really like having ^ instead of overloading * to mean either pointer-to-native-heap or pointer-to-managed-heap. But you know what some people say about C++, don't you? That it looks like comic book characters swearing? Well here's what I say to that:

^%::&++!

Kate

Tuesday, 19 September 2006 12:27:49 (Eastern Daylight Time, UTC-04:00)  #    
# Monday, 18 September 2006

Julie blogged this  a while back, and mentioned to me recently that the firm needs someone again. If you know C++ and MFC, know what the .NET Framework can do, and can write English sentences as well as code, then you can live in a lovely place and do some cool work. Check into it (follow the link from Julie's blog) and mention me as well as her when you apply.

Kate

Monday, 18 September 2006 07:05:53 (Eastern Daylight Time, UTC-04:00)  #    
# Thursday, 14 September 2006

Larry blogs that improving your app's performance means concurrent programming. Not just OpenMP, which is very cool, as he points out elsewhere, but all the hard stuff: "disk contention, memory locks, cache corruption, etc". Still, here's a tempting paragraph from that DevX article:

It's perhaps surprising that C++, with its reputation for difficulty, actually provides one of the easiest ways to exploit multi-core and multiprocessor systems. OpenMP, a multiplatform API for C++ and Fortran, uses compiler instructions to automatically generate all of the support code needed to parallelize code sections. In the simplest case, which is what we're going to focus on for this article, simply wrapping a processor-intensive loop in a #pragma block can lead to about a 70 percent performance increase on a dual-core or dual-processor system and enjoy a similar "free lunch" on the quad-core systems that you build in the future.

That's right. Concurrency is vital, and C++ takes care of one kind of concurrency astonishingly easily. It's true. Later in the article he plops a #pragma just before each of two loops, and his app runs 70% faster. How's that for fun? Go on, read the article, try it yourself.

Kate

Thursday, 14 September 2006 15:26:23 (Eastern Daylight Time, UTC-04:00)  #    
# Wednesday, 13 September 2006

Tomas Restrepo, a C++ MVP, has started a C++/CLI FAQ at http://www.winterdom.com/cppclifaq/. It's a start, and since some questions are starting to be frequently asked, it's a good idea for folks to read through this.

BTW, if you're looking for a more general Visual C++ FAQ, try the multi-MVP effort at http://vcfaq.mvps.org/.

Both recommended. Good work Tomas!

Wednesday, 13 September 2006 15:06:07 (Eastern Daylight Time, UTC-04:00)  #    
# Tuesday, 12 September 2006

According to a summer IT Business article, there is still a battle or maybe there isn't. The headline reads "Java vs .Net: The tug of war continues" while the first sentence of the article is "The religious war between Java and .Net seems to be over." You might be able to guess how I feel from these quotes: 

  • "It's .Net all the way," she said. "I hardly ever get e-mails (from students) asking [whether] they should learn C# or Java any more."
  • "I feel more productive on the .Net side," said Gregory, who also programs in Java. "When I made the jump, it was about the tools in Visual Studio, and the libraries."
  • "I think that every time we have a new batch of libraries and every time the products are improved, people will change (platforms)," said Gregory. "Others say they will stay. And they're both right. Maybe younger developers get caught up in a religious war, but older developers say, 'You go ahead and use whatever you like. I'll be over here getting some work done.'"

That's why I'm a VB.NET and C++ developer after all -- to get some work done.

Kate

Tuesday, 12 September 2006 14:47:25 (Eastern Daylight Time, UTC-04:00)  #    
# Monday, 11 September 2006

Scott Meyers has been musing about the most important C++ books, non-book publications, software, and now people. He decides on:

  • Bjarne Stroustrup
  • Andrew Koenig
  • Scott Meyers
  • Herb Sutter
  • Andrei Alexandrescu

You know what? I agree with him. I think it takes some serious nerve to put yourself on a list like that, but his rationale works for me. I'm not sure if the list is in significance order -- if it is, I'd move Herb up a notch or two -- but these are the folks. And four of them were on the speakers list for C++ connections last year. I was honoured, truly, to be on that list with them and need no more than that.

Kate

Monday, 11 September 2006 13:03:13 (Eastern Daylight Time, UTC-04:00)  #    
# Sunday, 10 September 2006

After a three-year gap, I return to Tech Ed Europe as it returns to Barcelona. Moving it to the late fall has made it much easier to fit into my life. (Not surprisingly, I'll be speaking in the Developers half of the two-week conference.)

My talk is DEV406, Extending Native Code C++ Applications with Managed Code

Managed code programming models and frameworks offer developers a great boost in productivity and code maintainability. This session demonstrates the use of the C++/Common Language Infrastructure (CLI) language binding to access .NET platform features. Rather than re-write applications from scratch to take advantage of managed code, Visual C++ gives developers the ability to enjoy the advantages of managed code whilst still leveraging their existing native code base.

This is the power of C++/CLI - don't port or rewrite, integrate! You're going to love it.

Kate

Sunday, 10 September 2006 12:54:01 (Eastern Daylight Time, UTC-04:00)  #    
# Saturday, 09 September 2006

I'm thrilled to confirm that I will be speaking at Tech Ed in Sun City again this year!

I'm travelling on South African Airways this time (it's been Lufthansa before) and taking a different route, so there will be some novelty along with the familiarity. I just love the energy at this conference; I can't wait to get there!

My talks:

  • DEV 307: Delving into Visual Studio 2005 Team Edition for Software Developers
  • CLI 315: Windows Vista: Tips and Tricks for Targeting Key Native APIs from Managed Code
  • CLI 402: Modifying Applications to Run on Windows Vista

Kate

Saturday, 09 September 2006 12:46:05 (Eastern Daylight Time, UTC-04:00)  #    
# Saturday, 08 July 2006

Conditional breakpoints are cool when you know the value of one variable that is associated with trouble: this only blows up when Xid is 1234. They can also be used to reduce the boredom of single stepping. Say you've got some loop that goes around a few hundred times building up some string or array or something. You don't want to keep going round and round and round... it would be nice to jump ahead to halfway through, for example, and see how things are looking. Now if this is a for loop with a handy named variable, say

for (int i = 0; i<1000; i++)

Then you can use a conditional breakpoint and say "stop when i is 200". Or you could be clever and stop when i % 200 is 0 -- so that's every 200 times. But what if there's no i? What if you're going through a file or a recordset/dataset/resultset and you're going until the end? You don't want to add some fake variable that gets incremented each time through the loop, just so you can set a breakpoint that breaks on certain values of that variable. Instead you want to use the hit count property of the breakpoint. Just right click the red dot and choose Hit Count. There you can set the breakpoint to break whenever it's hit, just the 10th time it's hit, every tenth time (10, 20, 30 etc) or every time after the 10th time Or, of course, whatever number you want instead of 10:

Don't debug the slow way when there are tools to make you so much faster!

Kate

Saturday, 08 July 2006 16:53:13 (Eastern Daylight Time, UTC-04:00)  #    
# Friday, 07 July 2006

Conditional breakpoints were another really important tool in solving a recent "only happens at the big installations" bug in a big and complicated C++ application. We wanted to debug the code with as few rebuilds as possible and we really didn't know how parts of it worked at all. Tracepoints helped us to figure out a lot of it in a short time. We didn't have a decent repro case though, so here's what we did:

  • created a script to add an audit table and some triggers that write to it
  • created a script to remove those triggers and the table
  • created a batch file to run a server in verbose mode, and redirect the output to a text file (remembering DOS commands sure can be helpful...   myapp.exe -verbose >logfile.txt was the magic phrase.)
  • wrote some instructions for the support guy to grab a backup of the database, run the first script, run the batch file, let it run all night, then in the morning grab another backup of the database, run the second script, and stop the batch file.

Now we ran some queries on the morning version of the database to confirm that at least one X was missing a Y that should have been calculated overnight. We even had the Xid. Thanks to the tracepoint work of the previous day we knew where to be suspicious. A little digging in the trigger output told us whether the problem was "didn't get added" or "got added, but then got deleted". The last step was conditional breakpoints. These let us say "only stop here when you're processing the X with this Xid."

This really saves time when you just need to drill into what's happening in the case that is going wrong. You get to it by right clicking the red dot or diamond and choosing Condition.

Kate

Friday, 07 July 2006 16:35:26 (Eastern Daylight Time, UTC-04:00)  #    
# Thursday, 06 July 2006

The mentoring client I helped solve a big hairy bug using tracepoints does work in C# as well. She asked if tracepoints are available in C# and VB.NET too. They sure are!

As well, you can get to them other ways than just right clicking the red dot. There's a breakpoints window (reach it from the Debug menu: Debug, Windows, Breakpoints) that shows you what is set up for each of your breakpoints and tracepoints, and which you can use to enable, disable, delete, and edit breakpoints. You can also double-click a line in this window to go to that line of source:

I like to add that "Language" column when I'm working on a mixed project. Just click the Columns button and make your choices.

Kate

Thursday, 06 July 2006 16:14:51 (Eastern Daylight Time, UTC-04:00)  #    
# Wednesday, 05 July 2006

When you have a "mystery" bug to solve, tracepoints are a vital part of your debugging arsenal. Single stepping and looking through code can be S-L-O-O-O-O-W and if you don't even know what you're looking for, it can consume hours and hours of effort. Tracepoints really speed things up. They're like breakpoints that don't break. In a way, they go back to the old "printf debugging" -- but you don't need to make code changes and recompile to change them.

To set a tracepoint, first set a breakpoint, then right-click on the red dot that appears in the margin and choose When Hit:

In the dialog that appears, click the Print A Message box and edit the starter message you are given. You can include any expression in braces and it will be evaluated when control reaches the tracepoint:

Leave the Continue Execution box checked so that you don't break. Tracepoints are identified by red diamonds instead of red dots:

The output from the tracepoints appears in the output window of your debug session:

You can set up something suspicious, let it run, then pore through the tracepoint output and see what you learn. It's a huge timesaver when you're tackling a "we don't even know where to start" bug. Plus, if the issue is related to threading or async issues in any way (and you know me, I keep preaching we will all be facing async issues eventually) then you don't have to worry that pausing execution suppresses the collisions. I recently helped a client solve a big hairy this-stuff-fails-for-our-biggest-customer-only bug using tracepoints... and a few other tricks I will cover in upcoming posts.

Try it!

Wednesday, 05 July 2006 15:54:34 (Eastern Daylight Time, UTC-04:00)  #    
# Saturday, 01 July 2006

Nikola Dudar of the C++ team seems to have decided to catch up his blogging deficit. In a single day he covered:

Plus a meta-post about comments. Keep it up Nikola!

Kate

Saturday, 01 July 2006 20:33:46 (Eastern Daylight Time, UTC-04:00)  #    
# Friday, 30 June 2006

Those of you who were interested in my loader lock topic at Tech Ed this year should probably get this whitepaper from Windows Hardware Developer Central (not actually a place I hang out regularly.) It's a downloadable Word document (8 pages) that tackles things like "what you should not do from DllMain" (this list is a page long), deadlocks, and threading considerations (and remember, we are all going to have to tackle threading considerations eventually). While it doesn't say it's C++-specific advice, in what other language could you "Use the memory management function from the dynamic C Run-Time (CRT)" or "Set global pointers to NULL, putting off the initialization of dynamic members"? It even has Vista-specific advice.

Kate

Friday, 30 June 2006 07:14:35 (Eastern Daylight Time, UTC-04:00)  #    
# Saturday, 24 June 2006

The Visual C++ team all gathered together over the last week to hold a "slow chat" with the CodeGuru community. Users posted questions, the team answered them, and conversations ensued. Some of the interesting questions I spotted (it's all still there for you to read through at your leisure):

  • Why have the keyword abstract? Isn't the presence/absence of a pure virtual function enough? Or a private virtual destructor, that would force someone to implement a derived class?
  • What do I gain and lose by compiling my old native app with VC 2005?
  • Will MFC gain classes that wrap Vista-specific functionality?
  • What language does Microsoft use most?

Lots of straight talk from Brandon, Ayman, Tarek, Jon, Steve, and others from the Visual C++ team. Take your time and read it all.

Kate

 

Saturday, 24 June 2006 14:07:07 (Eastern Daylight Time, UTC-04:00)  #    
# Monday, 19 June 2006

This year at Tech Ed USA, the booths had slightly different badge scanning hardware than at past shows. Instead of removing your badge from the holder to be swiped, the boothies could just swipe a bar code on the front. This was used not just at booths, but also for session attendance. Here you see Canada's Technology Triangle guy himself, Dave Totzke, being swiped before my Friday talk:

I know at other TechEds they have used RFID in the badges, and then when you go to do evals you can choose from the sessions you actually attended: makes it easier for attendees and gets an accurate count of attendance. I don't know if session attendance and evals were linked here because I hardly attended any sessions at all. In fact, for those I did attend, I arrived with the speaker before the badge swipers so I never got swiped. I know looking at my own evals they told me how many evals were submitted but not how many people were in the room.

Knowing how many people actually attend sessions and comparing it to how many indicated they would in the scheduling tool helps to put talks into the right rooms... it's as awkward to talk to a cavernously empty room as to a busting-at-the-seams-full one. So I like this. But then, I liked the RFID chip, and I've been told it would never be accepted in North America.

BTW, little piece of language-specific trivia: apparently C++ talks get way more "didn't put it in the schedule" attendees than other languages. Is it because all languages get the same number of spontaneous dropins, and all the C++ folks who planned to attend follow through? Is it because C++ people don't like to use the scheduler? Who knows? I'm just happy that while the number of C++ talks may be less than in previous years, I'm still not in the smallest room.

Kate

Monday, 19 June 2006 21:40:41 (Eastern Daylight Time, UTC-04:00)  #    
# Sunday, 18 June 2006

Another entry from the VC++ team. This one covers many of the IDE changes I showed in my recent Tech Ed talk. One of the questions that arose in that talk was "why does Visual Studio sometimes appear to freeze when I open a dialog?" Boris Jabes has an answer that explains to me why it's more likely to happen when I'm working in native code.

Kate

Sunday, 18 June 2006 06:30:04 (Eastern Daylight Time, UTC-04:00)  #    
# Wednesday, 14 June 2006

Over on the Visual C++ team blog, Martyn Lovell muses about MSBuild, renaming all the library DLLs, and STL/CLR, among other things. On that topic, he says:

We’re not finished yet on performance, but in informal testing we’ve seen some exciting results, including a bunch of cases where the magic of templates combined with the C++ optimizer are able to outperform the .NET Base Class Library even in verifiable code. When we envisioned C++/CLI several years ago, these are the kinds of scenarios that we dreamed of, and it’s exciting to see them coming to fruition.

Can't wait!

Kate

Wednesday, 14 June 2006 16:38:50 (Eastern Daylight Time, UTC-04:00)  #    
# Tuesday, 13 June 2006

Here's a quick tip about tips. The default font for data tips, editor tips, and so on is really tiny (8 point):

Especially if you're presenting, you'll want to make it larger:

How's it done? The same Fonts and Colors dialog you use for your regular font setting, but use the dropdown at the top of the dialog:

You can also change Data Tips, the font in the output window and find results window, and plenty more. Experiment a bit!

Kate

Tuesday, 13 June 2006 14:13:10 (Eastern Daylight Time, UTC-04:00)  #    
# Monday, 12 June 2006

My first talk of this year's TechEd, DEV 309, is today. For those who haven't pulled the slides from CommNet, here's the secret: there really aren't any slides.

That's right, if you remove the "chrome" that TechEd requires, like the session title and my name, there's an agenda, 4 demos, a laundry list to remind you what was covered, and a summary. Basically it's an hour and a bit of showing what the IDE can do. I like doing this talk because I just KNOW everyone will learn something they didn't know before.

Kate

ps: attendees PLEASE do your evals, that's how they decide who comes back next year!

Monday, 12 June 2006 07:52:55 (Eastern Daylight Time, UTC-04:00)  #    
# Saturday, 10 June 2006

I have an HUGELY busy week planned at TechEd. It kicks off with meetings of MVPs and RDs (I have to miss the meeting of user group leaders, everyone had the same "day before TechEd starts" plan) and the keynote Sunday night. My talks are Monday (DEV309  Visual C++: IDE Features for Visual Studio 2005, 5:00 PM - 6:15 PM  Room 259 AB) and Friday (DEV444  Visual C++: Debugging and Resolving Loader Lock and Side-by-Side Issues, 1:00 PM - 2:15 PM  Room 160 ABC), and I won't miss the Women In Technology luncheon on Wednesday. In between I have so many meetings scheduled, it's a good thing the sessions will be on DVD afterwards because I just won't be able to attend all the ones I want to. And as for Boston tourism... well at least I'll see Fenway :-)

If you're going to be there, drop me a note and let's see if we can have some "face time" of our own.

Kate

C++ | Consulting Life | INETA | MVP | RD | Speaking | Travel
Saturday, 10 June 2006 19:43:18 (Eastern Daylight Time, UTC-04:00)  #    
# Tuesday, 06 June 2006

This time it's Boris Jabes, who we haven't heard from in ages, who reappears with a pair of handy macros, one to show all your keyboard shortcuts and one to preprocess a file you have open (written as a response to someone who wanted it added as a feature to the IDE.) He credits his blogging once more to the "you can blog from Word 2007" feature. If that's true, the feature is getting my vote as the best of this release :-)

Kate

Tuesday, 06 June 2006 18:43:28 (Eastern Daylight Time, UTC-04:00)  #    
# Saturday, 03 June 2006

Steve Teixeira has linked to the webcasts from a C++ day held in Paris in May. These were done in English, but if you want to download the WMVs you're going to need a tiny bit of French, or to have gone through the downloading-a-webcast-from-MSDN process often enough that you don't really need the prompts. I qualify on both counts, and since the French for video is video, it's not too terribly difficult. Well actually Herb's talk starts with a French introduction, but having heard myself introduced in French a time or two I can tell you it's OK if you can't follow that bit. (Most of the time you can't tell that Herb and I did our undergrad at the same place, but we did, and occasional sesquilingualism is a clue. The difference is that while Herb remains a little nervous about engineers, I became one.)

 

These are good talks with demos and they cover a lot of ground for C++ programming today and in the future. Go get them.

Kate

Saturday, 03 June 2006 06:53:59 (Eastern Daylight Time, UTC-04:00)  #    
# Thursday, 01 June 2006

This one is with Louis Lafreniere about the C++ backend compiler. What can I tell you, go there and watch it!

Thursday, 01 June 2006 12:06:13 (Eastern Daylight Time, UTC-04:00)  #    
# Tuesday, 30 May 2006

Microsoft has a team of people who concern themselves with non-professional programmers. This includes students, hobbyists, and anyone who isn't primarily paid to write code, but finds themselves writing it anyway, typically at home and on their own nickel. (Apparently they outnumber professional developers four to one.) John Montgomery, of that team, says that non-professional programmers use HTML and Javascript the most, followed by (believe it or not) C++. While I suppose the presence of CS students who are taking C++ courses must skew the numbers, I still find it surprising. There are a lot of languages that are easier to pick up and noodle with in your free time than C++. I think it shows that people will move towards a tool that does what they need.

Kate

Tuesday, 30 May 2006 10:50:18 (Eastern Daylight Time, UTC-04:00)  #    
# Monday, 29 May 2006

It's time again for an update to the TIOBE Programming Community Index. I blogged about this a while back, and it's time to notice it again. This index measures only how often a programming language is mentioned by name - in people's resumes, in job ads, in tutorials, even in explanations of other languages or comparisons between languages. It is an interesting measure of which languages people consider relevant in conversation or in describing themselves.

C++ has moved up from 4th overall to 3rd (still behind Java and C, pulling ahead of Perl) but if you look back over the last five years, it's clear less people are bringing C++ into their conversations than they once did:

What I find most confusing is the tiny numbers for C#. Oh sure, I know this is just a graph of the top ten, and things like Ruby aren't even here, but to be neck and neck with Delphi over all this time? That's kind of strange. There are obviously large swaths of the internet where I don't normally go, where people talk about Delphi a lot.

I wonder what's the uptick of Java talk over the last year? Could it be all the "Java is over" articles? :-) By the way the steep drop for C++ and Java in April 2004 is an artifact as a result of a Google cleanup-clearout, and since then the index includes more search engines.

Kate

Monday, 29 May 2006 10:33:51 (Eastern Daylight Time, UTC-04:00)  #    
# Saturday, 27 May 2006

I'm surely not the only one who's noticed that most of the blogs by members of the Visual C++ team have one thing in common: they're not updated terribly often. Typically there's one team member (maybe someone with insomnia?) updating one while the others languish. So now it seems they've decided to make a group go of it with the Visual C++ Team Blog. It appeared yesterday and has had two entries so far. I hope it gets lots of updates!

Kate

Saturday, 27 May 2006 18:14:19 (Eastern Daylight Time, UTC-04:00)  #    
# Sunday, 21 May 2006

As most of my readers know, there are three kinds of managed-to-native interop available to the C++/CLI programmer using Visual Studio 2005, as there were to the Managed C++ programmer using Visual Studio 2002 or 2003. Those are COM Interop, P/Invoke, and C++ Interop (formerly and more colourfully known as It Just Works Interop.) COM Interop is slow, but if you have a COM component already written, maybe in VB 5 or something, it's just the ticket. P/Invoke is good for C-style DLLs, and popular with people who want to call into the Windows API. C++ Interop is the easiest (say it with me: include the header, link to the lib) and fastest, and it's available only from C++.

So why would a C++ dev, who can just include-the-header-link-to-the-lib, ever use P/Invoke? Because it handles marshalling and translation for you. Take a look at this (reasonably old) post by Kenny Kerr. He includes this function in the post:

[DllImport("Native.dll", PreserveSig=false, CharSet=CharSet::Unicode)]
bool BrowseForComputers(IntPtr parentWindow,
                        bool multiSelect,
                        [MarshalAs(UnmanagedType::SafeArray, SafeArraySubType=VarEnum::VT_VARIANT)]
                        array<String^>^% computers);

That would be pretty grody work without P/Invoke. Let the feature help you where it can.

Kate

Sunday, 21 May 2006 07:22:49 (Eastern Daylight Time, UTC-04:00)  #    
# Friday, 19 May 2006

I have a number of talks I do about C++/CLI and Visual C++ 2005. The one thing they have in common is that there's never enough time for all the demos. There's one particular demo that is technically in two different talks, but never gets done... it shows how to put a WinForms control onto an MFC dialog, and how to implement MFC message passing (and the new DELEGATE family of macros, that are like the existing command routing macros) to hook a WinForms into an MFC View, complete with menu updating and implementation.

If you are one of the people in those audiences who was a little disappointed you didn't get to see the MFC stuff, here's a new paper that might help you out a bit: Integrate Windows Forms Into Your MFC Applications Through C++ Interop. It's by Marcus Heege, a new C++ MVP. I just have to like a guy who includes a subheading "C++ Interop Is Your Friend" :-)

Kate

Friday, 19 May 2006 08:25:33 (Eastern Daylight Time, UTC-04:00)  #    
# Saturday, 13 May 2006

In the June MSDN Magazine, Stan Lippman's Pure C++ column has become Netting C++. Here's the path he's laid out for himself. He's starting with a working console application written entirely in native C++. In this first column he's just going to make it run as a .NET executable with no use of .NET libraries and no exposing his classes to other .NET applications over the runtime. In the next column, he'll show how to wrap the native classes in managed wrappers so they can be called from VB or C#. Stan goes on to say:

Subsequent columns will focus on mapping the native types to types supported by the .NET Common Type System (CTS) and examining the performance characteristics of the application as it transitions. We'll also look at the type information available to the runtime, using the ildasm command to explore the Common Intermediate Language (CIL) into which all .NET-based languages are compiled.

When that's done, we'll explore multithreading, Web services, cross-language interoperability with a C# ASP.NET front, XML support, and integrating with Windows Vista™. So, we have our work cut out for us.

This will be a series to read as it appears.

Kate

Saturday, 13 May 2006 10:41:45 (Eastern Daylight Time, UTC-04:00)  #    
# Tuesday, 09 May 2006

The ISO C++ committee is working on the next standard for C++. At their April meeting, a number of items were added to the working draft, which means they will almost certainly end up in the standard -- it's just a matter of final agreement on some of the subtle details of the item, rather than whether it should be there or not. As Herb Sutter reports, the items that were added are:

  • TR1, a pile of library changes (as opposed to the language itself) including various new kinds of smart pointers
  • declaring variables but letting the compiler deduce their type instead of doing it yourself (auto type deduction).
  • delegating constructors
  • the > > vs >> subtlety that Brandon referred to in his recent Channel 9 interview. Visual C++ takes care of this already, but now it's being added to the standard.
  • extern template

Now why should an ordinary programmer care about the machinations of the standards committee, and something that may or may not get approved this decade? Well for one thing, the compiler vendors don't wait for the standard before they implement the new keyword or the new functionality. And for another, it can give you a hint about what's headed your way. Let me tell you what I mean.

Here are Herb's examples of auto type deduction:

auto x = 3.1415926535;
auto i = container.begin();

In this case, x has type double, and i has type map<string,unordered_map<int,tuple<float,string,const int> > >::const_iterator or whatever the right type happens to be, without having to spell it out.
Now in and of itself this is a cool feature, especially for C++ with heavy STL use. Another thing Brandon talked about in his Channel 9 spot was how foreach saves us from having to declare those iterators, set things to begin() and so on, and there's no doubt that figuring out the types is part of that pain. But go beyond that for a moment. I have seen plenty of auto-type deduction examples in C# over the last year or so, and they were all LINQ examples. Does this mean C++ will get getting LINQ too? At least one language barrier to LINQ will be going. Let's see what else happens.
 
Kate

Tuesday, 09 May 2006 07:21:11 (Eastern Daylight Time, UTC-04:00)  #    
# Monday, 08 May 2006

I'm guessing that when Channel 9 came by to talk to Martyn Lovell, they got Brandon to agree to be next. His interview has been posted and has some cool quotes in it:

  • "I only learned C++ about 4 years ago"
  • "Visual C++ is the only language that can get to every API Microsoft ships"
  • "C++ is the most widely used language in the world, and it's not going anywhere"

He discusses verifiable code, his favourite new language features, and templates-vs-generics as well. Take a look!

Kate

Monday, 08 May 2006 08:33:57 (Eastern Daylight Time, UTC-04:00)  #    
# Monday, 01 May 2006

Martyn Lovell, who heads the libraries team, has an interview on Channel 9 that was posted Friday. Normally when you think "libraries" in the context of C++ you think ATL and MFC. But most of what Martyn is talking about here is the C RunTime library -- strcopy, printf and so on. He gives a coherent explanation of what the safer CRT work is about. I've written about this before, and have been helping mentoring clients fix their warnings for over a year, and still I learned a few things from this video about how to explain this initiative. Martyn's devotion to the language and the community is inspiring.

And yes, Martyn is hiring again. You can use the description and instructions from my previous post if you'd like to work on MFC. Over 7000 new APIs in Vista means there's lots of MFC work to be done!

Kate

Monday, 01 May 2006 08:33:41 (Eastern Daylight Time, UTC-04:00)  #    
# Thursday, 23 March 2006

It looks like I never added an entry about speaking at Devteach. I just made my travel plans to get there. I love taking the train to Montreal -- I'll end up within walking distance of the conference hotel, save time compared to flying, and travel in comfort the whole way.

Devteach is a delightful conference with a friendly atmosphere. I count 8 RDs among the speakers list, plus a whole pile of MVPs, Julie, and some of my favourite Microsoft people... DEs mostly. There is one track in French and the rest of the talks (about a hundred) are all in English.

My talks are:

  • Moving C++ applications to the CLR
  • The Future is Concurrent

There's plenty for everyone: web, smart client, data, security, patterns and practices, testing, Team Systems, architecture -- if it's a development topic, someone is speaking on it. On top of that the conference hosts the Canadian User Group Leader Summit (and gives user group members a discount on attendance - contact your user group leader for a code) and the Canadian Regional Director Summit. It's a great place to meet the stars of the Canadian developer community, and a number of folks from the American northeast who love to come up to Montreal. See you there!

Kate

Thursday, 23 March 2006 07:25:00 (Eastern Standard Time, UTC-05:00)  #    
# Tuesday, 21 March 2006

Once again I am honoured to be speaking at Tech Ed USA. Details to follow -- it will be a C++ topic. See you all there!

Kate

Tuesday, 21 March 2006 06:55:38 (Eastern Standard Time, UTC-05:00)  #    
# Thursday, 09 March 2006

Anyone who thinks that C++ is a forgotten language at Microsoft that has been put into the corner and ignored needs a quick reality check. And if you've always wanted to work at Microsoft, or if you're looking for work where you can use C++ every day, how does this sound:

Want to build the next generation of C++ development tools? The Visual C++ team has multiple openings working on the libraries. You will have an opportunity to work with environments, components and tools that are used in complex projects like Windows Vista which has about 50 million lines of C++ code. If you are willing to take up the challenge of delivering high performance, scalable, and most usable set of features to the most sophisticated and demanding developers in our  community and have a passion for handling new technologies that is in Microsoft's horizon, then please send in your resume. We're looking for senior individual contributors ready to code, design and provide the next generation of code reuse leadership at Microsoft. Candidates are required to possess a bachelors or masters degree in computer science, and five years relevant experience.

If you are someone who's ready to design code that will be used and critiqued by the whole developer community; ready to have a direct connection to customers whose problems you understand then the Visual C++ Libraries team is the place for you. We are building new libraries that drive developer productivity and power on the native and managed  platforms. Next version we'll bring our MFC and ATL libraries up to date to work with the new Win32 APIs of the Vista Wave. And we'll help our customers work with WinFX and move forward their existing code. We own the full set of C++ Libraries -- C Runtime Library, Standard C++ Library, MFC and ATL. In future we'll also address challenges like parallel programming, and migration of existing native applications to managed code. If you have prior experience of large scale ISV development with MFC or ATL, we'd be especially keen to hear from you.

Just as was the case about seven months ago when I blogged a hiring opportunity, you need to email Martyn Lovell for this. I figure most folks who qualify for the job can find his email address, but here's a hint: you could always email me and ask for it :-)

Kate

Thursday, 09 March 2006 09:46:24 (Eastern Standard Time, UTC-05:00)  #    
# Wednesday, 01 March 2006

You really want to download and read http://www.gotw.ca/publications/C++CLIRationale.pdf. It's 54 pages (just under 2 MB) of WHY the C++/CLI product is the way it is. Why isn't it a library? (Because the compiler really needs to be in on what you're doing to hook in the runtime support properly.) Why doesn't it use underscores? (Because programmers hated them.) You don't have to be a compiler-writer to follow the rationales laid out here. It provides some interesting insight into the way the standards process works and the way that decisions get made by a team or by one person who is strongly committed to "doing it right this time." However this is no dry committee report or academic paper: you will find the word "I" throughout the paper, along with anecdotes about conversations, code written out quickly to help guide a decision, and other vignettes that make this must reading for all we C++ people.

Some quotes (words outside "" or in [] are mine, not Herb's):

  • "Many C++ programmers tried hard to use [Managed Extensions], and most failed."
  • Mapping destructors to dispose bidirectionally (probably my favourite C++/CLI feature) was "nontrivial, and required C++/CLI to influence CLI to modify and regularize its pattern)."
  • "There comes a point where you have to admit that you’re trying too hard." (On having a class that inherits from System::Object magically be a ref class without having to use the keyword, an idea that wouldn't have been good anyway since it would have ruled out mixed types.) 
  • "Having private as a default matters so much that Stroustrup correctly felt it was worth the high cost of taking a new keyword just to have a category of user-defined types where the default was private." (In a section drawing parallels between some C++/CLI decisions and the decades-old decision to add class to a language that already had struct.)
  • "...in the C++/CLI design effort, some people tried hard to leave open the possibility of allocating C++ objects physically on the CLI heap; that is impossible in general, and trying to persist in this led to confusions in the type system that have now been avoided and removed." (Ouch!)
  • "As for whether this set of extensions amounts to a different superset language, a compatible dialect, and/or a binding: I think you can find reasonable people who view it any of those ways. Whichever noun you prefer, it is the most compatible set of extensions I know of to any programming language, standard or otherwise, including for nearly all macro cases — which are notoriously next to impossible to support in a compatible way. Achieving that required putting requirements in C++/CLI that placed a greater burden on compiler writers in favor of preserving strong ISO C++ compatibility and avoiding conflict with C++0x evolution, and improving programmer usability so that programmers would use the feature instead of switch to another language (unlike with the Managed Extensions). These choices reflect the designers’ great respect for ISO C++."

The paper closes with an FAQ that includes questions I can only describe as rude. I am guessing that Herb has been patiently answering these in email and at meetings for many years now.

If you still aren't really clear on WHAT the C++/CLI version of C++ is, what happened to the underscores, or how C++ can be the best .NET language of all (offering features C# and VB just cannot offer) then this paper might not be the place to start, since it's not a syntax review or a tutorial. But then again, maybe understanding the WHY will motivate you to go and learn the WHAT.  And if you want more WHY, the paper is liberally sprinkled with links to blog entries by Herb and Brandon (mostly in 2003) with even more details.

Go! Read it, now!

Kate

Wednesday, 01 March 2006 09:35:12 (Eastern Standard Time, UTC-05:00)  #    
# Wednesday, 15 February 2006

There's good news and bad news on the "C++ product team blog" front. The good news is that Nikola Dudar has a new entry after about three months of silence. The bad news is that it's to announce that STL/CLR will have to wait a little longer. It slipped out with beta 2 but it's not in the release version, and was planned as a web download. But the team is heads-down on a number of fronts and this is one of the items that has had to be postponed. The big focus is MQ, an internal milestone that all the languages and tools are working on.

Patience is a virtue,
Kate

Wednesday, 15 February 2006 09:08:17 (Eastern Standard Time, UTC-05:00)  #    
# Monday, 16 January 2006

Code Camp was a blast! Some pictures are starting to show up on the web site. I had a jam-packed room, I think word must have got out there was no C++ in my talk :-). But I had some time at the end so I am going to adapt this talk a bit for DevTeach and put some C++ into it :-)

Chris and Jean-Luc did a fantastic job getting volunteers and running the event - and they both spoke, too! It was also fun to reconnect with Val Matison who first got me up in front of an audience doing a technical presentation... more years ago than I care to figure out right now. I couldn't stay all day but the energy was great, the logistics were working well and I think everyone involved deserves a big round of applause!

Kate

Monday, 16 January 2006 09:20:40 (Eastern Standard Time, UTC-05:00)  #    
# Wednesday, 04 January 2006

As we flip calendar years I am delighted (even if I'm not really surprised) to learn that I am being renewed as both a Regional Director and an MVP (for C++.) These two programs are both a big part of my professional life. (The RD program is more exclusive, with only 120-140 RDs around the world compared to thousands of MVPs, but the two programs serve different needs, of course.) They each provide me with amazing information and access to the product teams. They open doors for me throughout the Microsoft-oriented world. Most of all, they introduce me to other RDs and MVPs around the world... an amazing team to feel part of. I am also still a user group leader, a member of the INETA North America and MSDN Canada speaker bureaus, and of course I have a business to run with clients throughout North America.

In not-unrelated news, I qualified for Elite on Air Canada and almost halfway to Super Elite. The previous year I just squeaked to Elite... wonder how much flying 2006 holds for me?

Kate

     
C++ | Consulting Life | INETA | MVP | RD | Speaking | Travel
Wednesday, 04 January 2006 16:33:27 (Eastern Standard Time, UTC-05:00)  #    
# Sunday, 18 December 2005

Chris has uploaded the deck and a zip file of code for my "Moving C++ Applications to the .NET Framework" talk to the East of Toronto .NET User Group. If you're still thinking about C++/CLI maybe seeing what it does will help your thought processes.

http://gtaeast.torontoug.net/Downloads/1307.aspx

Kate

Sunday, 18 December 2005 07:39:42 (Eastern Standard Time, UTC-05:00)  #    
# Saturday, 17 December 2005

December for me has been, well, challenging. And though it seems that everyone around me is shutting down for the year, I still have miles to go before I sleep. So I was pleased to notice that the standards process is marching on: ECMA reports that the 90th General Assembly held in Nice, December 9, 2005, approved Standard ECMA-372 (C++/CLI Language Specification).

Back to way too much of everything,
Kate

Saturday, 17 December 2005 11:09:22 (Eastern Standard Time, UTC-05:00)  #    
# Thursday, 01 December 2005

Vertigo is a seriously cool company that does a lot of .NET work and a lot of C++ work. Like us, they know how to combine the two. Unlike us, they are in California. Here's what CEO Scott Stanfield (a super hard working RD) told me about the job:

We’re trying to hire a full-time C++ developer to help us work on [pretty high-profile work for Microsoft.] Needs knowledge of Windows API (old-school stuff), COM, etc. Maybe ATL.

Intruigued, I got more details:

Must have:

  1. 2 to 4 years of Unmanaged C++/Windows Apps
  2. C++ Standard Library (Iterators, containers, etc.)
  3. ATL
  4. VS 2003
  5. Using COM with #import

 Knowledge that is nice to have but not necessary:

  1. Passport
  2. Windows 2003/XP or VISTA experience (ie. building apps for Microsoft)
  3. WTL
  4. Client side (single thread, event driven, custom drawing, experience with 32-bit, globalization)
  5. Server side (multi-threaded, critical sections, mutex – 1 app instance)
  6. Networking (WinHTTP, web services)
  7. VS 2005

P.S.  Bear in mind that our core expertise is .NET so the person would have to be willing to learn .NET and work on other projects besides C++ stuff every so often.

And of course, it is a great company to work for :).  We do a great job with developing careers and it is rock solid financially with excellent benefits.  Plus there is very minimal travel.

If you follow the links in the first paragraph, you'll figure out how to apply :)

Kate

Thursday, 01 December 2005 13:34:40 (Eastern Standard Time, UTC-05:00)  #    
# Monday, 14 November 2005

I've been talking about C++/CLI in public for quite a while now: Tech Ed USA 2004 and 2005, Tech Ed Africa 2004 and 2005, C++ Connections in Las Vegas last week, several private webcasts, and of course in this blog. But in the last 18 months, travelling as far as 10,000 miles from home, I haven't done any part of this shapeshifting talk here in my own home. So it's time to change that. Come to the November meeting of the East of Toronto .NET Users Group and find out why people are saying:

  • "I love the .NET Framework, I love C++, and the new stuff looks to provide me a beautiful integration of the two. Question is, once it is released, will I ever code in C# again?"  -  Ed Ball
  • "this new development in C++ seriously undermines the justification for C# as a language. " - Grumpy Old Programmer
  • "By standardizing the syntax and semantics of a general purpose binding for C++ and the CLI, Ecma TG5 will provide the huge C++ developer community with a tool that enables them to easily write applications that make full use of the CLI platform, and will provide the developer community targeting the CLI with full support for the powerful C++ language. " - ECMA Standards Committee
  • "Visual C++ is positioning itself as the lowest level programming language for targeting the CLR. There should be no cause to use any other language, not even Microsoft intermediate language (MSIL). Secondly, .NET programming should be as natural as native C++ programming. ...If you love C++ and want to use all the power that C++ has traditionally offered, but also want the productivity of C#, then this is for you. - Kenny Kerr, MSDN article
  • "C++ is here to stay for a long time and we are committed to providing the best tools for C++ development." - Soma Somasegar
  • "now that the language looks just like C# and you still have the power of C++/templates/STL as well, it's staging a major comeback." - Sam Gentile

I dug out some abstract that was kicking around from one of the versions of the talk:

Come and see how real C++ projects are moving to the CLR without a full port or rewrite. Learn how to easily migrate existing native code -- including MFC applications -- to run under the CLR. Strategies for choosing which parts of the application remain native and which are managed will be discussed. See how to take advantage of the power of the framework libraries. Finally, this session will provide guidance on how to build high-performance managed "wrappers" enabling reuse of native libraries.

But that was a one hour talk, and I have such a hard time fitting into a single hour, and this is my user group after all, so expect to see quite a bit more on the general "C++ for the .NET Framework" situation.

Wednesday November 30th, Whitby Library, please register. Pizza and chitchat at 6, C++/CLI starting at 7. See you there!

[updated: the link above now leads to a page that has a registration link. Please register.]

Kate

Monday, 14 November 2005 13:51:26 (Eastern Standard Time, UTC-05:00)  #    
# Friday, 11 November 2005

... must be firmly in the hands of Steve Teixeira, who has been blogging regularly from C++ Connections. Quite a decent subset of the team is here, and I am really enjoying meeting those I haven't met before and seeing the others again. (An aside: how many people do you think are on the C++ team? Yesterday Brandon, when I kiddingly asked who was left in Redmond since a dozen or so had come to Vegas, said there are 130 people on the C++ team. Tonight Herb said there are about 150 but 20 or 30 are on Phoenix which you might say wouldn't count. Over a hundred is a lot more than other language teams have and a good indication of both the importance and difficulty of keeping Visual C++ at the top of its game.)

Today Martyn Lovell gave a great presentation on the IDE that I enjoyed immensely (even though I knew all the features he was showing) because he has a wicked sense of humour. When he got spontaneous applause for docking indicators on tool windows (who knew?) he commented that he should have shown them first to get the audience warmed up :-)

I really hope the success of C++ Connections means there will be other C++-only conferences once again. In fact tonight I believe I heard Kevlin Henney say to Bjarne "we're doing this again next year, right?" and Bjarne say "yes". If so, I plan to be there too! This has been a terrific week and when I'm in my own time zone again I will have more to write about it.

Kate

Friday, 11 November 2005 01:45:41 (Eastern Standard Time, UTC-05:00)  #    
# Wednesday, 09 November 2005

Once again I find a friend has written almost the blog entry I would have, sparing me the effort. You just have to read Don Kiely's summary of Bjarne's C++ Connections keynote this morning. I am going to sleep on my thoughts from the keynote, this afternoon's talk, and tonight's panel, and see what I synthesize from them tomorrow.

Kate

Wednesday, 09 November 2005 00:08:10 (Eastern Standard Time, UTC-05:00)  #    
# Tuesday, 08 November 2005

Today at C++ Connections I have attended two Bjarne Stroustrup talks. And yes, I learned something from both talks and took plenty of notes. Bjarne used what he called Ye Olde Shape Example in a discussion of the brittle base class problem. He mentioned that this is an ancient and yet still useful example that he got from the Simula folks way back when. After the talk I asked if he knew when it dated to, since I use it as an example of polymorphism in the OO/UML course I teach at Trent. He thinks it's about 1971. I was disappointed that it wasn't older than me, and he offered "well, there's always the cars and vehicles, stop, go, turn kind of thing. That's from about 1967 or so." I burst out laughing since I use that example too! It doesn't quite make the "older than me" bar, but it's certainly got a history.

Kate

Tuesday, 08 November 2005 21:25:01 (Eastern Standard Time, UTC-05:00)  #    
# Monday, 07 November 2005

I love being "in the loop" on new software. It can get kind of surreal, though, when you are at a conference and find a technology kind of boring and everyday, and skip the sessions on it since it's "old stuff" ... and then realize it isn't even shipping yet! I spend time in betas, alphas, SDRs and the like, so it's often years between the time I start working with a technology and the time it releases. When I speak at Tech Ed I tend to hang at the cabanas where I can hear real stories of how people are using the tools and the problems they need help with.

The PDC though, that's a different story. Well, it should be anyway. The PDC is all about the future, right? The workflow announcement was a big deal, but the material wasn't new to me. I began to worry if I would ever attend a session that sparked my interest in something new and important. Then I found it. I've waited to blog it until the sessions were available online.

What Jan Gray had to say in FUN302 and Herb Sutter introduced in TLN309 totally grabbed me. Because clock speed cannot go up any more we all have to write concurrent code even if it's single user:

And since most people can't write good concurrent code (see Herb's Singleton example which still doesn't work even with the double checking and the volatile keyword, at least not all the time) then the OS or the framework or the language needs to do it for them. Herb and Jan are proposing different approaches, but these two guys are among the smartest I know (I've known Jan almost 30 years) and if they are both into this, then I need to learn more about it. You probably do too.

Kate

Monday, 07 November 2005 10:19:27 (Eastern Standard Time, UTC-05:00)  #    
# Wednesday, 12 October 2005

I just registered for the global launch in San Francisco November 7th:

(Yes, I will be in Las Vegas that whole week to speak at C++ Connections. I'm just going to the launch on Monday and then to Vegas.)

If a flight to SF is out of the question, why not see if you can get into one of the Canadian dates?

November 8 Toronto
November 10 Ottawa
November 15 Edmonton
November 17 Victoria
November 22 Vancouver
November 24 Calgary
November 29 Montreal
December 1 Quebec
December 6 Halifax
December 8 Winnipeg

http://www.microsoft.com/canada/launch2005/default.aspx has all the details and registration links.

Didn't act soon enough? Didn't think a launch event could sell out? Watch for announcements of user group launch events through the fall.

Kate

 

Wednesday, 12 October 2005 14:11:01 (Eastern Daylight Time, UTC-04:00)  #    
# Thursday, 29 September 2005

The wheels of standards committees grind exceedingly fine and slow, but they do grind. Herb Sutter reports that after almost two years and eleven face-to-face meetings, the working group is recommending the C++/CLI standard for binding ISO C++ to ISO CLI (the most popular implementation of the CLI is in the CLR of course) become an Ecma standard. Next stop: an ISO standard.

Congratulations to all involved!

Thursday, 29 September 2005 07:16:59 (Eastern Daylight Time, UTC-04:00)  #    
# Monday, 05 September 2005

The Regional Directors had so much fun doing the GrokTalks at Tech Ed USA, we just couldn't leave it as a one-time thing. So at the PDC, we've arranged an event called PDC Underground. While we won't be filming and uploading the talks, we will be able to accomodate an actual audience. If you're going to be in LA, or if you're there all the time anyway, you want to come to this event. Ten RDs, fifteen minutes each, just the essence of what you need to know about one topic.

I'm doing "C++ is alive and well":

Abstract: The "C++ for the runtime" in Visual Studio 2005, C++/CLI, features everything developers love about C++ -- including templates and deterministic destruction -- and everything we love about the CLR -- including generics and garbage collection. This best-of-both-worlds approach enables the fastest and easiest interop between managed and unmanaged code. Preserve your legacy without a port, use the same binaries to support old and new clients, control the cost of interop: that's what C++ does so well.

More details and a registration link at http://www.pdcunderground.com/. If you're a member of a user group in the LA area, contact your leader who probably can get you a button to wear.

See you there!

Kate

Monday, 05 September 2005 12:54:03 (Eastern Daylight Time, UTC-04:00)  #    
# Wednesday, 31 August 2005

Kang Su kicks off his blog (two and a half weeks ago, I can't believe it took me this long to notice) with a big red HIRING in the middle of his first post, then goes on to give you the C++-eye view of PDC including the so-worth-your-while upgrade lab.  Then he tells you how to find out what the Profile Guided Optimization process discovered about your code. Excellent and you know I'll be reading regularly.

Next time I get out to Redmond, though, I am going to have to ask for a tour of the office so I can see where they keep the “your turn to blog regularly” baton or hat or whatever they use. It seems as soon as one or two start, the others all stop. :-(.

Kate

Wednesday, 31 August 2005 13:49:30 (Eastern Daylight Time, UTC-04:00)  #    
# Tuesday, 23 August 2005

Last year I had a marvelous time at Tech Ed Africa, and made the Top 5 list. I am thrilled to announce that I will be there again this year! It will take me about 41 hours to travel from my house to the conference center, and about 36 hours to get home a week later. This place is seriously far from home.

My talks:

Microsoft Visual C++ 2005: A Look at the New Features for Building Fast Native and Managed Code
Whether you build end-to-end applications or components for enhancing larger applications, the new Microsoft Visual C++ 2005 is the power tool for Windows programming. In this presentation we spend extensive time in the Visual C++ 2005 development environment -- highlighting new productivity features -- as we dive into its support for building high-performance, first-class native and managed applications. Learn about native code compiler optimizations, security enhancements, 64-bit development, and support for multiprocessor/grid computing systems. In addition, this presentation demonstrates how Visual C++ 2005 now provides CLR/.NET Framework support that allows it to stand toe-to-toe with any other tool in terms of elegance and productivity… with the additional benefit of high-performance access to native code and the ability to easily move native code to the managed environment.

Microsoft Visual Basic 2005: Application Frameworks and Advanced Language Features
This is a must-see session for Visual Basic developers who are new to Microsoft Visual Studio 2005, and also reviews the major feature changes and additions for beta 2. Take a top-down look at the new application architecture and RAD development enhancements in Whidbey, including several key productivity features that are exclusive to Visual Basic. This session covers the new Visual Basic lightweight application model for client applications, the My namespace, Data, Settings and Resources, and many more features that speed development for connected applications.

Windows Forms: Deploying Applications with ClickOnce
This session covers examples of ClickOnce deployment technology at work in the real-world as well as advanced scenarios, including an in-depth look at leveraging ClickOnce APIs for server-side extensions and on-demand deployment of application components.

Only two things could have made my trip last year better: an extra day to explore and soak in the marvelous place where this conference is held, and a friend from "home" to travel and explore with, to while away the long trip there and back. Can you believe I get both my wishes! I must be living right.

Oh, did you want to register? Too bad, it's sold out. :-)

Kate

Tuesday, 23 August 2005 07:30:46 (Eastern Daylight Time, UTC-04:00)  #    
# Sunday, 21 August 2005

Gregory Consulting is in its 20th year of operation, and at the moment has six employees. I think it's fair to point out you can't stay solvent over that length of time, meeting payroll, paying rent and ISP fees, without some business sense. One of our most important rules is Fail Fast. If you're doing something that might not work, and it's going to fail, it is so much better to fail in the first week than in the sixth month. This leads to all kinds of useful practises like doing the risky bits first, prototyping, making little proof of concept apps or subapps, and the like. Note that we don't do these things because a Methodology said we should. We do them because our gut or some little voice in our head says “are you sure that's going to work?” and then our brain comes up with a way to fail fast. Of course not failing at all is better than failing, and these techniques can also put you in the delightful position of knowing it's going to work, and just having to write it.

Fail Fast and "let's try it" can also save you a ton of time spent arguing about what's the best way to do something. Last week, I was at a early code review of an partly-written ASP.NET 2.0 application where someone had put some DataSet instances into Session even though they were used only on a single page. I wanted them in ViewState, because sessions expire and you have some hoops to jump through to ensure the work won't be lost. One developer on the team said putting things in ViewState made your pages too big. I said that wasn't an issue for the amount of data in this app. After about ten minutes of "what if someone pulls up the whole department for a year?" back and forth we decided to just try it. It took 30 seconds to flip the code between using Session and using ViewState. And guess what? After disabling viewstate on the grid, which was making both versions of the page really slow, there was no measurable difference (even for a year's data) between the two approaches. So it's going to use ViewState to make the coding simpler. But I would have been happy even if the experiment had shown the ViewState approach was infeasible, because we'd have found out before a hundred pages were coded.

Joel Spolsky says pretty much any methodology makes good software in the hands of those who are good enough to develop methodologies, and they pretty much all can fail in the hands of those who just follow the rules and do what the methodology says. Big complex process (and as we grow, our process naturally gets more complex) runs the risk of becoming opaque to those who are asked to follow it. That's why we like to come back to some touchstones that explain why we do what we do. Like Fail Fast.

Failure can be a good thing. If it saves you from following a doomed path for a year, you're glad to have failed early rather than late. If you can learn from something that didn't work, it will have earned its keep. This morning I read a story by Steven Sinofsky (no longer an entry level programmer :-)) at Microsoft about the failure of a C++ application framework, essentially the first try at what became MFC. He concludes:

When I think back about the dismal failure of our first library ... and how we regrouped, learned lessons, and put those into play, I realized that without that first failure we never would have developed the success criteria that allowed us to build MFC.

I'm never afraid to fail and I am not ashamed when I do. The only shameful things would be to continue to waste time avoiding the final decision that it is a failure, or not to learn from it.

Kate

Sunday, 21 August 2005 11:51:49 (Eastern Daylight Time, UTC-04:00)  #    
# Friday, 12 August 2005

Yesterday I was at a client and we talked, among other things, about how their story would make a good one to deliver at a launch event. They have an existing project in C++, client-server with MFC etc. Using Visual Studio 2005, building on the beta, they have wrapped an ASP.NET UI around the server engine so that users who don't have the main product installed on their desktops can still look at and edit some of their data. The new features in ASP.NET 2.0 were so compelling that this client has decided to use the go-live licence and deploy on the beta. The availability of the beta to MSDN customers, and the updates with the CTP process, have helped this ISV get 6 months to a year ahead of those who wait for the launch.

Then today, I faxed back my contract for C++ Connections, which is happening the week of the launch. Although I have at least one confirmed (and two strong maybe) conference trips between now and Nov 7, I am very much thinking about that week and the excitement that will build as more and more people learn what's in the 2005 release.

Those of us who are in the loop, reading blogs from team members and executives, grabbing betas and CTPs, living out on the bleeding edge putting Vista on the laptop, can sometimes forget that a launch is still a really big deal to people who've been waiting for Microsoft to make a big “here's what we've got event”. While such events will always be important for getting the attention of those who weren't looking, these days you can see what they've got right now. If you're in the loop enough to read my blog, you can be just about as completely in the loop as I am. What a fun time to be a developer!

Kate

Friday, 12 August 2005 17:14:27 (Eastern Daylight Time, UTC-04:00)  #    
# Wednesday, 03 August 2005

Did you know that Visual C++ 6, which is fast approaching its seventh birthday, will soon be an unsupported product? That's not exactly shocking; after all it was developed to let developers target Windows 95 or NT! Perhaps you were wondering when some other applications you use are going to reach end of life.... in that case, here are some handy links:

If there's something you don't feel like upgrading, you might want to know how long it will be supported for as part of your wait-or-upgrade-now decision.

Kate

Wednesday, 03 August 2005 15:30:47 (Eastern Daylight Time, UTC-04:00)  #    
# Wednesday, 27 July 2005

I got an interesting email today with this subject line: Want to build the next generation of C++ Libraries?

Enclosed was the following, from Martyn Lovell:

Development Lead, Visual C++ Libraries

Want to set the standard for the next generation of C++ application? Ready to design code that will be used and critiqued by the whole developer community? Want to have a direct connection to customers whose problems you understand? Want to build a new generation of libraries for a new language running in modern environments? The Visual C++ Libraries team is the place for you. We own all the library code shipped for C++. We are building new libraries that drive developer productivity and power on the native and managed platforms. Next version we’ll have to understand how our customers are going to work with WinFX and move forward with their existing code. And we’ll have to bring our native and managed libraries up to date to work seamlessly with the technologies of the Longhorn Wave, WinFX and ISV applications like Office 12. We own the full set of C++ Libraries -- C Runtime Library, Standard C++ Library, MFC and ATL. In future releases we’ll also have to address some of the challenges of parallel programming, and migration of existing native applications to managed code. We’re looking for senior individual contributors ready to code, design and provide the next generation of code reuse though leadership at Microsoft. Degree in a relevant subject and five years of software engineering required.

We are anticipating expanding our team for our next version to allow us to build some new MFC and ATL features (such as integration with Avalon, and support for new UI styles). So we’re hoping to find one or two people with deep MFC experience to add to our team. You don’t have to be using MFC today, but we especially want to hear from you if you have written a good amount of MFC code in your past.

If you know Martyn's email address, go ahead and email him and mention you saw it on my blog. If you don't, email me (don't leave a comment) and I will forward it to him.

Kate

 

Wednesday, 27 July 2005 14:26:24 (Eastern Daylight Time, UTC-04:00)  #    
# Friday, 22 July 2005

People regularly email me, or approach me at conferences, and ask me to “confirm” that Microsoft is trying to get rid of C++ in favour of C#. Since nothing could be further from the truth, I am not the person to get a confirmation from. But then again, I don't work for Microsoft, so maybe I'm deluded? That's why I like to find simple and unequivocal statements from people who do work for Microsoft, like this:

Visual Studio 2005 takes C++ development to a new level. For example, developers will get the same drag-and-drop experience creation of user interface as other languages, the same automatic statement completion and the same intuitive graphical debugger. Visual C++ 2005 developers will be able to build high performance 32-bit native code applications, use web services to interact with popular sites such as Amazon.com and Ebay, add professional quality 3D/2D graphics, video and sound using the DirectX SDK, all while generating robust and extremely fast code using our world-class C/C++ compiler.

C++ is here to stay for a long time and we are committed to providing the best tools for C++ development.

That's kind of hard to misinterpret. And when the Corporate Vice President of the Developer Division says it, you really need to believe it.

Friday, 22 July 2005 09:26:10 (Eastern Daylight Time, UTC-04:00)  #    
# Saturday, 16 July 2005

Brandon Bray went about 18 months without blogging and I know I was just one of many people who begged him to start again. Well, he has and his first entry is a delightful laundry list of things he plans to cover. The second is about switch reduction in the 2005 compiler and linker, but it provides wonderful insight into the hassles of writing, testing and maintaining a compiler and a linker. A few quotes:

I started evaluating changes by doing none else than reading the source code for the compiler driver. Through that I came across obsolete, outdated, bizarre, undocumented, and useless switches. I looked at each one asking whether it was necessary for the compiler in the long term and evaluating each switch against the requirements listed above. I actually spent most of my time trying to figure out what each switch did. Even asking developers who work on the compiler, I'd sometimes get several different answers. In a few cases, no one knew what the switch did. If our own team couldn't recall a switch's purpose, it's not hard to believe nearly every programmer using Visual C++ will have the same problem.

...

In a good attempt to allow application writers to make use of the latest and greatest hardware, nearly every compiler introduced a new better switch to make your code even faster. Unfortunately, compiler switches end up in make files that rarely get revised. It wasn't uncommon to see a make file specify a G4 or G5 switch even though 80486 and Pentium have long been out of mainstream production. The G-series of switches do not prevent programs from running on older hardware, which was a common misconception. Eventually, Visual C++ just ignored the G3, G4, and G5 switches and the program compiled as if G6 had been given to the compiler.

Brandon writes with a dry, understated sense of humour. You have to love “It is difficult to know that Os and Ot are ineffective.” or “Very few programs could actually work with these options, so they were both removed from Visual C++ 2005.” Not to mention subheads that call switches “truly evil” or “bizarre”.

An excellent post to give some insight into what the team's decisions involve day to day, and the extent to which MVP and Ladybug feedback make a real difference in those decisions. Keep going, Brandon!

Kate

ps: the topic for the second post came from a comment on the first. Tell him what you want to read and I bet he'll write it.

Saturday, 16 July 2005 22:30:10 (Eastern Daylight Time, UTC-04:00)  #    
# Monday, 27 June 2005

Actually a whole bunch of them are, at www.groktalk.net, but mine in particular is at

http://www.groktalk.net/blog/KateGregoryPresentingWhyCIsntCEnough.aspx

My favourite part happens after the camera is off and we go to credits. :-)

You can stream these, download them to watch at your leisure, or bring them down in the background with BITS using a tool like DrizzleCast. Full instructions are at the main URL. We've set each talk up as a blog entry so that you can comment and ask questions: you'll lower my workload if you comment there rather than here.

Kate

Monday, 27 June 2005 18:25:30 (Eastern Daylight Time, UTC-04:00)  #    
# Thursday, 23 June 2005

The C++ team has released an update for Beta 2 of Visual C++ 2005. This isn't a feature patch, it's an improvement to the information gathering that they use to tweak the final release, based on how all of us actually use the beta.

This patch updates the C++ IDE language service DLL (vcpkg.dll) to provide proper upload of usage data for the Customer Experience program. Applying this update is very important in ensuring that the Visual C++ team gets accurate data about the usage of the different product features. The Visual C++ team would appreciate you taking the time to apply this patch. This patch ensures that the Visual C++ team gets the most accurate information available to help provide a high quality product at RTM.
The patch is about a meg: you can download it right now. Then it's just a matter of extracting and replacing a DLL.
 
Kate
Thursday, 23 June 2005 07:17:07 (Eastern Daylight Time, UTC-04:00)  #    
# Sunday, 19 June 2005

While we wait for my Groktalk to appear (editing is really hard and timeconsuming and Scott is a hero) I have been getting a few requests for “the seven things C++ has that C#” doesn't.

  • Can generate native code and work with native types from other libraries
  • C++ interop – the fastest and easiest
  • Templates and generics
  • Deterministic destruction
    • my absolute favourite, I must say
  • Optimized MSIL
  • PGO for native and managed code
  • .NET Linking (from within the IDE)

I will try to do individual blogs on these when I can. In the meantime, you can peruse the deck and remember, it's for a ten minute talk: Why Cpp.ppt (94 KB).

Kate

C++ | RD | Speaking
Sunday, 19 June 2005 14:37:49 (Eastern Daylight Time, UTC-04:00)  #    
# Saturday, 11 June 2005

In my second Tech Ed talk I touched very briefly on the classes, templates, and macros that make it easy to integrate MFC and WinForms in C++ applications that target the runtime. If you want proof of Microsoft's continuiing committment to MFC, head for the new MFC whitepaper on MSDN. I quote:

.NET integration enables MFC applications to leverage the power and productivity of the .NET platform as a natural extension of MFC. The reliability and security enhancements in MFC make for a more productive development process with fewer end-user issues, and existing MFC applications can take advantage of these enhancements with little more than a simple recompile in many cases.

I'll give links to more details as soon as I can.

Kate

Saturday, 11 June 2005 14:17:14 (Eastern Daylight Time, UTC-04:00)  #    
# Monday, 06 June 2005

My Tech Ed talk today was about what's new in C++ other than the language. I promised some links to whitepapers and resources. Here they are:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vstechart/html/floapoint.asp - Eric Fleegal's whitepaper on floating point optimization.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vstechart/html/securitychecks.asp - My whitepaper on GS and RTC in Visual C++ 2003, which you can use as a starting point. Try the samples with 2005. The code samples come with the C++ toolkit - there's a link in the whitepaper to download it.

Thanks for coming to the talk!

Kate

Monday, 06 June 2005 17:17:02 (Eastern Daylight Time, UTC-04:00)  #    
# Monday, 30 May 2005

It starts with Chris Sells, who says he wants “the power and performance of C++ and the simplicity of C#.” He links to a grumpy programmer blog that says lovely things about the new C++/CLI, including this in the first sentence:

C++ becomes a fully fledged, first class .NET language, throwing off the clumsy ‘managed extensions’ and gaining a full set of designers, code verification and mixed mode (managed and embedded) capability. It is thus the only .NET language that offers true backward compatibility with legacy code bases and delivers genuine performance benefits over C# or VB.NET.

He then goes on to say something that many people close to me say regularly: what the heck is C# for? I don't say this myself, I think lots of people love C# and more power to them, there's nothing wrong with it at all. It has a place. It's just not the only way to use semicolons and brace brackets while targeting the CLR, that's all.

The comments section of Chris' post is full of entries from people who don't know what C++/CLI is. I'm not being rude or dismissive, it's just that someone who complains about the double underscore keywords is complaining about the old syntax, and that is gone now. Read my lips: no more double underscores! Let's keep saying it till everybody hears it! ... er, sorry, got a little carried away there. If you haven't seen the new syntax, try Stan's “Hello, C++/CLI” column.

Next up is Sam, who confessed to me privately that he liked C++/CLI and has now come out on his blog: “I was expecting all sorts of horrors and errors but the code came out perfect in first try and naturally, the way C# flows for me.”

Craig Andera basically says “but people like C#” and you know? I'm not arguing with that. But why is it a win-lose game with C++ and C#? Why can't they both soar and do well?

A nice start to what will probably be a long hard week for me.

Kate

Monday, 30 May 2005 09:57:41 (Eastern Daylight Time, UTC-04:00)  #    
# Tuesday, 17 May 2005

With the seven-city Smart Client Deep Dive tour done, I thought it would be appropriate to summarize my upcoming speaking and training schedule.

  • May 23-26. Ascend Training (Smart Client Track) Redmond, WA. Teaching Microsoft people and special guests (MVPs, RDs, partners) all about Smart Clients (VSTO, WinForms, and more) in Whidbey.
  • June 3. Ascend Training (one day ultra condensed) Orlando, FL. This is a pre-conference event for Academic Days at Tech Ed.
  • June 6-10. Tech Ed USA,  Orlando FL. Two talks (Monday morning and Tuesday morning - both are C++ talks and who would go to only one of them? See the new syntax, new optimizations, new power for an old friend - search for DEV330 and DEV331), one panel lunch (women in technology), and helping out with the way cool thing the RDs are doing that I can't quite discuss yet.
  • June 18-19. DevTeach, Montreal Quebec. A Canadian User Group Leader get-together, and my two C++ talks glued into one “What's New in C++“ presentation.
  • October 23-26, Tech Ed Africa, Sun City South Africa. OK, I'm not officially accepted as a speaker yet but I'm pretty sure I'll be there, topics TBD.
  • Nov 7-10. C++ Connections, Las Vegas, NV. How real customers are moving to the new C++.

This is just the stuff I'm on stage for. I'm planning to be in the audience at either or both of the PDC and the MVP Summit, both in September.  And oh yeah, I have a company to run and some projects to finish. Gotta dash!

Kate

Tuesday, 17 May 2005 10:39:50 (Eastern Daylight Time, UTC-04:00)  #    
# Monday, 28 March 2005

What does it take to become a SharePoint developer? You should understand how SharePoint looks to a user, and the best way to learn that is by using it. You should know where to find the documentation for the object model and for CAML, and that means lots of Googling because it's not all in MSDN by any means. And then of course you need to be a developer. Mike Fitzmaurice makes it pretty clear that means an all-around good .NET developer. He's inspired by Gregory MacBeth's inaugural blog post that lists the steps to becoming a good SharePoint developer. Gregory sets the bar pretty high - step 0 is get your MCSD, and then the real learning can begin. My attention was caught by Mike's postscript that in addition to being an all-round .NET dev, in VB or C# as you prefer, and learning the SharePoint-specific material, you're also going to need C++:

Attention tool builders and other interested developers — in the next release, protocol handler development and IFilter development will still need to be in C++.  Do not wait for the rules to change, because they won’t (at least not before “v4”).  If you want to extend our search technology to new content sources and formats, you might as well get started now.  Search gets a lot better in many ways, but the method for developing IFilters/protocol handlers isn’t one of them.

So, all round .NET dev, SharePoint object model, CAML etc, and while you're at it, C++. No wonder I'm finding good SharePoint devs rather hard to find!

Kate

Monday, 28 March 2005 15:25:37 (Eastern Standard Time, UTC-05:00)  #    
# Sunday, 27 March 2005

Sessions and abstracts, along with speaker names, are starting to appear on the Tech Ed sessions page. My C++ talks have been christened DEV 330 and DEV 331. You can search on the session code or my name to see the abstracts.  Doesn't look like you can start to build your calendar yet, but watch for it.

Since the speaker dropdown is populated, I just had to check: I counted 8 Brians, and 11 obvious women, not counting the chances that an Alex, Chris, or Pat could be a woman. I also see some fellow RDs and some Speaker Bureau folks. Should be a fun week!

Kate

Sunday, 27 March 2005 15:58:51 (Eastern Standard Time, UTC-05:00)  #    
# Friday, 25 March 2005

How's this for a party? A five-day C++ conference, C++ Connections, held in conjunction with Visual Studio Connections,  ASP.NET Connections, and SQL Server Magazine Connections from Nov 7-11 2005 in fabulous Vegas at the marvelous Mandalay Bay resort. My standard introduction line on C++ matters is “I've been working in C++ since before Microsoft had a C++ compiler.“ It isn't 20 years for me (I never used cfront) but it sure is close.

Think you could speak there? The call for papers is on Herb Sutter's blog. Am I speaking there? I hope so, I will report back with details when I have them. This is going to be fun!

Kate

Friday, 25 March 2005 20:53:57 (Eastern Standard Time, UTC-05:00)  #    
# Tuesday, 01 March 2005

Lots of Tech Ed rejection letters this year -- I got five myself -- but in the end I am giving ALL the C++ talks -- really I am! Well, that is to say, both of them. But at the moment I only see two Visual Basic and two C# talks, so I don't feel bad. The talks, and current abstracts, are:

Visual C++ and .NET: Great Performance, Full Access and Easy Migration of Existing Code

Abstract: The enhancements to Visual C++ 2005 enable it to stand toe-to-toe with any tool in terms of support for the .NET Framework. In fact, in many ways it can do things no other tool can. Learn how the CLR brings new features such as garbage collection, generics, reflection, and verifiability to C++ ... and how C++ brings deterministic cleanup, templates, and meta programming to the CLR! Learn how to easily migrate existing native code - including MFC applications - to run under the CLR. Strategies for choosing which parts of the application remain native and which are managed will be discussed. Finally, this session will provide guidance on how to build high-performance managed "wrappers" enabling reuse of native libraries.

Visual C++ 2005: A Look at the New Features for Building Fast Native and Managed Code

Abstract: Whether you build end-to-end applications or components for enhancing larger applications, the new Visual C++ 2005 is the power tool for Windows programming.  In this presentation we’ll spend extensive time in the Visual C++ 2005 development environment – highlighting new productivity features – as we dive into its support for building high-performance, first-class native and managed applications.  You’ll learn about native code compiler optimizations, security enhancements, 64-bit development, and support for multiprocessor/grid computing systems.  In addition, this presentation will demonstrate how Visual C++ 2005 now provides CLR/.NET Framework support that allows it to stand toe-to-toe with any other tool in terms of elegance and productivity…with the additional benefit of high-performance access to native code and the ability to easily move native code to the managed environment.  

You'll want to attend both, of course. Register now!

As well, the Women In Technology lunch will be happening again and I'm looking forward to another panel appearance. This is shaping up to be another great Tech Ed... as long as some more familiar faces start to show up on the speakers list.

Kate

 

Tuesday, 01 March 2005 09:04:57 (Eastern Standard Time, UTC-05:00)  #    
# Monday, 31 January 2005

Apparently some people are hesitant about bidding on the auction in case they win. I know the feeling, do I have enough tough questions to justify an hour of Richter or Prosise time, do I have my act together on Web Services and Interop enough to grill Michele on them properly...

Relax. You don't have to think of it that way. Whoever you win, fire us an email with something that's been bugging you. Like “can you really explain this whole destructors in C++ when it's managed code and the object I'm using wasn't even written in C++?” Or like some of the old emails I cleared out this last week: “how can I uninstall a service?” “how do I restrict forms authentication in ASP.NET to only some folders? How can I force a logout when they browse from a secured to an open page?” and “why am I getting this linker error?”. Maybe that uses up 10 or 20 minutes. Fine, next time you have a toughy like that, send it along. By the time you use up your whole hour, you'll probably have become a friend/colleague/former client who can send questions like that once in a while for the rest of your life.

Or, how about this? Take a look at the talks your selected consultant has prepped for upcoming conferences (get us to send you the abstracts we've submitted) and have us deliver a private session of a useful talk to your whole company over LiveMeeting. There's a free LiveMeeting trial going on, and the talks have to be prepped anyway, so your hour would just be the delivery of the talk, to as many of your colleagues as you can get online at once. So it might end up 90 minutes, we don't mind.

You can't lose! Hell, even if you use your hour to take one of us for a drink the next time we're in the same city, what really counts is you gave $100 or $150 or $200 to help people who have NO clothes, NO books, NO walls around them.... this is a FUNDRAISER so come on, let's raise some funds!

Kate

Monday, 31 January 2005 09:40:55 (Eastern Standard Time, UTC-05:00)  #    
# Wednesday, 19 January 2005

In fact, you've been able to register for over a week, I just didn't notice until today. Last year it sold out, so if you already know you want to go, start making your plans now. If you register early you save money, there's some sort of sweepstakes to be won, and you'll know one little part of your year plan well in advance. Go on, register.

Me? I'm hoping to be there as a speaker :-) (I submitted a number of C++ talks) or to take advantage of some not-yet-announced-I'm-just-hoping pass for RDs or MVPs or INETA speaker bureau folks or something, so I haven't registered. One way or another, I will be there.

Kate

C++ | Consulting Life | INETA | MVP | RD | Speaking
Wednesday, 19 January 2005 14:32:28 (Eastern Standard Time, UTC-05:00)  #    
# Saturday, 15 January 2005

Thanks to kbalertz, I was notified of these:

FIX: You may receive results that are not correct when you perform mathematical computations that involve floating point arithmetic in Visual C++ .NET 2003

The repro code looks like this:

double a = 1.0 - sqrt(225.0) / 36.0;
double b = 1.0 + (31-30.0) /70.0;
if( b > 2.0 )
   b = 2.0;
double c = b * a * 9.0;
printf( "%f\n",c);

If all is well, this is supposed to print 5.325000 but if you have the problem it prints 14.378571 -- a slight discrepancy! Get the hotfix only if you need it.

Those with an old version of the XBox Developer Kit installed might also like to know about:

PRB: Debugger stops responding when you debug a Visual C++ .NET application with the Visual Studio .NET debugger

Workarounds: get a newer XDK, disable parts of the XDK, or leave your XBox on and connected to your computer all the time. That last one would kill my productivity for sure.

Saturday, 15 January 2005 15:13:47 (Eastern Standard Time, UTC-05:00)  #    

I'm pleased and proud to report that I have again been awarded MVP Status for C++. Technically it's “Visual Developer - Visual C++”. This came through January 4th, but my blog's been out of order for a bit.

Kate  

C++ | MVP
Saturday, 15 January 2005 13:16:36 (Eastern Standard Time, UTC-05:00)  #    
# Wednesday, 22 December 2004

Recently, a reader asked "Do you know if Managed C++ can work with Managed DirectX9? I see lots of examples of C# with Managed DirectX but it seems if I want to use C++, I have to use unmanaged C++ with COM... I’ve spent the last six months learning Managed C++ and want to use that knowledge and not have to learn C#."

It certainly seemed logical that C++ and DirectX would play well together, but I couldn't find anything obvious, so I went to the source: the C++ team, who pointed me to Tim Miller, who implemented the Managed DX9 layer. He assured me it does work, though with an oddity or two, and pointed me to a blog entry of his on the topic: http://blogs.msdn.com/tmiller/archive/2004/10/05/238317.aspx.

If you're a Managed DirectX person, and a blog reading person, read Tim's blog!

Kate

Wednesday, 22 December 2004 08:04:35 (Eastern Standard Time, UTC-05:00)  #    
# Wednesday, 15 December 2004

I just read a blog entry that, to me, really epitomizes what blogs are all about. It starts out as a musing on a little technical question -- if some C++ code throws a string literal, what kind of catch clauses should win the race to catch it? -- and turns into a very personal story of what C++/CLI is for and about and Stan's motivations in being part of it. He says:

We have had an extraordinary degree of freedom not simply in our design, but in our being able to reach out and work with the general c++ community. this language is a coalition. I think we have all wanted to put the best face on C++ in what we regard as an otherwise hostile environment for C++. We think this is a win-win situation for everyone. if you don't like something, you should let us know. we're not a hundred thousand leagues removed from our users. if you want to use the language, you have every right to tell us what you think about it; how you find it; what you want.

And later:

I just program and write. and I do that best in C++. C# and Java mean nothing to me. Now I have my own language to use on .NET. That was my personal agenda in all this. I think you should check it out.

So go read it. C++/CLI is being developed by real people who care about the technology they use and the technology they create. I don't know what it is about C++ that makes people feel this way about it -- I feel the same way myself. I use VB.NET almost every day, I use XML, I use all kinds of things, but I don't really have feelings towards those things. I do for C++. Weird but true, and --hey!-- I'm not the only one.

Kate

Wednesday, 15 December 2004 11:48:20 (Eastern Standard Time, UTC-05:00)  #    
# Monday, 08 November 2004

Over on Developer.com, Brad Jones has summarized the TIOBE Programming Community (TPC) Index for October 2004. This is a measure of how many web pages and newsgroup postings mentioned a programming language name in conjunction with the word programming. So if I say “For serious programming, C++ is way better than Java” then that is a hit for both C++ and Java. These hits are going to include people's resumes, job postings, ads for courses, how-to pages, book pages, and so on. It gives a rough indication of popularity that people are talking about a language. After all, I rarely compare C++ to Fortran or to PL/I. I certainly can't remember the last time MATLAB (to pick a name from the table) came up in conversation. Job seekers trim their resumes all the time to include only the “relevant” languages they know.

There's a table of results, and a sorting of languages into “A languages” and “B languages” but I was really intrigued by the graph. A first glance reveals a fairly steep Java fall this year. But the C++ line is more interesting because it falls too, though not as steeply or as far, and then climbs back up again starting in March of this year. Is this people talking about C++/CLI? I think it is.

Kate

Monday, 08 November 2004 13:46:12 (Eastern Standard Time, UTC-05:00)  #    
# Friday, 05 November 2004

Last night I spoke to Carl Franklin (my fellow RD) for Dot Net Rocks. Over the course of an hour and a quarter we talked about C++ (I think I'm converting him :) ) VSTO, VB, sockets, what I have for breakfast, Carl's Westminster Abbey experience, and assorted geeky things. It was a lot of fun. Here are some links stolen from the site:

Kate

Friday, 05 November 2004 09:53:38 (Eastern Standard Time, UTC-05:00)  #    
# Wednesday, 27 October 2004

My latest whitepaper is on MSDN now.

Summary: This article is for C++ programmers who are (at least for now) not targeting the Microsoft .NET Framework in new or existing applications. It provides some guidelines for moving to the .NET Framework without leaving behind the investment in existing code, and explains why you should consider moving to the .NET Framework not only for new development, but for existing applications as well. (9 printed pages)

Kate

Wednesday, 27 October 2004 06:10:12 (Eastern Daylight Time, UTC-04:00)  #    
# Tuesday, 26 October 2004

It's still gorgeous, sunny, and HOT here. I did two talks today -- the C++ and the VSTO ones. I was really pleased with the C++ attendance, and people saying “I'm going to switch back” after seeing what Visual C++ 2005 is going to be like. And that was with no demos! VSTO is a very fun product, and easy to demonstrate too. So two pleasant sessions with very nice audiences and great logistics.

One more day, one more talk, but first I think I'm going to go for a swim...

Kate

Tuesday, 26 October 2004 10:31:44 (Eastern Daylight Time, UTC-04:00)  #    
# Thursday, 14 October 2004

I'm on vacation at the moment (travel blog entries to come if I get any free time) but had to take a minute to mention that I'll be speaking at Tech Ed South Africa at the end of the month. I'm doing three talks: better performance in VB, programming with Word or Excel as your user interface with VSTO, and Visual C++ 2005 and the C++/CLI features -- which the organizers were nice enough to add just because I asked them to. I'm really looking forward to the trip and the people!

C++ | Office 2003 | RD | Speaking | Travel
Thursday, 14 October 2004 18:07:48 (Eastern Daylight Time, UTC-04:00)  #    
# Sunday, 05 September 2004

Here is a terrific collection of “new C++” material that's well worth reading, all from Stan lately:

  • http://msdn.microsoft.com/visualc/default.aspx?pull=/library/en-us/dnvs05/html/TransGuide.asp is a translation guide from Managed Extensions for C++ (that would be the “all those underscores“ version of the language) to C++/CLI (the new, beautiful version.) If you went to the trouble of learning the __gc, __property etc way of doing everything, this guide will show you how to translate your programs. If you never got around to learning it, move straight to C++/CLI.
  • http://msdn.microsoft.com/visualc/?pull=/library/en-us/dnvs05/html/stl-netprimer.asp is a guide to STL.NET. You won't find STL.NET in the current CTP release, but it's coming. C++ is the only managed language that supports both templates and generics, and they each have their place. With STL.NET you can get the best performance, you can use idioms that are familiar and comfortable, and you give up nothing when it comes to interop with other managed languages. This article is part I; I'm watching for more parts.
  • Finally, this blog entry (http://blogs.msdn.com/slippman/archive/2004/08/27/221373.aspx) is on interior pointers. I've read explanations of how to code interior pointers before, but hadn't really seen what they are for. (The same can be said of anonymous methods; lots of folks will show you how to do them but Don Box showed the other night what they can be used for, and now I get it. But that's Don for you.)

What a great time to be a C++ person, watching the new language take shape.

Kate

Sunday, 05 September 2004 10:12:41 (Eastern Daylight Time, UTC-04:00)  #    
# Friday, 06 August 2004

Clearly some sort of internal milestone has been reached by the C++ product team, because Stan and Herb are blogging again. Stan has quite a long entry on why C++/CLI supports both templates and generics, from an insider/designer point of view. It's not a skim-through-while-you-eat-your-breakfast post, but if you care about C++ you'll be glad you read it.

Kate

Friday, 06 August 2004 09:02:00 (Eastern Daylight Time, UTC-04:00)  #    
# Thursday, 08 July 2004

Here's a strange thing that happened yesterday. An ASP.NET app, written in VB.NET, was only intermittently dealing with its events, such as button clicks. At first it seemed to be that the event was handled if we were debugging, and not handled if we were not. But that turned out not to be the case.

Whenever you're faced with weirdness -- and let's face it, an event that sometimes is handled and sometimes is skipped counts as weirdness -- the knowledge base is your friend. A team member found 314965, which is a C# version of the problem. Although no-one could find a VB KB article, these are our symptoms, and more importantly this fix was a fix.

SYMPTOMS

A control event on a Microsoft Visual C# .NET Web application form may not fire. The event does not fire if you wire the control event imperatively, that is, if you double-click the event from the Events view and then add the code.

RESOLUTION

Add the event to the HTML code behind the form, that is, wire the control event declaratively.
 
“Wire the control event declaratively” means put an onxxx= attribute in the HTML:
 
<asp:Button id="Button1" runat="server" oninit="Button1_Init" Text="Button1"></asp:Button>
Instead of oninit you might have onclick or whatever event you have an issue with. Also, make your handler function public rather than private.
 
Moral of the story: there are two. First, it isn't always you. I can't tell you how many emails I've received telling me “there must be a bug in Microsoft's C++ optimizer, because my debug builds work beautifully but my release builds blow up.” Experienced C++ programmers mutter or shout “memory problem” when we get such emails: you're overwriting something or leaking or just generally not handling memory well; debug and release builds have huge differences in allocation, initialization, and other memory work when you're using unmanaged C++. Most of the time, it's you. But every once in a while, it's not you. And a quick search through the knowledge base is one way to see if it's you or not. Second, just because you're writing in VB doesn't mean that C# KB articles don't apply to you. Never be a language snob.
 
Kate
 
ps: of course I program in VB sometimes. What else would I use to create ASP.NET apps?
Thursday, 08 July 2004 09:48:33 (Eastern Daylight Time, UTC-04:00)  #    
# Thursday, 01 July 2004

”For pure .NET, C++ typically 25% faster than C#” is the only English sentence (other than photos of slides) in a blog entry I just came across. The rest is Italian, but you know that one sentence certainly caught my eye.

The entry describes a June 30th (that would be yesterday!) Herb Sutter talk. I ran it through Babelfish, but automatic translation doesn't do well with technical terms:

Ago from landlady the "Deterministic finalization" where java and C # is under accusation in order not to have conserved the concept of annihilator in the language. The C#/CLI annihilator is the equivalent of the pattern arranged suit.

Er, OK. Still I think the slides say a lot, and 25% faster? 50% faster if there's heavy pinvoke? Wowza! The future of C++ is indeed a much rose-colored one.

Kate

Thursday, 01 July 2004 17:08:17 (Eastern Daylight Time, UTC-04:00)  #    

Like this quote?

I may have to retreat from my stance of preferring C# and disliking MC++. With Whidbey, MC++ is a whole new language and nearly all of my current objections to it have disappeared.

It's from the last paragraph of an article by Brent Rector  :-) The article itself is worth a read, too.

Kate

 

Thursday, 01 July 2004 16:55:20 (Eastern Daylight Time, UTC-04:00)  #    
# Wednesday, 30 June 2004

In conjunction with the announcement of the Express products, Microsoft's Channel9 is running a coding contest. Each language has its own judge, and yes of course there's a C++ judge. “The Summer of Express contest is a worldwide skill contest where developers are challenged to create “non-business” applications using the newly announced Express products.” And yes, you can use the betas -- in fact that's the whole point.

 Why not?

Kate

Wednesday, 30 June 2004 09:56:54 (Eastern Daylight Time, UTC-04:00)  #    
# Tuesday, 29 June 2004

This is fun! If you want to get started using Visual C++ to write managed or unmanaged code, but you don't want to buy the full product, what can you do? You could use the free Visual C++ Toolkit, which I've told you about before, but that doesn't include the IDE though it does include some very nice samples and whitepapers: one blogger was nice enough to say “the samples alone are worth the download.” At Tech Ed Europe, Microsoft has announced the Express versions of the 2005 products, including Visual C++ 2005 Express (that means they're in beta now, whereas the toolkit is the current released version. You can't release products you create with a beta.) You can download now, so go ahead!

Kate

ps: if you know who the gentleman is at the top left of that Visual C++ 2005 Express Beta page, please drop me a note. I swear we've met and it's going to bug me until I get a name.

Tuesday, 29 June 2004 13:40:10 (Eastern Daylight Time, UTC-04:00)  #    
# Monday, 14 June 2004

My latest codeguru column, C++ Language Changes for Visual Studio 2005, has been uploaded to the CodeGuru site.

Monday, 14 June 2004 19:53:47 (Eastern Daylight Time, UTC-04:00)  #    
# Monday, 31 May 2004

Friday morning at Tech Ed I was talking to some folks on the C++ team about the language changes that are coming for C++ and what they really mean. I don't mean that “ref class” means a class whose memory is managed by the runtime. I mean “what is the importance to a language of its syntax, and of changes to that syntax?“ How does changing a language affect the community of people who are using that language?

Managed Extensions for C++ was an attempt to bring the CLR to C++ without changing the syntax of C++. It had the side effect, in my opinion, of changing the spirit of C++, of preventing you from writing “real“ C++ for the CLR. The new language, to be known as C++/CLI, changes the syntax, but oddly enough that makes writing C++ for the CLR more C++-like than ever.  The idioms, the ways of thinking, the patterns of development, transcend the syntax. We get destructors, we get templates, we get type-agnostic code. I want this new syntax to be widely accepted, and for people to move to .NET without leaving C++ for C#. I want this partly for selfish reasons, of course: there's value in being a C++ expert only as long as there are other C++ programmers doing my kind of work. Otherwise I'm just the last person to see the light and move to C#. But I also truly believe that if you've gone to the trouble of learning C++ (and really learning it, so you like templates and destructors and operator overloading and the like) then you are foolish to wander away from that and learn a different, less powerful language. You can't beat C++ for interop, and it's a first-class CLR language for libraries, services, and other back end work. Front end work is tough because certain product teams haven't built C++ wizards and designers, but it's not impossible. I for one am agitating for wizards and designers that support C++ and I'll report back as I make progress there.

To me, this is a turning point for C++, a chance for people who rejected the framework to stick with C++ or rejected C++ to go to the framework to get the best of both worlds. But I know that there's a limit to how many times you can change a language, and if this version is as poorly-liked as Managed Extensions, times will not be happy. The good news is I like C++/CLI a lot, and believe it will succeed as a language to bring .NET to C++ and C++ to .NET.

Who else feels the way I do? Stan Lippman, for one. He says “I personally guarantee that anyone that feels passionate about C++ will be both delighted by and engaged with the C++/CLI language that will be shipped with Visual Studio 2005.“ You might feel that “delighted“ is a bit strong, but wait till you see for yourself. And if you hate Managed Extensions, you'll chuckle to read how he feels about them. 

How can you learn more? I have an upcoming codeguru article on the syntax. Herb Sutter had a horrible timeslot at TechEd to talk about this, but you can find the slides at http://216.55.155.2/docserver/slides/DEV333_Sutte%20v3.ppt (I think you need to be a TechEd attendee to log in.) There are links all over http://msdn.microsoft.com/visualc/ as well. I am indeed delighted with the new syntax (am I hopeless or what, but I actually laughed with happiness when I saw how properties are done now,) and I hope you will be too -- for my sake and yours.

If you're working in C++ now but you're not working on the CLR, should you learn Managed Extensions -- the __gc stuff -- or wait for Whidbey? I guess I'll say get a copy of the Community Technical Preview (it's still pre-beta) and start learning Whidbey/2005 syntax now. If you are using __gc now, get ready for things to be a whole lot nicer really soon.

Kate

Monday, 31 May 2004 13:34:37 (Eastern Daylight Time, UTC-04:00)  #    
# Tuesday, 25 May 2004

This year there are two flavours of speaker shirts at TechEd: the darker (more attractive, I think) blue belong to Microsoft people and the lighter ones to third parties -- that would be me. I wore one of mine today and since I have booth duty tomorrow (RD booth -- 49 and 50 in the Microsoft Pavilion in the Exhibit Hall, come on by) I'll be wearing the other one. I'm hoping to get a third shirt tomorrow. I don't know why I packed any of my own clothes, really, folks have been handing me shirts every time I turn around. No-one gives you pants as swag though. Too bad!

As well as the shirt, I have a slightly decorated badge:

I figure I might as well make myself easy to spot. So if you can't recognize me from the picture (upper left corner) on the bingo card, you can recognize my badge :-) Most of the RDs are wearing the Regional Director Program button also, and we tend to know where each other are. So if you still need a Forte or Huckaby signature, if you missed Clemens and Scott in the RD booth tonight, or left before Goksin arrived (oh yes, he did come by later!) then flag down any RD you see and ask us if we've seen the one you're missing.

I think I just about have one piece of badge bling for every category on my blog. I got an INETA card after I took the picture. I forgot to bring my MVP lapel pin, sorry MVP program.

And of course, I can relax and think about badges and shirts and such because I did my talk and it went well. I will try to get my code (and my slides for that matter) on CommNet.

Kate

C++ | Canadian Colour | INETA | Meta | MVP | RD | Speaking
Tuesday, 25 May 2004 02:06:35 (Eastern Daylight Time, UTC-04:00)  #    
# Monday, 24 May 2004

The talks must be seriously good this year. No-one is in the halls! The show is sold out, the red-jacketed aides are keeping people out of talks that are full, and yet I am not seeing many people at all. They must all be sitting in talks, or in the exhibit hall collecting swag. I have seen a few folks laden down with big bags of stuff.

I am also seeing a lot of women. I am walking by sessions and hearing women speak. I am seeing women with speaker badges and I don't know them! This is really cool. Being a woman should never be something that fast-tracks you to speaking but nor should it exclude you, and when the percentages are lower for speakers, even attendees, than in the industry as a whole it feels wrong. This year it feels more balanced. Fun!

Several people have come up to me and asked me to initial over my picture on the RD Bingo card. When I'm feeling extroverted I have even handed out extra bingo cards to those who don't have them. I've seen the fabulous prize now and let me just say that even the most swag-jaded of those I showed mine to said “ooh, cool, I want one of those.”

C++ talks are few and far between this year. Kang Su had one already, mine is in 45 minutes, there's a 64-bit one tomorrow and the super vital important “language changes for Whidbey” talk is Friday afternoon at 2:45. Aaargh. I will be on a plane. If you don't already know the language changes that are coming then you need to be at that talk. Change your plane tickets if you must. Come do the HOL that lets you play with the new features, or at least some of them, as well, it's DEV11 and it's in Room 6F.

Kate

C++ | RD | Speaking
Monday, 24 May 2004 17:25:37 (Eastern Daylight Time, UTC-04:00)  #    
# Wednesday, 19 May 2004

Tech Ed is next week! How scary is that? Here's some of what I'll be doing:

  - DEV331 "Visual C++: Using the .NET Framework in Win32/MFC Applications" is Monday afternoon, 3:15pm, in Room 10
  - Working in the Regional Director booth. If you're attending TechEd, be sure to get an "RD Bingo" card. Then find us (we're giving talks, hanging in the Cabanas, proctoring in the Hands on Labs and more) and get us to mark your card. Get a bingo, bring it to the booth, and get a prize. As for the booth (it's in the Microsoft pavilion) let's just say there will more prize opportunities there.
  - Doing my webcast again, this time Live From Tech Ed, at 11am Pacific time, on Wednesday. Of course, you can listen from anywhere, and I hope you do.
  - Serving on the panel of the Women in Technology lunch, Wednesday. All women at Tech Ed (for whatever reason) are welcome to come and join the conversation.
  - going to the Influencer party with MVPs, RDs, and assorted other VIPs.
  - meeting you! Why not? Set it up in RIO. I'd love to talk about whatever you're working on and why you want me to know about it, or how I can help you.

What else? Well I want to go to sessions and BOFs but I haven't had a chance to sit down with CommNet yet and plan that. I also have Cabana time and will be spending as much time soaking in information as I can. That includes information about what everyone wants to read about or hear about in talks, and what people are sick of already.

Kate

C++ | RD | Speaking
Wednesday, 19 May 2004 13:16:23 (Eastern Daylight Time, UTC-04:00)  #    
# Tuesday, 11 May 2004

VSLive has been over for days and days and still no blog from me, because I'm tired as I always am after a conference. I used to blame it on the flying and the airport time, but since I drove to this one, it must be the conference itself. I did four talks, and yes that's a lot of talks, and a roundtable user group thing. I had a fun time with old friends, made some new ones, and stuck up for C++ on cue. The VSLive speaker list is RD-rich so I enjoyed seeing the gang.

My best visual memory from the entire conference has to be watching Richard Hale Shaw trying to throw swag into the crowd -- tip for next year: boomerangs are not the ideal item to try to throw into the crowd :-). My favourite thing to say as the conference wound down: see you in two weeks! OK it's two-and-a-half, but still, Tech Ed is just around the corner!

C++ | RD | Speaking
Tuesday, 11 May 2004 18:12:16 (Eastern Daylight Time, UTC-04:00)  #    
# Tuesday, 27 April 2004

So, read any good buffer-overrun articles lately? Notice how they like to show the hapless programmer cheerfully using strcpy() to copy 11 characters (or 11,000 maybe) starting at the location where only 10 characters worth of space was allocated? Or maybe it's strcat that, merrily continuing till it finds that null terminator in the source string, goes way past its boundaries. Did you ever think to yourself as you read these examples, “Why can't strcpy, strcat, and the rest of them save stupid programmers from themselves?” (It's ourselves, really, but we all suffer from a little denial that we could ever write that sort of code.)

That's an idea, let's replace the naive and trusting version of strcpy, that assumes no-one ever gives it inappropriate arguments, with another version that doesn't always do as it's asked! Why not? I'll tell you why not: this is C++. And if C++ had a motto, it would be “you're the programmer!” or as I sometimes say, “OK, it's your foot!” Seriously, changing the way strcpy behaves might break code that isn't broken or insecure right now. In C++, we're allowed to write code that some compilers wouldn't let us write.

And if you were going to rewrite things, you might like to change the signature anyway, so that you could return an error code or other information. That means what you really need is a replacement for strcpy (and the rest) that's a little safer. And maybe to have the compiler warn you on your calls to strcpy so you can go through by hand and switch to these safer ones case-by-case.

That sounds like a plan. And I don't even have to do it. It's coming in the updated versions of the C Runtime Library for Whid-- er, Visual Studio 2005. And while they're at it, they're adding some overrun protection to the STL in the same timeframe. Intrigued? Read the whitepaper on MSDN. Michael Howard, coauthor of  Writing Secure Code,  lays out some of the problems and how the secure versions of old CRT standbys can keep your code out of hot water.

Tuesday, 27 April 2004 22:20:37 (Eastern Daylight Time, UTC-04:00)  #    
# Wednesday, 21 April 2004

Are you interested in C++ in the .NET world, but don't want to run out and buy Visual Studio just to try the compiler? Have you heard that the Microsoft compiler is actually a powerful, fast compiler for native applications as well as those targeting the runtime? Have you even wondered about using the Visual C++ compiler to build code that you'll actually deploy onto other operating systems?

Well, how about a free copy of the Visual C++ compiler? And linker of course, exactly the same tools that ship with Visual Studio. And libraries: the C Runtime Library and the Standard Template Library. Of course you can produce either native code or code that targets the Common Language Runtime. And to round out the toolkit there are four samples that show off some specific features of the tools, with accompanying whitepapers that explain those features and the samples.

Get yours today at http://msdn.microsoft.com/visualc/vctoolkit2003/, where you'll also find links to the whitepapers.

Absolutely Seen and Recommended, with the disclaimer that some of the work in there is my own :-)

Wednesday, 21 April 2004 06:57:20 (Eastern Daylight Time, UTC-04:00)  #    
# Friday, 16 April 2004

Early on in the webcast, a build failed, something about couldn't write to C:. It might have been full, but I decided I wasn't about to settle down to clear off my hard drive in front of attendees, so I carried on without demos. Luckily these slides feature all my code and screen shots of the important bits of the demos (property pages, ildasm output etc) so it worked out ok. (I think; I haven't seen the evals yet :-) .)

I'll be doing it again May 26th, which is actually during TechEd, and perhaps this time it will go a little more smoothly. My head was spinning by the time I finished this one!

Friday, 16 April 2004 16:02:26 (Eastern Daylight Time, UTC-04:00)  #    
# Wednesday, 14 April 2004

On Friday the 16th, I'll be doing a webcast of my TechEd 2003 talk, Head-Spinning Interoperability in Visual C++. This was a very popular talk at Tech Ed USA in Dallas and I repeated it at Tech Ed Europe in Barcelona, a little the worse for jetlag. To register, visit http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032247638&Culture=en-US. If you live in the US, you could even win a pass to Tech Ed!

Wednesday, 14 April 2004 22:14:21 (Eastern Daylight Time, UTC-04:00)  #    
# Friday, 09 April 2004

This is the "big deal" day for me, a day spent with the C++ team immersed in "what's new in Whidbey" and beyond. I've just about completed my mapping of faces to email addresses and delivered some copies of my book to a few people who really helped me while I was writing it. I am taking notes like a maniac, on new IDE features for C++ specifically, on new ways of managing property settings for C++ projects, on converting from old Managed C++ syntax to the new syntax, and so on.

The Developer Tools Roadmap has been updated. It shows some of what's new in Whidbey and looking forward into Orcas. Embedded C++ moving into Visual Studio, the new C++ syntax, templates and generics together, the true return of deterministic destruction with reference types allocated on the managed heap or the stack as you prefer, major optimization improvements for both native and managed code (especially PGO), and more. Of course whatever you see listed under other languages may well apply to C++ too, things like improvments in the Base Class Libraries, ADO.NET, and the rest.

C++ | MVP
Friday, 09 April 2004 14:40:09 (Eastern Daylight Time, UTC-04:00)  #    

On a "no laptop" day at the conference centre, the executives came to talk to us. It's always nice to be told "we like you, we really really like you" and that's what we (the MVPs) heard. I was also pleased with the questions that came from the audience. There's a lot of awareness about deeply technical matters but also business matters such as licensing.

Lunch was with the product groups and I had a fun time listening to other people's questions and asking a few of my own. Our table was supposedly about the new C++ syntax, but I also learned about interop performance improvements (significant) in Whidbey and some nice IDE changes that I hadn't noticed yet.

MVP | C++
Friday, 09 April 2004 14:33:07 (Eastern Daylight Time, UTC-04:00)  #