3 ms·
I constantly run into the situation where you make 2 or more constants with a prefix. That always felt like a smell to me - but it might be because in C# it wou
by alkonaut 6y ago
I constantly run into the situation where you make 2 or more constants with a prefix. That always felt like a smell to me - but it might be because in C# it would be.
I'm talking about code that ends up looking like this:
https://github.com/retep998/winapi-rs/blob/0.3/src/shared/ntstatus.rs https://github.com/retep998/winapi-rs/blob/0.3/src/shared/nt...
You get type safety because you can define the type of constant rather than use some primitive, but there feels like something is something missing (nicer autocompletion, better auto generated documentation, and so on).
- wtetzner 6y agoI would probably wrap constants with the same prefix in a module, but all that really does is make the naming feel nicer, I guess.