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

flow (also Flow-IPC?): Style: 0 -> nullptr. #66

Open
ygoldfeld opened this issue Mar 9, 2024 · 1 comment
Open

flow (also Flow-IPC?): Style: 0 -> nullptr. #66

ygoldfeld opened this issue Mar 9, 2024 · 1 comment
Labels
from-akamai-pre-open Issue origin is Akamai, before opening source style-refactor An enhancement mainly for style and/or best practices; maybe minor perf benefits

Comments

@ygoldfeld
Copy link
Contributor

@ygoldfeld filed as follows pre-open-source:

Flow uses (in code) 0 (for null pointers) (comments just say null as a word and can continue to do so).

  • Change it to nullptr. (The search/replace might be non-trivial.)
  • Change the coding guide (it's in source).

Commentary: I ([~ygoldfel]) actually don't really think the value nullptr is all that useful/important. It's a little bit of visual syntactic sugar... but I don't think it makes any real difference in terms of type safety; after all 0 is still usable in almost all the same places (apparently constexpr is an exception... but that is really quite a corner case in practice). nullptr_t - the type - is quite useful indeed, but that is not this ticket. I might be missing something, but actually I doubt I really am. However, for some reason other coders seem to really love nullptr. (My theory is that they miss NULL macro, and this is their revenge on all those jerks who forced them to stop using it at some point.) Anyway, they win: I will join the 21st century on this.

Priority: It's obviously not a huge deal... but the longer it's put off the more annoying it will be. So might as well do it up-front and stop paying the subsequent tax (small though it may be).

Update: I've warmed to it some more; it is nice syntactic sugar at least.

@ygoldfeld ygoldfeld added from-akamai-pre-open Issue origin is Akamai, before opening source style-refactor An enhancement mainly for style and/or best practices; maybe minor perf benefits labels Mar 9, 2024
@ygoldfeld
Copy link
Contributor Author

Not sure if there's an issue filed for this, but either way should do this for Flow-IPC too (shares DNA with Flow including its formal coding guide document). Flow-IPC might already be like 50/50 nullptr instead of 0. Flow is 0/100 which is consistent at least.

@ygoldfeld ygoldfeld changed the title Style: 0 -> nullptr. flow (also Flow-IPC?): Style: 0 -> nullptr. Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
from-akamai-pre-open Issue origin is Akamai, before opening source style-refactor An enhancement mainly for style and/or best practices; maybe minor perf benefits
Projects
None yet
Development

No branches or pull requests

1 participant