Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • Not a thing to do with general-purpose data structures, but for the sake of the argument, yeah a getter free design would look something like that (though you could argue this is not exactly a hash table anymore). You would not encapsulate the action (by which I presume you mean make it entirely internal to the class) - as that's a very different design. Passing in an action is just dependency injection (it could also be an object) - you'd do this sort of thing if your class needs to call something, but cannot know what that something is. But again, not how hash tables are conceptualized. Commented May 11, 2024 at 23:24
  • Yeah, you can push OOP as far as you like you just flip the way you call functions. I think this question is just a continuation of the argument on the previous one Commented May 12, 2024 at 11:51