C++ Weekly - Ep 418 - Moving From C++14 to C++17

Sdílet
Vložit
  • čas přidán 3. 03. 2024
  • ☟☟ Awesome T-Shirts! Sponsors! Books! ☟☟
    Upcoming Workshop: Understanding Object Lifetime, C++ On Sea, July 2, 2024
    ► cpponsea.uk/2024/sessions/und...
    Upcoming Workshop: C++ Best Practices, NDC TechTown, Sept 9-10, 2024
    ► ndctechtown.com/workshops/c-b...
    Create anything, find anything, fix anything, and navigate to anything with C++ and CLion.
    A cross-platform IDE for C and C++ with:
    - A smart C and C++ editor to navigate and maintain your code base productively.
    - Code analysis with quick-fixes to identify and fix bugs and style inconsistencies.
    - An integrated debugger - along with other essential tools from the ecosystem - available straight out of the box.
    Learn more: jb.gg/clion_ide
    Use `CppWeeklyCLion` to get 25% OFF when you purchase a new CLion subscription or renew your existing one.
    Episode details: github.com/lefticus/cpp_weekl...
    T-SHIRTS AVAILABLE!
    ► The best C++ T-Shirts anywhere! my-store-d16a2f.creator-sprin...
    WANT MORE JASON?
    ► My Training Classes: emptycrate.com/training.html
    ► Follow me on twitter: / lefticus
    SUPPORT THE CHANNEL
    ► Patreon: / lefticus
    ► Github Sponsors: github.com/sponsors/lefticus
    ► Paypal Donation: www.paypal.com/donate/?hosted...
    GET INVOLVED
    ► Video Idea List: github.com/lefticus/cpp_weekl...
    JASON'S BOOKS
    ► C++23 Best Practices
    Leanpub Ebook: leanpub.com/cpp23_best_practi...
    ► C++ Best Practices
    Amazon Paperback: amzn.to/3wpAU3Z
    Leanpub Ebook: leanpub.com/cppbestpractices
    JASON'S PUZZLE BOOKS
    ► Object Lifetime Puzzlers Book 1
    Amazon Paperback: amzn.to/3g6Ervj
    Leanpub Ebook: leanpub.com/objectlifetimepuz...
    ► Object Lifetime Puzzlers Book 2
    Amazon Paperback: amzn.to/3whdUDU
    Leanpub Ebook: leanpub.com/objectlifetimepuz...
    ► Object Lifetime Puzzlers Book 3
    Leanpub Ebook: leanpub.com/objectlifetimepuz...
    ► Copy and Reference Puzzlers Book 1
    Amazon Paperback: amzn.to/3g7ZVb9
    Leanpub Ebook: leanpub.com/copyandreferencep...
    ► Copy and Reference Puzzlers Book 2
    Amazon Paperback: amzn.to/3X1LOIx
    Leanpub Ebook: leanpub.com/copyandreferencep...
    ► Copy and Reference Puzzlers Book 3
    Leanpub Ebook: leanpub.com/copyandreferencep...
    ► OpCode Puzzlers Book 1
    Amazon Paperback: amzn.to/3KCNJg6
    Leanpub Ebook: leanpub.com/opcodepuzzlers_book1
    RECOMMENDED BOOKS
    ► Bjarne Stroustrup's A Tour of C++ (now with C++20/23!): amzn.to/3X4Wypr
    AWESOME PROJECTS
    ► The C++ Starter Project - Gets you started with Best Practices Quickly - github.com/cpp-best-practices...
    ► C++ Best Practices Forkable Coding Standards - github.com/cpp-best-practices...
    O'Reilly VIDEOS
    ► Inheritance and Polymorphism in C++ - www.oreilly.com/library/view/...
    ► Learning C++ Best Practices - www.oreilly.com/library/view/...
  • Věda a technologie

Komentáře • 34

  • @N....
    @N.... Před 3 měsíci +3

    12:49 I would use "simplfy" for an in-place operation and "simplified" for one that returns a simplified copy. Consistent naming like that helps make APIs easier to figure out how to use IMO.

  • @DART2WADER
    @DART2WADER Před 3 měsíci +4

    Thanks for the fuzzing example. Now I roughly know how to set it up and use it.

    • @cppweekly
      @cppweekly  Před 2 měsíci +1

      For more on fuzz testing, check out episode 352 - czcams.com/video/Is1MurHeZvg/video.html

  • @mbczxaydbzrkmszj
    @mbczxaydbzrkmszj Před 3 měsíci

    Thanks for sharing! Excellent video!

  • @jaredlash5002
    @jaredlash5002 Před 3 měsíci +5

    I really appreciate the insights for these moving from one standard to the next videos. There needs to be some kind of change to the way the sped up code changes are presented, though. If watching at 1x speed, you get the commentary and then risk blowing past a whole heap of changes before you can switch back to 0.25x speed so that you can actually see the code changes being done. It is terribly jarring.

    • @LeMustache
      @LeMustache Před 3 měsíci +1

      Agreed. Those speed ups are actually too fast

    • @sqw33k
      @sqw33k Před 3 měsíci

      Uhh, just pause the video before adjusting the playback speed?

    • @LeMustache
      @LeMustache Před 3 měsíci +1

      @@sqw33k Sure. It'd be nicer if you didn't have to though

  • @DominicDW8
    @DominicDW8 Před 3 měsíci +3

    Any reason you don't use std::ignore = evaluate(...) at around 16:30?

  • @BenjaminWheeler0510
    @BenjaminWheeler0510 Před 2 měsíci +2

    There's like 5+ keywords in every method signature 💀 cpp moment

    • @BryceDixonDev
      @BryceDixonDev Před 2 měsíci

      If 'const' doesn't occur at least 5 times in a function signature, is it even C++?
      Jokes aside, some of these aren't keywords, they're attributes (which are subtly different) and the benefit of having lots of keywords everywhere is that - while yes, it's extremely verbose - it allows us to be extremely specific in our intentions, both to other developers (and our future selves) and the compiler(s) we use. I often think about Python and JavaScript libraries which feature functions that have intentions which are completely impossible to determine. Sure, "foo" is a method of the object, but all it takes is one dictionary (aka associative container) and I need the documentation (which might be out of date or just incorrect) to tell me what I can provide, what the side effects are (if any), if the inputs are modified by reference, what the output is supposed to contain, etc. meanwhile, all of that is completely discernable from just the function signature in C++ both as a programmer *and* as the compiler, meaning the compiler can point out bugs supplemental documentation never could. It also means that a lot of the time C++ can subsist without comments or documentation* since the code is verbose enough as to be self-documenting.
      *That being said, documentation is still warranted for system-level understanding and intention; something the compiler can't really be aware of.

    • @cppweekly
      @cppweekly  Před 2 měsíci

      Yes, the defaults are backward. Sorry, I didn't do it!

  • @Minty_Meeo
    @Minty_Meeo Před 3 měsíci

    16:32 I would instead do an explicit cast to void for this.

    • @cppweekly
      @cppweekly  Před 2 měsíci

      I'm not a fan of that, personally

  • @stephenhowe4107
    @stephenhowe4107 Před 3 měsíci

    Hi. Has the C++ Weekly hoodies gone?

    • @cppweekly
      @cppweekly  Před 2 měsíci

      Never had hoodies, I don't think...?

    • @stephenhowe4107
      @stephenhowe4107 Před 2 měsíci

      @@cppweekly: You have. I know as I am wearing a "C++ Weekly" hoodie. But it is old , at least 3-5 years old and wearing out. It is all black.

    • @stephenhowe4107
      @stephenhowe4107 Před 2 měsíci

      I will wear the "C++ Weekly" hoodie at the ACCU 2024 conference in Bristol at the Marriott Hotel on 17th - 20th April
      I also have a C++ weekly t-shirt. I will wear that as well.

  • @duncangibson6277
    @duncangibson6277 Před 3 měsíci +1

    I'm still a c++98 guy who would like to improve, but I'm afraid that the comments and fast-forward edits are just too hard to follow. Is there a git repository showing before and after commits with a summary of the reasons for the changes made?

    • @DominicDW8
      @DominicDW8 Před 3 měsíci

      There's a link to the discussion in the repo in the videos description 👍

    • @duncangibson6277
      @duncangibson6277 Před 3 měsíci +2

      @@DominicDW8The "episode details" link just seems to go to an episode planning issue, and the cpp-best-practices/infiz repo doesn't show any commits relating to this video. Maybe I'm just looking in the wrong place, or changes haven't been pushed yet.

    • @DominicDW8
      @DominicDW8 Před 3 měsíci

      ​@@duncangibson6277 you're right, sorry.

  • @alskidan
    @alskidan Před 3 měsíci +6

    "If we ignore is that a bug?.." Hundred times in a row. What else do we need to prove that C++ has got all the defaults wrong? 😆

    • @FedericoPekin
      @FedericoPekin Před 3 měsíci +3

      thanks for telling the obvious. If you want backward compatibility, what choice do you have?

    • @sinom
      @sinom Před 3 měsíci +8

      Not just a backwards compatibility thing but also just a general language default. For most languages ignoring returns isn't by default an error and you often can't even tag it to be an error.
      While yes nodiscard would probably be a better default, it does make sense why it isn't just looking at the general language landscape

    • @alskidan
      @alskidan Před 3 měsíci +2

      @@FedericoPekinproper language versioning with feature deprecation. Say, C++ 20 may not be backwards compatible with C++ 17, 14, 11, 2003, etc. Or at very least, let’s stop pretending ABI compatibility is a thing. Everyone who wrote sufficiently complex systems know that either you go down to C or you go up to source level compatibility. As for good (rather better defaults), just take a look at Rust and Swift. It’s a shame how C++ is getting worse over time. 😢

    • @FedericoPekin
      @FedericoPekin Před 3 měsíci +3

      @@alskidan I am pretty sure you are delusional

    • @alskidan
      @alskidan Před 3 měsíci +2

      @@FedericoPekin maybe I am or maybe not. In my domain we stopped using C++ for several years already because of all the problems it has. I just feel for it since that’s the language I was in love with for 15 years. But one thing is to love the language and another thing is being pragmatic and honest