News for hackers. Stuff that matters.
Re:*(char*)0 = 0; - What Does the C++ Programmer Intend with... by ecshafer on Tuesday October 17, 2023 @07:18PM (#37922856)
I think a more accurate analogy would be some kind of scalpel that would not let the surgeon cut deeper than they needed. So if they needed a 1 cm incision, it would somehow stop the blade form going in 1.1 cm. In that case, some experienced surgeon may say "But I know how to make a 1cm incision!", but I think that the reality is that preventing a mistake from happening is valuable.

You see the same arguments against static analysis, unit tests, strong type systems, etc. The evidence seems to favor systems which prevent errors over artisinal expertise.

Re:*(char*)0 = 0; - What Does the C++ Programmer Intend with... by Kamq on Tuesday October 17, 2023 @07:42PM (#37923024)
I think an even more accurate analogy would be if a surgeon had some kind of scalpel with a 1 cm limit, but if a surgery suddenly changes in the middle, and suddenly requires a deeper incision, the surgeon has to spend a non-zero amount of time re-configuring the scalpel.

This casts flexibility vs safety as a tradeoff, which it is.

Re:*(char*)0 = 0; - What Does the C++ Programmer Intend with... by SilasX on Tuesday October 17, 2023 @11:51PM (#37924678)
Oh, one more refinement:

Surgeons are constantly killing people[1], and every time, it turns out it was because the surgeon disabled a known, recommended safety rail, and whenever anyone points out that they should stop disabling the safety rails, they insist that they know how to operate without them, it's those other people that don't. Plus it's sooooo inconvenient for an operation[2] to take five more minutes, they're too good to have to deal with that.

[1] introducing security vulnerabilities

[2] code changeset submission

Re:*(char*)0 = 0; - What Does the C++ Programmer Intend with... by dekhn on Wednesday October 18, 2023 @03:56PM (#37933940)
The one thing I remember from watching my wife's surgery is that they counted the surgical sponges going in, and counted them coming back out. Because sometimes surgeons would forget and leave a sponge inside and then the person woudl get a really bad infection.

Honestly, checklists and procedure matter more than most people want to admit.

Re:*(char*)0 = 0; - What Does the C++ Programmer Intend with... by sargstuff on Wednesday October 18, 2023 @04:05PM (#37934067)
Was LD_LOAD and related LC stuff (algebra & unix) the 19th c rabbit hole for [1] & [2] ?

1] introducing security vulnerabilities

[2] code changeset submission

Re:*(char*)0 = 0; - What Does the C++ Programmer Intend with... by steveklabnik on Tuesday October 17, 2023 @08:23PM (#37923380)
https://www.sawstop.com

This is my favorite one