My least favorite C++ feature - James McNellis - Meeting C++ 2024 secret lightning talks

Поделиться
HTML-код
  • Опубликовано: 23 дек 2024

Комментарии • 22

  • @MikhailStrelnikov-q4p
    @MikhailStrelnikov-q4p 7 дней назад +16

    Why do you need a null-terminator if the presentation already has a begin and an end?

    • @wolfgangfrech5942
      @wolfgangfrech5942 4 дня назад

      To be safe if another reader/presenter (t)reats the presentation as a null-terminated slide deck.
      Of course you would also only iterate over it with for and the number of slides as a fixed upper limit, in addition to the null check.

    • @wolfgangfrech5942
      @wolfgangfrech5942 4 дня назад

      Oh I miss those good old days of C++. Somebody remember the Siemens usenet group with C++ riddles?

  • @martijn3151
    @martijn3151 5 дней назад +4

    If memory safety is vital and you cannot guarantee it, you should probably use another language. But if speed it what you’re after, this memory unsafetyness is actually a feature.

  • @paulsaulpaul
    @paulsaulpaul 6 дней назад +2

    My least favorite feature of the Ford Model T is the lack of airbags.

  • @Taladar2003
    @Taladar2003 7 дней назад +29

    Existence is my least favorite feature of C++.

  • @Carewolf
    @Carewolf 6 дней назад +7

    I believe talking about this stuff will just cement the incorrect perception of C++ as unsafe language further. You CAN NOT fix perception once established, no matter how much you fix it, or how many years pass.

    • @elcugo
      @elcugo 6 дней назад +16

      C++ is an unsafe language. Or rather is very easy to use unsafely. Some would say that's why it's so useful.

    • @antonf.9278
      @antonf.9278 6 дней назад +9

      My recommendation for fixing the perception of C++ as unsafe it to start by fixing the unsafety in C++.
      Until something like circle makes it into the standard, calling C++ save is at least deceptive.

    • @TheSandkastenverbot
      @TheSandkastenverbot 4 дня назад

      I don't know why you think C++ is a safe language. Maybe you mean "C++ in combination with a lot of coding guidelines". Or "C++ used by a senior developper". But neither the guidelines nor the developper's age is part of C++. As such, C++ is a memory leak bound to happen.

  • @raymundhofmann7661
    @raymundhofmann7661 7 дней назад +8

    It is time for people to stop projecting the blame for their inaptitude on something else and take self responsibility. If one can't handle pointers, he should stop using them.
    Unfortunately the C++ hubris makes too many people over use pointers (and malloc/free) and also makes compilers/tools lack default simple static checks and diagnostic help.

    • @MeetingCPP
      @MeetingCPP  7 дней назад +18

      malloc/free are C functions, shouldn't be used in C++. Modern C++ has the tools, but not everyone follows that. Compiler Flags and Sanitizers are good for keeping stuff clean, but usage is not enough.

    • @JonathanFraser-i7h
      @JonathanFraser-i7h 6 дней назад +25

      This is probably the worst take imaginable, its ostensibly "git gud". That works fine in DOTA, its down right negligent when you are talking about safety critical code. I mean do you always right perfect cryptographically secure code the first time? No, you don't so maybe you shouldn't code at all.

    • @Karnickel93
      @Karnickel93 6 дней назад +4

      "Take self-responsibility". Seriously? Every coder should be careful about code, but with strict deadlines, working faster than expected or just a case of the mondays, nobody is safe from messing up. My team uses automated checks/compiler flags to prevent this.
      But please, do shout out your company and the industry you're working in, in which you prefer "self-resposibility" over tooling. Please don't let it be gaming or you're falling into the stereotype.

    • @speedstyle.
      @speedstyle. 6 дней назад +4

      Do you think every C++ programmer is inept? Because the most talented teams in the world still write memory safety vulns every few hundred lines. Pointers are an essential tool for building optimized structures and algorithms, which is the point of using a systems programming language.

    • @heavymetalmixer91
      @heavymetalmixer91 5 дней назад

      @@MeetingCPP Counterargument: Some developers make custom allocators with them.