{"comment":{"url":"https://api.github.com/repos/eygilbert/egdb_intl/comments/18511833","html_url":"https://github.com/eygilbert/egdb_intl/commit/a5e65873741ad026ed49fccd21e708f1d1475fee#commitcomment-18511833","id":18511833,"user":{"login":"rhalbersma","id":951511,"avatar_url":"https://avatars.githubusercontent.com/u/951511?v=3","gravatar_id":"","url":"https://api.github.com/users/rhalbersma","html_url":"https://github.com/rhalbersma","followers_url":"https://api.github.com/users/rhalbersma/followers","following_url":"https://api.github.com/users/rhalbersma/following{/other_user}","gists_url":"https://api.github.com/users/rhalbersma/gists{/gist_id}","starred_url":"https://api.github.com/users/rhalbersma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhalbersma/subscriptions","organizations_url":"https://api.github.com/users/rhalbersma/orgs","repos_url":"https://api.github.com/users/rhalbersma/repos","events_url":"https://api.github.com/users/rhalbersma/events{/privacy}","received_events_url":"https://api.github.com/users/rhalbersma/received_events","type":"User","site_admin":false},"position":23,"line":100,"path":"builddb/indexing.h","commit_id":"a5e65873741ad026ed49fccd21e708f1d1475fee","created_at":"2016-08-03T22:10:03Z","updated_at":"2016-08-03T22:10:03Z","body":"Op 3 aug. 2016 11:28 PM schreef \"eygilbert\" <notifications@github.com>:\n>\n> >\n> > Erm, please don't put using directives in headers. That defeats the\nwhole\n> > purpose of the namespace.\n> >\n> I meant to discuss this with you, that's why I put it in a separate\nbranch.\n> My goals for namespace are:\n> 1) Prevent name collisions between user's code and egdb driver.\n> 2) Try to not be disruptive to all the other kingsrow solution files that\n> use these files.\n> 3) Make it easy for the user to use as well.\n>\n> I think the namespace accomplishes #1.\n> I think the using directives accomplish #2 and #3.\n>\n> For my own code, I have no name collisions and don't need namespaces to\n> manage it. I just want a solution that changes as little as possible, so\n> less headaches when diff'ing against other repos branches or the 8x8\n> kingsrow tree.\n>\n> For the user's code, I think that its easier to type \"EGDB_DRIVE handle\"\n> than \"egdb_interface::EGDB_DRIVER handle\". Also, I have already prefixed\n> all the visible names in egdb_intl.h with \"egdb_\", so it seems very\n> unlikely that these names will collide with a user's name. If a user does\n> have a collision, he can always remove the \"using\" statement and type in\n> the namespace at each place in his code.\n>\n> All clients who do #include \"indexing.h\" will get all symbols from\nnamespace\n> > egdb_interface dumped into their own namespace.\n> >\n> Indexing.h is not a file that users will include. The only file a user\n> needs to include is egdb_intl.h. There is a \"using\" in that file too. It's\n> a convenience, but easily removed if anyone doesn't like it.\n>\n> -- Ed\n>\n> —\n> You are receiving this because you commented.\n> Reply to this email directly, view it on GitHub, or mute the thread.\n\nI have to think about it. My first reaction is to not wrap anything in\nnamespaces yet, except for the entire header egdb_intl.h.  Then you define\na egdb_intl.cpp that implements all functionality using your regular\nnamespace free code.\n\nSo eg\n\n// egdb_intl.h\n// no includes from any of your other code!!!\n\nnamespace egdb {\n\nvoid api_fun1();\nvoid api_fun2();\n\n}\n\n// egd_intl.cpp\n\n#include \"egdb_intl.h\"\n// Whatever dependencies you need\n\nnamespace egdb {\n\nvoid api_fun1() { /* implement using your namespace free code */}\nvoid api_fun2() { /* implement using your namespace free code */}\n\n}\n"}}
{"actor":{"display_login":"rhalbersma"}}