Nobody Can Program Correctly - Lessons From 20 Years of Debugging C++ Code - Sebastian Theophil

แชร์
ฝัง
  • เผยแพร่เมื่อ 2 ส.ค. 2024
  • cppcon.org/
    ---
    Nobody Can Program Correctly - Lessons From 20 Years of Debugging C++ Code - Sebastian Theophil - CppCon 2022
    github.com/CppCon/CppCon2022
    We like to write code but-despite our best efforts-we make mistakes. Our program will contain bugs. Sometimes, we don’t write what we mean to write, sometimes we don’t understand an aspect of our programming language and at other times we lack-or fail to consider-some critical information about our program’s system environment. As a result, our program will not behave correctly. What do we do now?
    In this talk, I would like to take you through the entire debugging process, starting with a program that crashes. What do we do next? Which questions do we have to ask? What information do we need? What can we do to find the cause of the crash? Which tools can help us in this quest, and, last but not least, what can we do to make sure this bug never happens again?
    Thanks to real-world examples that we have encountered - and debugged - over the years, you will learn how to reproduce, locate, understand and fix even the most difficult bugs.
    ---
    Sebastian Theophil
    Sebastian has been working at think-cell Software since its founding in 2002. In the last few years, among many other things, he has ported think-cell to run on macOS.
    He is also the maintainer of the typescripten project which lets programmers call JavaScript libraries from C++ code compiled to WebAssembly in a convenient and type-safe way. He enjoys to leave this desk from time to time to talk at international C++ conferences and has previously given talks at CppNow, CppCon, and ACCU.
    ---
    Videos Streamed & Edited by Digital Medium: online.digital-medium.co.uk
    #cppcon #programming #debugging
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 21

  • @vaddimka
    @vaddimka ปีที่แล้ว +2

    This is a nice video to sleep to, feels very 90s

  • @kuriankattukaren
    @kuriankattukaren ปีที่แล้ว

    Very informative talk.

  • @player-eric
    @player-eric ปีที่แล้ว +3

    Could you please provide accurate subtitles for this video?

  • @betafractal9395
    @betafractal9395 ปีที่แล้ว +1

    That title is hilarious 😆

  • @babgab
    @babgab ปีที่แล้ว +9

    My impression is that there aren't a ton of debugging talks because a huge swathe of the industry doesn't actually "debug," especially in the sense of using a symbolic debugger. I sometimes worry that this skill will be lost over the years.

    • @joesilver75
      @joesilver75 ปีที่แล้ว

      I can't even imagine coding without a debugger. How else could you follow the flow of your program?

    • @D0Samp
      @D0Samp ปีที่แล้ว

      @@joesilver75 In the best case, you can deduct (mis)flow from a reasonable test coverage; in the worst case, the code is not even littered with debug log messages, but rather naked printf/OutputDebugString calls that may or may not be included in release builds.

  • @juancruznores9858
    @juancruznores9858 ปีที่แล้ว

    There's always the: "Uhh?... thats funny..."

  • @hiftu
    @hiftu ปีที่แล้ว +1

    Is that possible to fix the audio of this video? (the "s"-es hurt my ears.)

  • @thomasw813
    @thomasw813 ปีที่แล้ว +1

    40:19 That assumption is wrong. I have been debugging a lot of code which I haven't written. I was doing it as a service. Other programmers do that by coincidence because they take over a job of someone else. What's the consequence for the rest of the video? Do we need to educate the programmers who had the wrong mental model? How?

  • @JohnDlugosz
    @JohnDlugosz ปีที่แล้ว

    (end-begin)/sizeof(element_t) doesn't make sense for std::vector in the first place. v.end()-v.begin() would already be the number of elements == v.size().
    You fixed the element_t to be the same between processes, but the std::vector itself is not portable between processes.

  • @jackadrianzappa5919
    @jackadrianzappa5919 11 หลายเดือนก่อน

    At 49:24 you have:
    ```
    if (auto const ohFile = ERRNORETRYIGNORE(
    open(file, ...)
    tc::err::returned_nonnegative_value(), // success
    tc::err::returned(invalid_filehandle, EINTR), // retry
    tc::err::returned(invalid_filehandle, {EPERM, ENOENT, EACCES}) // allowed errors
    ))
    {}
    ```
    Am I correct that `ERRNORETRYIGNORE` is a function of 4 parameters, the first is returning a file handle, the 2nd returns a lambda/functor that tests for a non-negative value, and the others returning lambda/functors that test `errno` for the errors specified?
    Just want to confirm my understanding as there's no comma at the end of the `open()` call.

  • @theb1z0n
    @theb1z0n ปีที่แล้ว

    That's some bad mic here!

  • @knownaskevr
    @knownaskevr ปีที่แล้ว +2

    Why is this already part of the playlist? On TH-cam, people typically go to playlists to see content in some order. Making this part of the playlist, particularly at the beginning, is a total buzzkill and discourages me from looking into CppCon content.

    • @batorygimnazjum2683
      @batorygimnazjum2683 ปีที่แล้ว +1

      What kind of order do you mean?

    • @Buoy2
      @Buoy2 ปีที่แล้ว

      ??? did you look at the video or just the title

    • @colin398
      @colin398 ปีที่แล้ว +1

      Cope

    • @ChrisCox-wv7oo
      @ChrisCox-wv7oo ปีที่แล้ว +4

      Your complaint is that it's on the playlist? What is the harm?

    • @johnwilkesbooth6378
      @johnwilkesbooth6378 ปีที่แล้ว +2

      What are you talking about??