Skip to content
0:00 / 0:00

#c++#teaching#modernc++

CppCon 2015: Kate Gregory “Stop Teaching C"

CppCon

189K subscribers • 101 videos on Hallway • Conference channel

YouTube
  • Recommended by 8 people: 7 on Hacker News and 1 on Lobsters.
  • A classic. People kept recommending it from 2016 to 2022.
  • Presented by Kate Gregory
  • Linked in the descriptioncppcon/cppcon2015
  • An opinion. It argues one side of a question engineers disagree on.

Intermediate. Assumes working knowledge.

181K views11 years ago8 recommendations

Programming languagesSoftware designC++CDesign patterns

Kate Gregory argues that teaching C++ by starting with C concepts like raw pointers and arrays leads to unsafe and unidiomatic code.

Cppcon.org — Presentation Slides, PDFs, Source Code and other presenter materials are available at: github.com/cppcon/cppcon2015 — To this day most people who set out to help others learn C++ start with "introduction to C" material. I think this actively contributes to bad C++ code in the world. For the past few years I've been teaching C++ (and making suggestions to folks who intend to teach themselves) in an entirely different way. No char* strings, no strlen, strcmp, strcpy, no printf, and no [] arrays. Pointers introduced very late. References before pointers, and polymorphism with references rather than with pointers. Smart pointers as the default pointer with raw pointers (whether from new or &) reserved for times they're needed. Drawing on the Standard Library sooner rather than later, and writing modern C++ from lesson 1. In this session I want to talk about the specific advantages of teaching C++ this way – a way that’s very different from the way you almost certainly learned the language. You’ll be pleasantly surprised to see what you get to leave for later or never cover at all, what bad habits you don't later need to correct, what complicated concepts actually become accessible to beginners, and how you spend a lot less time dictating magic spells you can't explain yet, and more showing someone a comprehensive, sensible, and understandable language. You don't have to be a trainer to come to this session. If you ever mentor other developers and show them your C++ code, if you ever help somebody choose a book or a course or other material to learn from, or even if you occasionally feel bad that you work in a language that's hard to learn, come and see how one philosophical shift can turn that very same language into one that's actually pretty easy to learn! — Kate Gregory has been using C++ since before Microsoft had a C++ compiler. She writes, mentors, codes, and leads projects, in both C++ and .NET, especially for Windows 7 and 8. Kate is a Microsoft Regional Director, a Visual C++ MVP, and has written over a dozen books (the most recent on C++ AMP for Microsoft Press) and speaks at conferences and user groups around the world. Kate develops courses on C++, Visual Studio, and Windows programming for Pluralsight, founded the East of Toronto .NET Users group, and is a member of adjunct faculty at Trent University in Peterborough.Website: gregcons.comTwitter handle: @gregcons — Videos Filmed & Edited by Bash Films: BashFilms.com Work at Hudson River Trading (HRT): tinyurl.com/safxfctf

Why it's here

8 people recommend this

What people say. Highly recommended by C++ developers as a foundational talk on how to teach and learn modern, safe C++ idioms.

autoreleasepoolon Hacker News • Recommends

On “The Landscape of Parallelism in C++ [video]”

…xtbooks, classes, university courses don't actually teach you the real C++ parts until the last 4 weeks of the courses. Instead they teach you "C with classes.. and std::cout". This has been acknowledged as an problem by some of the more prominent members of the committee. I urge you to watch Kate Gregory's talk from cppcon 2015 "Stop Teaching C". link to this video Not only is she a great presenter, but she makes amazing points about what is fundamentally wrong with how C++ is taught in classrooms around the globe. I really hope her talk makes some impact. I know I used to hate the language. That was when I was writing it for my university that for some reason didn't want to upgrade their 2007 gcc com…

e12eon Hacker News • Recommends

On “Why I don't spend time with Modern C++ anymore”

…ist (with a couple of other talks on programming, unrelated - the relevant talks are prefixed with "cppcon 2015"): link The full cppcon playlist is here: link Of special relevance is the rather excellent talk by Kate Gregory on "Stop Teaching C" (when you're supposed to do an intro course to C++): "CppCon 2015: Kate Gregory “Stop Teaching C"": link to this video (But again, I want an open wiki/live tutorial, along the lines of "How I start", but longer, which goes through all this stuff. We really should make one, both for C++14 and for C11). CppCon 2015: Herb Sutter "Writing Good C++14... By Default": link Is also rather uplifting, and: CppCon 2015: Sean Parent "Better Code: Data Structures": [l…

tialaramexon Hacker News • Recommends

On “C++20 Ranges Algorithms – Non-Modifying Operations”

If what you need is C++ (which IMNSHO it is not) then starting with C is a bad idea. Here's Kate Gregory's talk, you should definitely listen to her even if you think I'm an idiot because she actually teaches people C++ and I (thankfully) do not. link to this video Now here's my rant, which is unrelated to Kate's very smart talk: C has an excuse, because it was written in the 1970s for the PDP-11. In the 1970s struct qualifies as a fancy new feature. In the 1970s a wide pointer is very expensive. In the 1970s a linked list is often a good choice of data structure. C++ comes along quite a lot later. These things are already untrue or fast becoming untrue, but rather than risk being unpopular Bjarne's la…

daeminon Hacker News • Recommends

On “} // good to go”

For Modern C++ I found this video link to this video interesting in regards to the topics she chooses to teach people new to C++.

pjmlpon Hacker News • Recommends

On “Coroutines are now in Clang trunk, libc++”

…t of all, and most important one, learn C++ idioms, not C. This means making use of library types for memory allocation, vectors and strings. There is a place for old C style low level features, but those should come later, after the safer concepts are already ingrained. Kate Gregory's “Stop Teaching C" talk at CppCon 2015 explains better than me. link to this video Get a nice IDE, QtCreator, Clion, VC++ Community, KDevelop, XCode. Besides the "Tour of C++", check Stephan T. Lavavej talks at Channel 9. "Core C++ Lectures" link "Advanced STL", these ones only when you already have a good understanding of STL as user link Also check video presentations from NDC, ACCU, CppCon, CppNow and C9 Going Nati…

pjmlpon Hacker News • Recommends

On “Ask HN: Best way to learn modern C++?”

- Tour of C++ ( link ) - Principles and Practice Using C++ ( link ) - From Mathematics to Generic Programming ( link ) - The Scott Meyers books Some of the Bjarne Stroustrup videos, "Learning and Teaching Modern C++" - link Some of the Herb Sutter videos, "Writing Good C++14... By Default" - link "Back to the Basics! Essentials of Modern C++ Style" - link Some of the Kate Gregory videos, "Stop Teaching C" - link to this video "10 Core Guidelines You Need to Start Using Now" - link "It's Complicated" - link

simiason Hacker News • Recommends

On “Teaching C (2016)”

…ning C. On top of that the coding style of a modern C++ application (which generally involves a lot of metaprogramming, OOP and even some functional constructs) is fairly different from a standard C codebase. You don't write C like you write C++ and vice-versa. There's this good talk about how we should "stop teaching C" (if we want to teach C++): link to this video I think the opposite holds true as well for very much the same reasons.…

tediousdemiseon Hacker News • Recommends

On “A simple C implementation to stream H.264 to browser using WebRTC”

I just can’t recommend using it for new code in light of the sexy new alternatives that can compile down to the same binary with source code that’s way more intuitive and readable. I do have nostalgia for C since it was my first language, and I think a lot of people are in the same boat, which is a problem. That’s why I think we need to stop teaching C. Kate Gregory has a good cppcon talk on the topic: link to this video

dpercyon Lobsters • Recommends

Stop Teaching C to C++ beginners > Presentation Slides, PDFs, Source Code and other presenter materials are available at: https://github.com/cppcon/cppcon2015 > > — > > To this day most people who set out to help others learn C++ start with "introduction to C" material. I think this actively contributes to bad C++ code in the world. For the past few years I've been teaching C++ (and making suggestions to folks who intend to teach themselves) in an entirely different way. No char* strings, no strlen, strcmp, strcpy, no print…

u/bames53in r/C_Programming • Mentions

On “C or C++”

…m C to C++, but it's not as straightforward as C giving you a subset of C++ that you should use. Kate Gregory gave a good talk1 some time ago on teaching C++ and how some traditional ways of teaching it aren't very good. It's not really aimed at people wanting to learn C++ though. Rather it's aimed more at people who may be teaching it. 1: link to this video…

u/Wetmelonin r/C_Programming • Mentions

On “Why do universities put so much emphasis on C++?”

Watch this video and it’ll make sense link to this video

pjmlpon Hacker News • Mentions

On “C for Python programmers (2011)”

That is the path to write unsafe and unidiomatic C++. CppCon 2015: Kate Gregory “Stop Teaching C" link to this video

pjmlpon Hacker News • Mentions

On “Why hasn't D started to replace C++”

C should never be learned on the path of being a good, programming safe conscious C++ programmer. CppCon 2015: Kate Gregory “Stop Teaching C" link to this video

pjmlpon Hacker News • Mentions

On “Rust things I miss in C”

…array classes, RAII, iostreams, wrapping data access in classes with invariants,... Developers with more C oriented mindset, tend to just code away like "C with C++ compiler" programming style. Hence the need being discussing since the last three CppCon, to stop using C style programming in modern C++. CppCon 2015: Kate Gregory “Stop Teaching C" - link to this video CppCon 2015: Bjarne Stroustrup “Writing Good C++14” - link CppCon 2017: Bjarne Stroustrup “Learning and Teaching Modern C++” - link Of course, preventing copy-paste compatibility with C, already solves many of those issues from the get go.…

pjmlpon Hacker News • Mentions

On “C++ Lifetime profile v1.0 posted”

…become widespread as it is. I am all for Rust or similar language to replace C++ and do away with C copy-paste culture, but I am not throwing away all my code just because. So yeah, it isn't perfect, but it surely is way better than plain C coding and the community does try to promote not doing C in C++. CppCon 2015: Kate Gregory “Stop Teaching C" link to this video…

pjmlpon Hacker News • Mentions

On “OCaml is Pretty Great (2019)”

Why you see them? Because developers should know better, but there is a community that keeps writing C style code in C++, unfortunately, as their teachers are stuck in the 90's. "CppCon 2015: Kate Gregory “Stop Teaching C" link to this video But what to expect when schools keep using Turbo C++ as teaching tool, link