2 ms·
TIL that it was named phantom types. I use them in C via struct/union. It is a little more verbose to use, but offers type safety when needed without any runti
by thesnide 2y ago
TIL that it was named phantom types.
I use them in C via struct/union. It is a little more verbose to use, but offers type safety when needed without any runtime penalty.
That, and a good naming scheme : always encode the unit in the variable name. Always.
timeout_ms is much better than timeout, unless timeout is a human readable string. Same for any config file parameter.