Personally I think the best justification for hungarian prefixes is "handles".
-
Personally I think the best justification for hungarian prefixes is "handles". Genuinely obnoxious to put `Handle` in all your type / var names, and alternatives like `Id` tend to overlap with other identifiers.
-
Personally I think the best justification for hungarian prefixes is "handles". Genuinely obnoxious to put `Handle` in all your type / var names, and alternatives like `Id` tend to overlap with other identifiers.
@dotstdy var names need to be metaphorical/allegorical not technical
-
Personally I think the best justification for hungarian prefixes is "handles". Genuinely obnoxious to put `Handle` in all your type / var names, and alternatives like `Id` tend to overlap with other identifiers.
@dotstdy just name the handle type as the actual thing? eg in sokol-gfx, sg_buffer, sg_image etc are handles, and the "actual" buffer, image etc types are not visible from the outside.
-
@dotstdy just name the handle type as the actual thing? eg in sokol-gfx, sg_buffer, sg_image etc are handles, and the "actual" buffer, image etc types are not visible from the outside.
@dotstdy same as in Vulkan btw, the object handles in the Linux Vulkan driver for Intel have a very familiar pattern, I bet those are index handles with a generation counter tag in the upper bits.
-
@dotstdy same as in Vulkan btw, the object handles in the Linux Vulkan driver for Intel have a very familiar pattern, I bet those are index handles with a generation counter tag in the upper bits.
@floooh that kind of works, but when you expose both they key and the actual thing you need another name for one of them, then you end up doing the same thing the other way. e.g. `ConnectionState`, `BodyStorage`, `PlayerData`.
-
@floooh that kind of works, but when you expose both they key and the actual thing you need another name for one of them, then you end up doing the same thing the other way. e.g. `ConnectionState`, `BodyStorage`, `PlayerData`.
@dotstdy I think that's only needed when the actual thing is accessed as "object" via methods, handles fit better into flat module APIs where each function does a good amount of work to amortise the handle-to-pointer conversion cost.
-
@dotstdy I think that's only needed when the actual thing is accessed as "object" via methods, handles fit better into flat module APIs where each function does a good amount of work to amortise the handle-to-pointer conversion cost.
@dotstdy FWIW if the handle acts like a key I prefer an Id postfix, e.g. Buffer vs BufferId :)
-
@dotstdy FWIW if the handle acts like a key I prefer an Id postfix, e.g. Buffer vs BufferId :)
@floooh yeah that's exactly what I do, but when you have a connection it has a connection id as well as a connection handle! Very unfortunate! I've switched to Key as a suffix. BufferKey, Buffer.
-
undefined oblomov@sociale.network shared this topic on