Kate Gregory argues at CppCon 2015 that C++ should be taught without starting from C: no char* strings, printf or raw arrays at first, with references before pointers.
Why Hacker News points people here: HN people cite it constantly in C versus C++ debates as the case for teaching modern C++ idioms rather than C first.
“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.”HN comment, 2016
“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.”
Argues C++ should not be taught as C with classes.
Full comment
> It's as if you had to be there from the start to have a full image of how the language grew and truly understand the interplay between all the "features", otherwise it's too late to become an expert, and in some cases even too late to become comfortable writing good maintainable code in C++. This is funny to me (not in a condescending way) because I had the exact opposite thought today. I actually came back to C++ on my own fairly recently after learning about the modern version of the language. I was lamenting about how lucky I was to have started learning with C++14 because I didn't have to go through the horrible C++98 and C++03 eras. In fact I could simply ignore most of it. It's all about diving straight into the modern stuff. The biggest problem with learning C++ is that most textbooks, 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". 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 compil
Strongly recommendse12eMay 2016
“Of special relevance is the rather excellent talk by Kate Gregory”
Excellent talk on introducing C++ without the C legacy.
Full comment
I've been spending a few days going through talks from last years cppcon[1]. They're all good, but they've all left me with a strong desire for a strongly opinionated, there-is-no-past-only-the-future introduction to C++14 (and incidentally, C11). I've added a few of those talks I've watched and liked to a small playlist (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"": 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": link makes a pretty good case for simple, modern C++ being clear, easy and efficient. Finally, CppCon 2015: Phil Nash “Test Driven C++ with Catch”: link apart for being a pretty straight forward intro to a simple testing framework, appears to reveal some secrets combining template magic and still get sane compile times (hint: don't recompile more (template) code on every iteration than you need to). There's a couple of good ones that touch on meta-programming too (Look for t
Strongly recommendstialaramexApr 2022
“you should definitely listen to her”
Smart talk by a C++ teacher against starting with C.
Full comment
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. 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 language just cargo cults C. It is almost all of C, plus more... stuff. C++ does not fix any of the worst problems with C, because doing so would risk losing compatibility and hurt Bjarne's adoption story. As a result, with only a handful of exceptions all of that broken garbage is still there . C++ still has the almost useless built-in array type from C, it keeps weird syntax from C that was too hard to ban in the 1970s compiler but you should never use, its built-in types have the same stupid, confusing names like "long" and "double", it has this awful "macro pre-processor" which makes even trivial tooling problems very difficult and set back software quality by at least a decade. Kate's approach avoids teaching beginners about most of this. It's still there, which is bad, but at least you
RecommendsdaeminJan 2016
“For Modern C++ I found this video interesting in regards to the topics she chooses to teach people new to C++.”
Talk on what topics to teach newcomers to modern C++.
Full comment
For Modern C++ I found this video this video interesting in regards to the topics she chooses to teach people new to C++.
RecommendspjmlpMay 2017
“talk at CppCon 2015 explains better than me.”
Explains why to learn C++ idioms rather than C.
Full comment
First 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. 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 Native.
RecommendspjmlpMar 2018
“Some of the Kate Gregory videos,”
Listed among recommended resources for learning modern C++.
Full comment
- 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" - this video "10 Core Guidelines You Need to Start Using Now" - link "It's Complicated" - link
RecommendssimiasOct 2018
“good talk about how we should”
Good talk on why C should not be taught before C++.
Full comment
My point was that I don't think Smalltalk was ever more popular in the industry than C regardless of the time frame. By the mid 90's lisp machines were pretty long gone, betting on Lisp instead of C if employability is the metric seems rather bold. MIPS I concede, it was remained fairly popular for a long time. I guess my overall point is that the subjective choices made by this university back then don't really mean much by now. The fact that they taught Pascal instead of C alone proves that they weren't particularly prescient. >Regarding language comparisons, actually C++ is Italian and C Latin. I thought about that while writing this bad analogy but I couldn't come up with a better one. I wasn't really talking about the historical relationship between C and C++ but rather about their relative complexities. Learning C++ is vastly more complicated than learning 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++): this video I think the opposite holds true as well for very much the same reasons.
RecommendstediousdemiseApr 2021
“Kate Gregory has a good cppcon talk on the topic”
Good talk arguing that C should no longer be taught.
Full comment
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: this video
Cites itpjmlpNov 2016
“That is the path to write unsafe and unidiomatic C++.”
Cited against learning C first for C++.
Full comment
That is the path to write unsafe and unidiomatic C++. CppCon 2015: Kate Gregory “Stop Teaching C" this video
Cites itpjmlpFeb 2018
“C should never be learned on the path of being a good, programming safe conscious C++ programmer.”
Cited for not learning C on the way to C++.
Full comment
C should never be learned on the path of being a good, programming safe conscious C++ programmer. CppCon 2015: Kate Gregory “Stop Teaching C" this video
Cites itpjmlpFeb 2018
“the need being discussing since the last three CppCon, to stop using C style programming in modern C++.”
Cited as part of the push to stop C-style programming in C++.
Full comment
The major issue with C++, is what also helped the language gain market adoption, copy-paste compatibility with most of C89 code. So security conscious C++ developers tend to use enum class , string, vector and 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" - 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.
Cites itpjmlpSep 2018
“the community does try to promote not doing C in C++.”
Cited to show the community promotes avoiding C style in C++.
Full comment
True, but you have missed the part that makes C++ safer than C. - User defined types with invariants - templates, const, constexpr and if constexpr instead of macros - proper string types - proper vector types - type safe enumerations - many implicit conversions in C are compiler errors in C++ - RAII - contracts - generic data structures The iterator invalidation is easy to find out in compilers like Visual C++, their STL implementation can be customized to validate iterator invariants. The danging pointers, use-after-free, use-after-move mentioned by you are the purpose of this proposal. I was an early C++ adopter in 1992, LLVM rejuvenated language research in 2003, DirectX and Metal shaders are a C++ dialect, AUTOSAR has migrated from C to C++14 only two years ago, NVidia GPUs since Volta (2017) are now being designed to run C++ code efficiently. A time frame of about 30 years for C++ to 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" this video
Cites itpjmlpMay 2020
“there is a community that keeps writing C style code in C++”
Cited about C-style code in C++ from outdated teaching.
Full comment
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" this video But what to expect when schools keep using Turbo C++ as teaching tool, link
Cites itnlyMay 2021
“I tend to agree with this talk”
Cited in agreement on how C++ should be taught.
Full comment
For sure, it's a good way to teach that C is insufficient to deal with even the simplest of tasks. Unfortunately teaching has a bad habit of becoming practice, no matter how good the intention. With regard to teaching C++ specifically I tend to agree with this talk: CppCon 2015 - Kate Gregory “Stop Teaching C": this video
Cites itpjmlpJul 2021
“C vs C++ flame wars have been a thing since C++ was born at AT&T.”
Example of C versus C++ debate.
Full comment
Everything that implies taking sides is politics, no matter what. You haven't seen any drama, really? link C vs C++ flame wars have been a thing since C++ was born at AT&T. Since you aren't following up the news, "CppCon 2015: Kate Gregory “Stop Teaching C" this video "We stopped teaching C" link You can find similar stuff from C side, specially if you back in time to GNOME mailing lists, Usenet archives from comp.lang,languagex
Cites itphendrenad2Feb 2022
“In fact at C++ conferences you will see many anti-C talks”
Example of an anti-C talk at C++ conferences.
Full comment
I wonder if the reason for there being no C language conference is: It's generally accepted that C is "dead" or should become dead. In fact at C++ conferences you will see many anti-C talks: * this video And also talks promoting proselytizing to C programmers and bringing them to C++: * link And of course, now, Rust is supposed to supplant C.
Cites itgattrMar 2022
“teaching (the newcomers) C++ constructs first before going through C-era ones”
Related talk about teaching C++ constructs before C-era ones.
Full comment
Somewhat related: [1]. A bit provocative title, but it's actually about "teaching (the newcomers) C++ constructs first before going through C-era ones". [1] CppCon 2015: Kate Gregory “Stop Teaching C" ( this video )
Cites itpjmlpMar 2025
“no one should be learning C as means to learn C++”
Cited against learning C as a path to C++.
Full comment
Since at least C++14, no one should be learning C as means to learn C++, unless they want to keep writing security exploits on regular basis. CppCon 2015: “Stop Teaching C" this video