News for hackers. Stuff that matters.
Re:Low-Level Optimization with Zig by cobbal on Sunday June 08, 2025 @01:02PM (#44218115)
Why would you hand out data that gets tunneled back in?

There are lots of use cases for this exact pattern. An acceleration structure to speed up searching complex geometry. The internal state of a streaming parser. A lazy cache of an expensive property that has a convenient accessor. An unsafe pointer that the struct provides consistent, threadsafe access patterns for. I've used this pattern for all these things, and there are many more uses for encapsulation. It's not just an OO concern.

There are no comments on this comment yet.