Matthies / RubiChess

Another chess engine
GNU General Public License v3.0
150 stars 16 forks source link

Add a namespace for all code #428

Closed nguyenpham closed 9 months ago

nguyenpham commented 9 months ago

When embedding the chess engines into a project to work with other chess engines and or chess GUI code, a namespace can help to avoid conflicts between them because of having similar names for classes, functions and variants.

Matthies commented 9 months ago

Looks like a good idea but needs some more work to make compiling with MSVC and enabling conditional compiling for STATISTICS, SDEBUG, ... work. I will do that work but first of all want to ask if there is a reason not putting everything into the namespace? I will write one or two comments into the code as an example.

nguyenpham commented 9 months ago

Q: is there a reason for not putting everything into the namespace? Purposes of namespaces: "Namespaces are used to organize code into logical groups and to prevent name collisions that can occur especially when your code base includes multiple libraries". Thus I guess we should put as many as we can.

Matthies commented 9 months ago

Seems good enough to merge this now.