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.

4
  • 1
    I just looked at 3 header files randomly and they contained classes, enums, templates, namespaces... Also only needing one generator doesn't argue against (or for) making a class for it. Commented Jul 12, 2015 at 13:04
  • @Mat I did make a class for it. But looking at other engines (like Stockfish), they aren't implemented as classes. For example, movegen.h in Stockfish only contains a class for position, not for movegen itself. Commented Jul 12, 2015 at 13:09
  • Is this some sort of networked, multiuser application where you have to worry about cheating? When you say you want to abide by the principle of least privilege, are you talking about the actual objects themselves? Commented Jul 12, 2015 at 15:19
  • @StevenBurnap No, it's not something I have to worry about users cheating at. For example, somebody else may in the future use the movegen in their own chess engine, but there are only a few functions that actually need to be public (the remaining being internally used). Commented Jul 12, 2015 at 15:51