CppCon 2015: Kate Gregory “Stop Teaching C"

Поділитися
Вставка
  • Опубліковано 12 вер 2024

КОМЕНТАРІ • 419

  • @Spiderboydk
    @Spiderboydk 8 років тому +407

    This comment section is full of defensive C programmers, who completely missed the point of the video. This *isn't* an attack on C.

    • @mikecrapse5285
      @mikecrapse5285 8 років тому +16

      In my university they teach java first, then c++. Although with my major, i.e. not computer science, but instead computer engineering, we learned assembly then C.

    • @Spiderboydk
      @Spiderboydk 8 років тому +3

      Mike Crapse Sounds reasonable.

    • @mikecrapse5285
      @mikecrapse5285 8 років тому +6

      Claus Jensby Madsen While watching this video i was actually surprised that >90% of what she suggested to be taught first in a beginner course is exactly how we learned it.

    • @Spiderboydk
      @Spiderboydk 8 років тому +3

      Mike Crapse That's great. I think she has a good point. :-)

    • @TomaszWota
      @TomaszWota 7 років тому +15

      That sounds great. However, as someone on a few C++ help boards, teaching C++ as if it's 96' and as if C++ is barely C with Classes still seems all too present.

  • @PabloHalpern
    @PabloHalpern 8 років тому +66

    I missed this talk when I was at CppCon '15 and really regretted it. I'm so glad I watched this video. Fantastic material really well presented!

  • @vittorioromeo1
    @vittorioromeo1 9 років тому +238

    Less than 24 hours and already people in the comments are missing the point and being stupid. Is it so difficult to understand that Kate is simply saying to not teach C >> when teaching C++

    • @bonbonpony
      @bonbonpony 6 років тому +8

      Well then why the hell is she wasting her (and our) time for propaganda instead of making a damn good lesson of modern C++? :P

    • @Jack-hd3ov
      @Jack-hd3ov 4 роки тому +8

      You've successfully defused my rage

    • @eddieh7962
      @eddieh7962 2 роки тому +1

      @@bonbonpony she has made many great modern c++ lessons. Check em out

    • @BryanChance
      @BryanChance 2 роки тому

      @@bonbonpony Right on..

    • @surfacing3579
      @surfacing3579 Місяць тому

      @@bonbonpony She's giving a talk at a C++ conference, this isn't a class

  • @coder2k
    @coder2k 4 роки тому +23

    Each and every talk given by Kate Gregory I've seen so far is just amazing and great! Thank you!

  • @EngBandar1
    @EngBandar1 7 років тому +134

    The title is ruining the beauty of this video. It should be Stop using C-Style to start C++ course. She has excellent points.

    • @garychap8384
      @garychap8384 7 років тому +2

      If that was all she'd said... I'd applaud her : )

    • @Blackn3t
      @Blackn3t 5 років тому +21

      Well it has the "CppCon" in the title. That could give you a hint.

    • @EngBandar1
      @EngBandar1 5 років тому +3

      @@Blackn3t may be you need to do more work to make your hint useful.

  • @dennis_johnson
    @dennis_johnson 4 роки тому +20

    Came to realise that I was taught C with classes in high school. Took a while to unlearn so many of those practices.

  • @DieDona
    @DieDona 2 роки тому +21

    Just found out this gem today.
    I'm not a C or C++ Dev, but it really makes me wonder if I ever made things go a little harder or more complex, like when she points out that objects and classes are buried in the 17th chapter.

  • @garethbuxton
    @garethbuxton 6 років тому +36

    This is a fantastic presentation. It should be broadcast far and wide. When teaching C++ don't teach C, that is a different language for a different purpose.

  • @Syke1337
    @Syke1337 7 років тому +180

    I'm glad this turned out to be "Teach C++ if you're going to teach C++" instead of "It's time to let C die." How click-baity of a title though....

    • @joestevenson5568
      @joestevenson5568 4 роки тому +16

      Thats not clickbaity at all. CPP CON makes it pretty damn clear its going to be don't teach C when teaching CPP.

  • @rpmcmurphy2711
    @rpmcmurphy2711 3 роки тому +13

    Great talk as usual Kate, but can't help but feel like you're preaching to the choir here. Recently I sat in on an "Advanced Programming" postgrad course that taught C++ from scratch for people who weren't familiar with C yet. RAII was never even mentioned and smart pointers were introduced on the second last day! (after two weeks of using new and delete and allocating almost all arrays on the heap - that's right, no mention of std::array either...)
    During that lecture, some of the comments from students on the chat were things like:
    "I really don't like smart pointers"
    "Could we do a few use cases of where it would actually make sense to use a smart pointer? I don't see why they're useful"
    "So are unique pointers just pointers for lazy people?"
    Gee, what a great intro to C they got.

  • @seancpp
    @seancpp 6 років тому +39

    I've been programming in C++ for ~10 years and sometimes I still add * and & in suspicious places to get the compiler to stop complaining

    • @ladislavdobrovsky8826
      @ladislavdobrovsky8826 4 роки тому

      that is so sad, however I do it too when learning to use a new library with poor documentation... (looking at you PhysX 4!)

    • @isaklovas
      @isaklovas 3 місяці тому +1

      that means you don't know what you're doing, and the fact that you haven't realized that for 10 years is..... worrying

  • @laurenceperkins7468
    @laurenceperkins7468 3 роки тому +15

    Teaching C first is roughly like teaching Python by starting with how Python bytecode works. There are details down in the guts that will make you a better programmer if you understand them... But unless you're teaching people who want to delve into the nitty-gritty and gain a language-independent understanding of how computers function rather than people who just want to make the lights blink there's no reason to start there.

    • @yash1152
      @yash1152 2 роки тому

      wow, didn't know there was a thing called python bytecode

  • @Gargantupimp
    @Gargantupimp 5 років тому +5

    I don't think she literally means c++ is the language for smart people. She just means that is the reputation it has. When an average programmer hears the word "c++" they think, woah that's way out of my league. Surprised so many commenters missed the point.

    • @skogl8
      @skogl8 5 років тому

      They must be Java developers.

  • @KaranLobana
    @KaranLobana 7 років тому +6

    I completely agree with her, as a high school student who also develops software/web apps, I find it painful how c++ is taught in school. Its c++98 with all the bad parts. The problem is we teach c style c++ rather than c++ itself. Although I had learnt c++14 before , learning c++98 is useless in the modern era

  • @UnicycleBloke
    @UnicycleBloke Рік тому +5

    A great talk. I was self-taught in the early 90s, from a book. I feel fortunate that the author put a great emphasis on the value of RAII for non-memory resources such as Win32 window handles. It is arguably the most important idiom in the language, and could easily be presented on Day 1 or 2 or a course.

  • @knife_wizard
    @knife_wizard 7 років тому +51

    This almost makes me want to give C++ another try. I know for a fact I was taught C++ terribly, I tried learning on 3 separate occasions. Finally got it enough to make stuff work when there was a grade tied to it, but it started as a lot of voodoo, a lot of comparisons to Java that just didn't work, and a lot of "Why is this so much easier in every other language?" I had to learn RUST to really understand C++, and now I almost want to give it another go. Almost.

  • @AustinSteingrube
    @AustinSteingrube 3 роки тому +6

    I appreciate where Kate is coming from, but I think it is important to note that “ignoring” C while teaching C++ also ignores what is happening behind the scenes. I’ve met quite a few developers that utilize the standard C++ library and treat calls to it like atomic operations. Just because the interface is simpler doesn’t mean it is faster or better.
    For desktop applications, the small amount of overhead for something like the C++ string type is not an issue. But, should you find yourself doing driver-level code, RTOS applications, and embedded systems, understanding what is actually going on is crucial. I’ve met a large number of folks that can’t understand how pointers work let alone memory accesses and things like temporal locality and caching because they never learned the absolute base.
    While teaching C++ first is useful for bootcamps and kids, I’d argue that actually learning the language and how to use it well requires extensive knowledge of C. Even things like lambdas or references make little sense unless you understand why they are incredibly useful at a primordial level and the find out through horrible design patterns and crashes why we love them.

  • @andrewholmgren4912
    @andrewholmgren4912 7 років тому +49

    Good talk, this is absolutely how C++ should be taught and (as far as I know) is not. I was one of the people that was taught C++ more as C. Having now learned C++ somewhat properly, I have come to the same conclusions as Kate. References should be introduced before pointers, who cares about arrays *as a starting point* (should use vectors), standard library is just that -- a library of standard things you can use so teach people like that. All the other stuff should go later (new/delete, unique ptrs, etc.) as the advanced under the hood stuff you care about when you get to it.
    My analog (as a physicist by training), to the way I was taught C++, is like starting a course on classical mechanics by teaching about a rod rolling down a ramp by starting with inertia, moving to friction, and then being like by the way there's some kinematic equations that describe a lot of movements that you haven't learned yet. Why the hell are programmers teaching "ramp physics" for a mechanics course when they should be starting with kinematics?

    • @groszak1
      @groszak1 3 роки тому +2

      Arrays and vectors are very different and which one should be used depends on the usecase like with any two different concepts.

    • @unholylatency
      @unholylatency 2 роки тому +1

      Python/C programmer here who's been picking up "modern" C++, i.e. writing for C++14 [1] and above, for both work and play. I learned C first before learning C++, and definitely very early on realized how wrong it would be to take the "C with classes" approach. Totally different design decisions and methods of solution should be considered in C++. And yes, barring special circumstances, why would I ever want to stress about null-terminated strings when std::string exists? Similarly, why not avoid malloc/free, or new/delete, if I can use std::shared_ptr? I have namespaces, I'm going to stop doing the "my_namespace_my_actual_function_name" thing I am forced to do in C.
      [1] At work, a good part of our library uses stuff deprecated in C++14, removed in C++17, and I don't have the power to make those sweeping changes atm.

  • @sera_kath
    @sera_kath 2 роки тому +3

    I know C++ for about 4-5 years at this point but I attend the C++ course at university nonetheless. I was curious how it would be tought (and to get a good grade easily :D).
    I'm suprised how well the teacher is teaching it. We don't bother talking about C. We have a lecture a week and directly dived into C++.
    1) Basics and +
    2) Classes
    3) exeptions and std::string
    We did algorithms, containers, simple templates (and auto) and also some basic SFML.
    We will maybe look at C at the end if we have a week or two left.

  • @bunpasi
    @bunpasi 2 роки тому +4

    I noticed that more and more people start talking about how difficult C++ is without having any real experience in it. Can you really blame them?! I was thinking about starting my own course on UA-cam because of this. I'm very happy that I came across this video. There are a lot of points I'd love to implement. THANK YOU!!

  • @ZombieLincoln666
    @ZombieLincoln666 3 роки тому +5

    ignoring the people who think this is an attack on C, this is a FANTASTIC talk! She clearly has a ton of experience teaching C++, and thus has helped my own self-education in C++
    It’s especially relevant now that C++11, 14, 17 and C++20 which are much easier to learn.

  • @thedrunkmonkshow
    @thedrunkmonkshow 17 днів тому

    This was an interesting talk even almost 9 years ago from today. Everything she described is how C++ was taught when I first got introduced to it in the 90's. It seems hard to imagine now but in 1997 the language was just a little over 10 years old and viewed as simply an extension of C or C with classes. Whether it was programming books you bought off the shelf, reading blogs, or internet websites that did speak about it that was super common place. Since I couldn't afford to buy Visual C++ outright as a teenager the only alternative I had was Turbo C++ for MSDOS and Borland C++ for Windows 95 that were included on a CD with the books I purchased. Things that seem trivial now like IntelliSense wasn't a thing yet in C++ unlike QBasic and Visual Basic so it was a nightmare as a newbie back then and we all know how frustrating reading compiler errors can be. I'm still now 100% brushed up on all the new features and conventions but yeah it doesn't make sense to teach that early on especially if there's better alternatives now.

  • @KurtSchwind
    @KurtSchwind 7 років тому +31

    Funny to read the whiny comments about why C is important. This is about intro to programming. Not "Never teach C or other low level things" again.

  • @AlexanderRevo
    @AlexanderRevo 8 років тому +32

    Great talk. You barely need pointers, manual iteration and built-in arrays/char arrays anyway if you write C++ according to current standard of what is good. It actually makes a lot of sense to teach that stuff as advanced stuff later in the course, rather than, for example, begin by teaching for(int i=0; i < n; ++i) and THEN present a range-based for loop and std algorithms as an advanced topic, when it should be the other way around.

    • @erbgegegerger8220
      @erbgegegerger8220 8 років тому +9

      +Alexander Rev "You barely need pointers, manual iteration and built-in arrays/char arrays " actually I need them all the time.

    • @kwanarchive
      @kwanarchive 8 років тому +6

      Then you're doing it wrong. Your manual iteration would probably be handled by one of the algorithms.

    • @erbgegegerger8220
      @erbgegegerger8220 8 років тому +3

      +Patrick Proctor Lets assume what you said were true. C's still more beautiful. C++ is bloated and compilers are expensive (if even available).

    • @Greamzih
      @Greamzih 8 років тому +3

      In my opinion, one absolutely has to know about arrays and pointers (what they are and how to use), but there is a good chance that they will never use them after graduation. Sadly different people think a little bit differently and different order makes sense to them. You might prefer to see some magic like a range based for loop and then learn how it works (an array and a pointer). Nothing is wrong with that. I prefer the other way round - basics first then derived things. It's a matter of taste. However, If somebody taught you pointers you can easily learn STL containers yourself. If somebody taught you STL containers first, they then have a better chance of getting more money for teaching pointers.
      The point I'm trying to make is that there is no a universal way to teach anything. A teacher always has to compromise with the individualities of his students.

    • @gnaggnoyil
      @gnaggnoyil 7 років тому +5

      A language that has a concept called pointer which can do 4 different kinds of stuffs with none of them being done well is considered beautiful by users who thinks one utility should do only one kind of stuff, well and specialized. That sounds really funny LOL.

  • @KitsuneAlex
    @KitsuneAlex 3 роки тому +8

    What an amazing talk, glad i am now watching all the archived ones :)

    • @CppCon
      @CppCon  3 роки тому +1

      Glad you like them!

  • @crogersdev
    @crogersdev 4 роки тому +7

    I love reading Kate's answers on SO. She is really excellent at teaching.

    • @yash1152
      @yash1152 2 роки тому

      thanks for mentioning that she's on SO

    • @KFlorent13
      @KFlorent13 Рік тому

      @@yash1152 What is SO ?

    • @cxmu0391
      @cxmu0391 Рік тому

      ​@@KFlorent13StackOverflow

    • @VanThanh-ri6vs
      @VanThanh-ri6vs Рік тому

      @@KFlorent13 probably StackOverflow

  • @garethbuxton
    @garethbuxton 6 років тому +8

    There seem to be a lot of comments in this thread from people who do not like C++. I wonder how many of them dislike the language so much because they were taught exactly the same way that Kate says to avoid?

  • @BiddutMitra
    @BiddutMitra Рік тому +2

    Her book practically taught me Socket. Thank you.
    Thank you was due for 20+ years.

  • @Leo31Par
    @Leo31Par 8 років тому +25

    WOW! That actually applies to a lot of subjects! I can imagine reshuffling a lot of stuff in Robotics and Control Theory from roughly the same perspective

  • @heinsaar
    @heinsaar 8 років тому +18

    Excellent points - all long overdue. Many thanks, Kate.

  • @disk0__
    @disk0__ 7 років тому +50

    >start teaching C++ instead of C when teaching C++
    >people become proficient and understand concepts without resentment or needing to learn javashit first
    >break down the concepts they learned into the original C building blocks if (when) it becomes relevant so people have an enriched perspective and more options when needed
    I fail to see why this is an issue

    • @qwertyman1511
      @qwertyman1511 6 років тому +2

      that was her answer, not the problem.

    • @sangeeth96
      @sangeeth96 6 років тому +9

      Because once someone learns to do it using 10 lines in C, they tend to keep doing it regardless of the fact that there exists a better, shorter and faster abstraction that does it in C++. This leads to annoying and hard to find bugs and a lot of unnecessary boilerplate + implementation-leakage which makes maintainability hard.
      C is important but you simply shouldn't learn C++ by learning C.

  • @AG-ld6rv
    @AG-ld6rv Рік тому +2

    I really liked the book Accelerated C++. Unfortunately, it's not updated with all the newest stuff last I heard, but it had a strong emphasis on jumping straight into stuff like iterators and . With that being said, I think it's all right to teach iterators to newbies a little earlier than recommended. It's essential when using functions that return iterators. I'd also disagree with not teaching bit/byte stuff as a course on a low-level language is precisely when you get that exposure, and interviewers sometimes 100% ask quick questions like that unfortunately (the interview process is largely defined by the software developers where I've worked, so there isn't much standardization other than "ask about data structures and algorithms" and some developers feel like not knowing the number of bits in a char translates into a hard no). I agree with most of the other stuff. I'm a little uncomfortable simply not introducing stuff like C-style arrays and strings. I think there's enough time to throw that in near the end. It has three benefits: 1.) Like she mentioned, they have a decent chance of running into that crap in the wild and 2.) It's a nice point where you can say, "Now, aren't you glad you get to write C++ instead of C for a C++ compiler?". 3.) I worry some interviewers might actually do what she joked they wouldn't do: Give a hard pass to a new hire for not knowing some fundamental facts like null-terminated strings exist. You'd be surprised the questions some people will ask to try to gauge whether they're dealing with someone with strong understandings.

  • @vikram90ful
    @vikram90ful 5 років тому +21

    True :) First time I wrote my C++ program in industry , my managers reply was you are writing C in c++

  • @markcooke4866
    @markcooke4866 3 роки тому +2

    I agree wholeheartedly. You don't teach C before C# or Java, yet both of those languages draw as much from C as C++ does.

  • @iitalics
    @iitalics 7 років тому +11

    I'm not usually persuaded by talks on the internet but this honestly has convinced me that the C -> C++ way of teaching C++ really is counterproductive. Great talk, great points. Would have loved to have been taught C++ this way.

  • @kwanarchive
    @kwanarchive 9 років тому +4

    If you like Rust, then like it. The existence of people who actually like C++ and what it's become does not affect your enjoyment of Rust in any way.

  • @CapiEtheriel
    @CapiEtheriel 4 місяці тому

    today i learned "in day one there is going to be magic". it is a valuable lesson.

  • @tarasov9794
    @tarasov9794 4 роки тому +3

    The title is so spicy (excellent PR). Don't jump to conclusions -- you're above that. Sincerely, C fanboy.

  • @cepi24
    @cepi24 7 років тому +8

    Is there any C++ course/tutorial/book (by Kate Gregory) which is taught by those recommendations?

    • @jonastoth7975
      @jonastoth7975 7 років тому +4

      cepi24 a tour of c++, Bjarne stroustop. the last name is wrong for sure xD

    • @cepi24
      @cepi24 7 років тому

      Thanks, I will check. Is there also some resources which explains c++ from under the hood principles. I mean how the objects looks in assembler, stack, heap, etc. Thanks

    • @gottlobfrege5784
      @gottlobfrege5784 5 років тому

      You can find courses by Kate Gregory on pluralsight - www.pluralsight.com/authors/kate-gregory but I don't know of any non-online courses/books.

  • @paulapappelbaum6983
    @paulapappelbaum6983 5 місяців тому

    Thank you for the talk, Kate! It helped me a lot to understand the different needs of people who learn contemporary C++.

  • @lin2jack2
    @lin2jack2 5 років тому +4

    C and C++ are different language, stop teaching C++ as super set of C .

  • @kingpic
    @kingpic 2 роки тому +4

    This should be titled: "Stop Teaching C, if you are trying to teach C++". Great talk though!

    • @masheroz
      @masheroz Рік тому +1

      You could have guessed that from the oconference she was presenting at.

  • @craigbryant3191
    @craigbryant3191 5 років тому +26

    That feeling when you agree with everything in a presentation except the title...

  • @obiwankenobe3962
    @obiwankenobe3962 8 років тому +7

    Excellent presentation. However, if your goal is merely not to scare beginners away from programming, you shouldn't be teaching them C++.
    Here's what I learned over the years: C++ devs divide into two groups:
    - hackers. They use C++ to write high-level C, they optimise and play with templates, refs and pointers for fun
    - application devs. They just want to get their job done. They should have been Java devs
    Kate's suggestions are fine for teaching the 2nd group. 1st group can handle C.

  • @qing1513
    @qing1513 5 років тому +2

    This is a great talk! There has been so little voice or attention caring about how to teach people a language in a easy and friendly way. This is actually quite important as we all just like simple easy things and hate being bothered by hard to understand things. Otherwise we easily lose the patience. I believe this speaker is a good teacher and should be a pleasant to take her courses.

  • @MsSomeonenew
    @MsSomeonenew 8 років тому +25

    It is always amazing how much backwards thinking remains in one of the most advanced sciences, I went through programming courses near 10 years ago and it was pretty much the same mindset of "burn them with hell-fire until they make it... or they quit".
    Meanwhile every other field understands a gradual introduction has far greater success in teaching people how things work.

    • @AcceleratingUniverse
      @AcceleratingUniverse 8 років тому +9

      yeah that's why electrical and chemical engineering start off SO easy right

  • @rafaelmoura8688
    @rafaelmoura8688 8 років тому +8

    I feel the same way, learning C first helped me to make mistakes. Mistakes helped me to learn how fix code, how to be careful... The more I learned C the more I understood how the hardware works with our code. Then I learned C++, OOP, RAII , STL, LAMBDAS, TEMPLATES etc...(the C background made this things easy) And even learning C# , javascript and others.. today, I love to go back to even assembly(when igot time) cuz I love to understand how the computer works in both hardware and software.

    • @TomaszWota
      @TomaszWota 7 років тому +12

      How many years did that take though? She's talking about introductory course to C++, which may or may not mean also an intro to programming, and may also mean a bootcamp course that takes say two to three weeks, and proposes a way of streamlining the process. Nobody is arguing you shouldn't learn pointers (you most certainly should!) and other things in common with C that are however less idiomatic to modern C++. It's just - you probably shouldn't start with it.
      I agree with her in that torturing the student with raw arrays and pointers and C library string functions at the beginning is just that - torturing them for the sake of showing off how intelligent and smart YOU must be that you know it... They already have enough on their plate - they learn how to structure their thought, how to translate intent into an algorithm, how data structures work, how to use both of those together - in a particular environment and syntax of a particular language - to solve a problem... You really don't need to throw at them even more stuff to remember like printf format strings, manual memory management, indirection levels, etc. You can teach them that later on when they form some kind of programming intuition, when they actually start to get stuff done, are motivated by early successes and not bogged down by early failures. That may be at the end of your course, or at the "Intermediate" course that follows, either way - it shouldn't be neglected for sure. The point is really that it shouldn't be shoved in their faces when they are biting a pretty big cookie already.
      I think she has the right idea.
      You might ask - why not teach them Python first, then? And I'd say - sure! If you have the choice - do so! Python is fun too. But people are usually not there at the bootcamps on a whim but because they need to be there, because the company paid for it, because the company is bought some code base and needs to get them up to speed, because whatever. I'd say the case for Python or some other language as the first beginner language is pretty strong, however - I don't think C++14 as the first language is all that bad either, with a good teacher that cares and understands that it shouldn't be taught as if it's C first, and then "some features ++".

  • @blendertammer678
    @blendertammer678 6 років тому +9

    Solution: everyone learns assembly

  • @ABaumstumpf
    @ABaumstumpf Рік тому +1

    At university we started with C for half a year before going to C++ ... good thing that i started learning C++ year before without even knowing what it is called (as part of a game that allowed you to make modifications without setting up a compiler or anything like that). Worst of all - they didn't even really teach you how to write half-way decent C and instead were more focused on their style-guide. Having a gigantic memory-leak or undefined behaviour was counted as just 1 point reduction in the scoring, the same way as having 1 singular space indentation wrong. They went on and on about malloc, free, heap and stack, then it went towards implementing double-linked lists and sorting them..... In C++ they then with Void* arrays and UML diagrams ... i really didn't learn anything about programming from the university.
    Your approach seems way way better than that.
    Also Lambdas? Yeah, they are great, but god damn it is the syntax of C++ getting worse with every iteration. Function-pointers were bad enough, Lambdas make it just a bit shorter but no less cryptic. And now several years later it is getting much much worse, with proposals for reflection that want to introduce more new operators, with proposals for adding new semantics that are nearly identical to the idea of the switch-case but every little detail being just slightly different. New features are getting so much worse that we are now actively discouraging their use. It is getting worse than the old printf/malloc/char* problems.

  • @unclelindsey2068
    @unclelindsey2068 8 років тому +73

    Totally agree! Now, let me get back to figuring out what caused that 200-page error message. /s

    • @rock00dom
      @rock00dom 8 років тому +16

      Hehe, I have to put my love for C++ aside and give a thumbs up!

    • @AdityaKashi
      @AdityaKashi 7 років тому +1

      Hahaha!! Really good one.

    • @TankdozerCavalry
      @TankdozerCavalry 5 років тому +1

      I heard GCC 9 will have better error messages (about time).
      clang's error messages are already pretty dope, and that's what I use when I can't figure out what gcc is trying to tell me.
      But yeah, I think everyone knows your pain, Lindsey.

  • @mattp1337
    @mattp1337 3 роки тому +1

    As someone who took three C++ courses in college 20 years ago (and got at least B grades), but came away not knowing enough to do anything useful or fun with it, I wish modern C++ had existed then and that I'd been taught in this way. It was intellectually satisfying, but being able (in principal) to read library code or bare metal pointer voodoo had no practical use and all that effort was largely for naught. After three courses.
    Now that I know that modern C++ exists, maybe I'll make the effort to dive back into it.

  • @peppybocan
    @peppybocan 9 років тому +4

    Unless compilers can print out some reasonable error messages caused by templates madness, there's no way, you can teach children how to repair their code, sometimes even mature programmers cannot.

  • @christopherguy1217
    @christopherguy1217 7 років тому +9

    Wow, someone finally gets it and is doing something about it! I've seen so much C++ compiled C code that I've come to the opinion that only the expert programmers should be touching C++ and beginners should be starting with an easy language like C#.
    In fact in many respects modern C++ is finally catching up to languages such as Java and C# and is greatly hampered by its C legacy. I also started in C long before C++ existed and sampled early "compilers" that just translated the C++ to C before compiling with the C compiler that was installed.
    I still think that the language too flexible and split between old and new that it is much too easy for beginners to get themselves in to trouble. My preference is to get them going with C# and develop their skills writing their own code or contributing to the group effort before going to C++ because in the real world beginners Google to solve their coding problems and there is way too much poor C++ and old code on the web.

    • @garychap8384
      @garychap8384 7 років тому +2

      Actually, by making it easier ... you churn out programmers who aren't engineers, can't code for nuts and have literally no aptitude for the job.
      I know... because for the last 2 decades I've been the poor bastard senior programmer that has to find a graduate worth hiring out of all the sad cases HR send my way. It gets harder every year.

    • @unholylatency
      @unholylatency 2 роки тому

      @@garychap8384 I don't think making a learning process easier is bad in itself. Having learned C before C++, nowadays (C++11 and later) trying to take the "C with classes" approach ends up teaching C++ antipatterns that makes the learning process more frustrating AND makes worse C++ programmers, because they aren't aware of and aren't using the right language features for the task at hand. C and C++ really should be considered two different beasts, and although the C legacy of C++ shouldn't be discarded (definitely times and places for using raw pointers and macros), C-isms should not NOT be the first choice when taking a C++ approach to a problem.

    • @yash1152
      @yash1152 2 роки тому

      > _"by making it easier"_
      @@garychap8384 well, nice point raise. but there's a difference in "making it easier to learn" and "zucking up with the rigour of the subject to brush past it fast" - a subject can be made easier while still maintaining its rigour imo.

  • @Atameow
    @Atameow 6 років тому +2

    So what should completely new beginners to c++ and programming do to learn C++? Is there a book that would fit this criteria of learning c++ the right way?

  • @george_763
    @george_763 7 років тому +10

    So much drivel floating round in these comments. The point of the talk is not to suggest that C should not be taught, nor even to suggest that C should not be taught alongside C++, but rather that it should not be taught as C++. C++ provides many beautiful abstractions in the standard library as well as the tools to easily create more. The purposes of C and C++ are very different and it's plain stupid ( most of the time ) to be using a C++ compiler and write code as if it were C, akin to buying your dream sports car with all the bells and whistles and still just sticking to your prius whenever you need to go out.

  • @tomaszstanislawski457
    @tomaszstanislawski457 2 роки тому +1

    It looks like trying to teach student Python, when C++ is not Python. The presented approach will make the ritual of passage happen later on, making them even more painful because they have to unlearn the the simplistic view of what is really happening. Sooner or later some will take a reference to an element of the vector, do `push_back()` and will be very very confused. This approach could be good if abstractions in C++ did not leak so much.

  • @lukagovedic9681
    @lukagovedic9681 2 роки тому +2

    My favorite quote: "They don't need the long diversion about what it took to get us here, just show them how to manipulate some strings"

  • @PascalSommerMovies
    @PascalSommerMovies 6 років тому +3

    *controversial opinion:* you can learn about how the cpu works without learning c first... most if not all of the stuff that's relevant to us programmers can be explained in c++. and please all you c programmes stop pretending like you know how ALL of the cpu works because you don't. Noone knows how all of the cpu works, so we all just have our chosen level of abstraction on which we work, and if you maybe ask someone who knows a different subset of how the cpu works, they might do it slightly different, but i guess that's ok

    • @jean-naymar602
      @jean-naymar602 5 років тому +1

      "Noone knows how all of the cpu works"
      lol ? Not even the guys that... idk... manufactured it ?
      How a CPU works is not hard to understand at all... So yeah... PLENTY of people understand precisely how a CPU works... wdym ?

  • @mc4ndr3
    @mc4ndr3 3 роки тому +5

    Preach, Kate! We've only just begun to discover how to teach programming effectively. There is so much low hanging fruit for educating C++, or any language, better!

  • @JiveDadson
    @JiveDadson 6 років тому +17

    Hear, hear! A scary number of first questions on StackOverflow deal with new and delete and no RAII. More often than not they are implementing a linked list. They can only be getting that from their instructors.

  • @cc.jsullivan
    @cc.jsullivan 6 років тому +6

    I loved this talk, I really gotta talk to my professors about the intro courses. The farthest our 201 course will get is maybe classes, thanks to the fact that we're still using a lot of the C conventions. Would be really nice to start with for collections.

  • @youonlymemetwice2365
    @youonlymemetwice2365 8 років тому +11

    Yeah I think I agree with the sentiment that you shouldn't start teaching C++ with C necessarily. We've had about 20 years of standard C++, and in that time it would be a bit sad if we were still teaching C++ in the same way by now, as if we hadn't learnt anything about how to teach C++.
    Hate the tone of this talk though. Feel like I'm being shouted at the whole time. Constantly whining about what's "fair", "nice", "fun" or whatever. Would have preferred a much more chilled talk.

  • @jamcdonald120
    @jamcdonald120 2 роки тому +1

    16:15 I love it, skip completely and go to

  • @Anyone700
    @Anyone700 6 років тому +6

    Where is this one day intro to c++ you keep talking about?

  • @saulo2264
    @saulo2264 5 років тому +2

    I know C, I know ARM, I know Java and I can't wait to get into C++. It seems like the perfect language. Plus the amount of C++ jobs are insane.

    • @themohmand
      @themohmand Рік тому

      (Almost) all the embedded software jobs here (Denmark) require expertise in C. Although I like the idea of stepping into the C++ realm but the market requirements keep me from doing it (although I still like learning a thing or two about it here and there)

  • @saurabh75prakash
    @saurabh75prakash 5 років тому +3

    I was looking for something like this, thanks!

  • @Kazdro009
    @Kazdro009 5 років тому +4

    After watching this I guess I should turn C/C++ in my CV into just C ... I guess I have overslept whole recent development of C++

  • @RupertReynolds1962
    @RupertReynolds1962 2 роки тому

    This is gold.
    When I was trying to learn C++, I was working on old code which mixed 'C' with C++, and in different ways from one function to the next. Messy, and time wasting for me. It put me off C++ at a time when it was evolving into something better.

  • @alilhard
    @alilhard 4 роки тому +7

    The whole printf thing had me laugh a bit when I remembered how it was for me. The first year I learned programming in school we only learnt C and we were forbidden to use printf in all our projects, instead we wrote our own putc and putstr with write and later on wrote our own printf (added bonus of little to no confusion when we had to write to a file). While we were doing that people who went in another school spent something like 2 weeks learning printf and while it's nice to know how to use it I think it's a waste spending so long learning how to use it while not learning about varargs, pointers and type casting when it's used to learn C. And then again if the objective isn't to learn C, why bother spending so long on something that you only use to get outputs.
    In the school I went to after, we first learned C as an introduction to programming (basic syntax and pointers though no allocation over 20 something hours) and then spent almost all our time learning and coding in Java (as an aside it's quite tricky remembering to new everything in Java when you learned C++ because you're like "why though ? It's just a stuff I use here and I don't want to allocate memory to it, I just need some temp that'll disappear once my function ends") and what most remembered was they had to learn C for no reason and it was pretty hard and confusing.

  • @friedrichdergroe9664
    @friedrichdergroe9664 6 років тому +6

    Teach C++17, even. No point in teaching 20-year-old C++ first. Seriously. The thinking one does today with std:: and all the new features of C++17 is lightyears ahead of what C++ was 20 years ago.

  • @soulstudiosmusic
    @soulstudiosmusic 8 років тому +45

    Fantastic talk, great for teachers.

    • @RoamingAdhocrat
      @RoamingAdhocrat 6 років тому

      And code sample writers, and folk on StackOverflow, and… :)

  • @JonWoo
    @JonWoo 7 років тому +4

    Great advice on how to teach coding in general

  • @RussTeeTrombone
    @RussTeeTrombone 4 роки тому +6

    Such an awesome talk. The college i attended was SO very guilty of all this and dissuaded so many students from having any desire to program in cpp

  • @0011usagi
    @0011usagi 8 років тому +15

    Interesting insight about exploiting what people "get" instinctively to be able to more quickly focus on the interesting parts.

  • @vionel3493
    @vionel3493 5 років тому +4

    Kate is supernova. Great lecture.

  • @knofi7052
    @knofi7052 Рік тому +5

    I think, it's much better teaching C and stop teaching C++ afterwards.

  • @mitchlaber7723
    @mitchlaber7723 6 років тому +4

    If I could convince my school to stop teaching C as if it was the basics for C++ I might continue teaching. I have no authority in the department. Perhaps someone with authority could write my chairman?

  • @audigex
    @audigex 9 років тому +2

    I don't care what the CPU does... genuinely. I do understand it, but I've never worked in an area that needs that understanding, and I have no intention of doing so. Don't get me wrong, I think we still need to teach it to an extent, but most people are writing applications well above the hardware level now, and with good reason... we're user-centric.

  • @walter0bz
    @walter0bz 9 років тому +3

    >>" (macros are cool, but not a replacement for C++'s turing-complete templates)"
    heh. hence it's undecidable if a C++ program can compile (halting problem)

  • @zhulikkulik
    @zhulikkulik 11 місяців тому +1

    Funny thing is - I never thought in terms of objects.
    Procedural is the way I naturally think so I had lots of struggle with unity and c# and later c++.
    So much struggle that I had to go on and actually write a program that displayed a spinning cube in C and opengl before I got back to learning c++

  • @vittorioromeo1
    @vittorioromeo1 9 років тому +3

    ...makes me choose C++14 over Rust.
    But the real point I'm trying to make here is that if I write modern and clear C++14, I have no need for Rust's safety and syntax.
    Writing modern C++14, and not a C/C++ hybrid, results in safe and clear code. (Writing correct C++14 is seriously not that hard, people.)
    "Suboptimal syntax" is subjective - I think C++'s syntax is pretty good considering all the retrocompatibility.
    Header files will be "fixed" by modules eventually, but people have been using

  • @JiveDadson
    @JiveDadson 6 років тому +2

    Are there any teachers watching who were directed to this site by students?

    • @edgeeffect
      @edgeeffect 3 роки тому

      That would be so cool!

  • @barryblack8332
    @barryblack8332 8 місяців тому

    Why did i enjoy this so much and am not even a c++ developer.
    Still applies to other languages abit.

  • @mattf9076
    @mattf9076 7 місяців тому

    Does a course exist that follow these guidelines?

  • @hl2mukkel
    @hl2mukkel 8 років тому +5

    Good points!

  • @debrucey
    @debrucey 7 років тому +1

    I like the sound of what she's saying, she seems like a good teacher. Can anyone recommend a book/tutorial that follows the approach she's suggesting here?

    • @JoseRodriguez-wh2eu
      @JoseRodriguez-wh2eu 7 років тому

      She has a few courses on Puralsight.com. The range from beginner to intermediate. I personally think she is a fantastic instructor.

    • @hondacivet
      @hondacivet 7 років тому +1

      C++ Primer (NOT Primer Plus) by Lippmann and Lajoie are highly recommended and teach to this method AFAIK.

  • @travelmaltaculture
    @travelmaltaculture 3 роки тому +1

    I wish I could have done this when I used to teach C/C++. I was forced to teach C when I wanted to do something like this, some years ago. Now they learn C# instead...

  • @yutubl
    @yutubl 2 роки тому

    This is an excellent teaching order advice! I think that raw C was never (intended to be) the best programming language for beginners and everyone programming rarely not knowing general programming best practices and worst traps and have developed failure aware programming skills like anti patterns or anti idioms.
    My first information about C++ 1990 was a 3 page article explaining classes for more type safety especially string template class which reduce pressure needing to use raw pointers for zero-terminated C-string buffers, which was a direction sign for me that I like that language over C. At that time I already knew BASIC (1984), Assembler (1985 6510, later 8085, 68000, 8086), FORTRAN (1986 FIV and F77), Turbo Pascal (1988 v4, v5.5 with classes and objects 1989), C (1988).
    Today I think most beginners may choose JavaScript or Python as an easy entry into programming.

  • @yash1152
    @yash1152 2 роки тому

    24:40 i couldn't hear what the question was. and can't understand the meaning of what her answer, can anyone rephrase?

    • @greyfade
      @greyfade 5 місяців тому

      He said, "That violates DRY. Just say auto." He's pointing out that you don't need to repeat the types, and she's pointing out that this is about teaching the student the syntax, and then we can go around dropping auto everywhere.

  • @LaurentLaborde
    @LaurentLaborde 2 роки тому +1

    6:23 Well... Fortran DO HAVE objects so you could teach object using fortran :D

  • @codonbyte
    @codonbyte 2 роки тому

    Wait, there are people who DEFEND printf?

  • @andik70
    @andik70 8 років тому +1

    39:35 'so this is the rule of 3 711 52 0'. What does she mean by this?

    • @PabloHalpern
      @PabloHalpern 8 років тому +4

      +andik70 There are a number of "rules" that style mongers like Scott Meyers promote that encourage programmers to put certain members into their class. For example, the rule of 3: copy-constructor, destructor, assignment operator; the rule of 5 adds the move constructor and move-assignment operator. The rule of zero removes all of them and lets the compiler define them for you -- usually good if your class has no raw pointers or unique_ptrs. The other numbers are just made up because so many authors, bloggers, and c++ pundits have created their own variations on these rules. See en.cppreference.com/w/cpp/language/rule_of_three

    • @Evan490BC
      @Evan490BC 8 років тому

      +Pablo Halpern The rules may be "made up", as you're saying, but they are now an intrinsic part of the common C++ community knowledge, and they actually make a lot of sense...

    • @PabloHalpern
      @PabloHalpern 8 років тому

      +Evan490BC You missed my use of the word "other". The rules of 3, 5, and 0 are all part of common community knowledge and do make a lot of sense, but there is no rule of 11 or 52 that I'm aware of. Kate made these numbers up on the spot, kind of like saying "etcetera".

    • @Evan490BC
      @Evan490BC 8 років тому

      +Pablo Halpern Right, yes. I see what you mean.

  • @audigex
    @audigex 9 років тому +1

    I couldn't agree more, but is it scaring anyone else that we have to say things like this? Almost like programming languages are becoming religions, rather than tools.

  • @walter0bz
    @walter0bz 9 років тому

    the reason for C++ is legacy code?
    how much code is in the new style?
    if its all about a new style .. why not a new language that makes the new style easier

  • @kwanarchive
    @kwanarchive 9 років тому +4

    No, even powerhouses like CERN use modern C++. Truly, modern C++ is even faster than C.

  • @PanduPoluan
    @PanduPoluan 7 місяців тому

    Now I really want to take a C++ course/tutorial that just teaches C++ and not C (or C-ism)...

  • @FingersBlazin
    @FingersBlazin 7 років тому +1

    Too much C++ looks like {print f ("Hello World") } Rather than { cout >> "Hello World" } I have books that don't even teach cout and just add classes and objects, etc to plain c. Either will work, because any C++ compiler also accepts C, but it leads to a lot of confusion. I like to keep the two in my mind separate. However, since a lot of people programming in C++ were taught to just add objects and classes to C, to sustain code out there a lot of people will need to know both C and C++. When it is asked for as a skill on most job listings, they are almost always put together. It is taking me a lot longer to learn C++ than C, so getting a good basic understanding of C doesn't take that much time. I recommend learning both but keeping them separate in programming and in your mind. But yeah, at some point you will probably have to maintain code that is a mishmash of both.

    • @george_763
      @george_763 7 років тому

      Hate to be the pedant but `printf ("Hello World")` is very poor form in C as well, if "Hello World" is really just a variable that'll decay to a char* and that char* happens to point to a c string that happens to contain a format specifier then ub is invoked. Also, printf is significantly faster than cin, and I personally think that it's totally fine to use it in C++ code. And lastly, "I have books that don't even teach cout and just add classes and objects, etc to plain c", you should really take a look at stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list

    • @nameguy101
      @nameguy101 7 років тому +2

      nigga how the fuck are you supposed to printf anything if you cant depend on the format string to point to your constant literal like wtf

  • @ianzagorskikh3964
    @ianzagorskikh3964 3 роки тому

    When I first met C++ it was Borland. And it was hard. When I second met it it was "Watcom C++ Reference" and it was really simple. Course there were lot of simple examples (C++ examples). And it was the good starting point..

  • @jamcdonald120
    @jamcdonald120 2 роки тому +1

    22:00 or we could not teach lambda, we dont really NEED lambda in an intro class.

    • @masheroz
      @masheroz Рік тому

      but lambdas are a natural fit into

  • @Ganesh_12345.
    @Ganesh_12345. 2 роки тому +1

    I really loved it,
    nice explanation ❤

    • @CppCon
      @CppCon  2 роки тому

      Glad you liked it!