Re:Low-Level Optimization with Zig
by josephg on Sunday June 08, 2025 @04:42PM
(#44219361)
> Then I noticed (I kid you not) people started writing FOOLIB_PRIVATE(var) in their own code.
If it’s in an internal monorepo, this should be super easy to fix using grep.
Honestly it sounds like a great opportunity to improve your API. If people are going out of their way to access something that you consider private, it’s probably because your public APIs aren’t covering some use case that people care about. That or you need better documentation. Sometimes even a comment helps:
int _foo; // private. See getFoo() to read.
I get that it’s annoying, but finding and fixing internal code like this should be a 15 minute job.
If it’s in an internal monorepo, this should be super easy to fix using grep.
Honestly it sounds like a great opportunity to improve your API. If people are going out of their way to access something that you consider private, it’s probably because your public APIs aren’t covering some use case that people care about. That or you need better documentation. Sometimes even a comment helps:
I get that it’s annoying, but finding and fixing internal code like this should be a 15 minute job.