Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Add null GPIO pin " #6621

Draft
wants to merge 1 commit into
base: dev
Choose a base branch
from
Draft

Revert "Add null GPIO pin " #6621

wants to merge 1 commit into from

Conversation

jesserockz
Copy link
Member

Reverts #6611

@clydebarrow
Copy link
Contributor

clydebarrow commented Apr 25, 2024

Any particular reason for reverting this? I can't imagine anything broke.

I note the objection from @ssieb though it appears to boil down to "that's not how we do it round here". I'd emphasise again that nothing changes unless someone chooses to use this facility, but I do see the benefit.

The inherent difficulty of proper unit or integration testing in ESPHome suggests to me that any programming style that is inherently less prone to errors should at least be considered. C++ has some major design flaws that can't be fixed, but can be worked around.

Greater minds than mine don't like null pointers; from https://en.wikipedia.org/wiki/Void_safety

In a 2009 talk, Tony Hoare traced the invention of the null pointer to his design of the ALGOL W language and called it a "mistake":

I call it my billion-dollar mistake. It was the invention of the null reference in 1965. At that time, I was designing the first comprehensive type system for references in an object oriented language (ALGOL W). My goal was to ensure that all use of references should be absolutely safe, with checking performed automatically by the compiler. But I couldn't resist the temptation to put in a null reference, simply because it was so easy to implement. This has led to innumerable errors, vulnerabilities, and system crashes, which have probably caused a billion dollars of pain and damage in the last forty years.[1]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants