3 ms·
I did it this way because This library contains just one function. Would you still use namespaces in this case?
by matt42 9y ago
I did it this way because This library contains just one function. Would you still use namespaces in this case?
- Koshkin 9y agoWhy not? (An API is an API, no matter how many functions.)
- w8rbt 9y agoIt's just more C++ ish to write something::listen rather than something_listen. Namespaces are easy too. Why not?
- matt42 9y agoMy fear with this approach that it allows to write "using namespace moustique". This would cause: - name conflicts on the listen function. - Code harder to read since it's not obvious anymore that listen comes for the moustique library. I often use namespaces but I do think that they can have a bad impact on the usability of the api, especially when you have too many deeply nested namespaces, and have to use plenty on using namespace ... to fix this.
- RotsiserMho 9y agoI would. Both because it's more idiomatic and because it's inevitable more functions will be added.