Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Neat, but horrid naming for everything. Why does namespace need explicit "cpp_" prefix? Why do classes inside "cpp_redis" namespace still have "redis_" prefix? I would prefer simple "redis::client" so much nicer than "cpp_redis::redis_client"


Thanks for your feedback!

"Why does namespace need explicit "cpp_" prefix?" I get used to namespace by the library name for each library I build. I believe it does make sense, I think here the issue is maybe more about the library name itself. As other people suggested, it is still possible to create an alias for this namespace

"Why do classes inside "cpp_redis" namespace still have "redis_" prefix?" I 100% agree and I think I will change that! It is also inconsistent as I got a `redis_client` class but at the same time a `future_client` without redis_prefix. I definitely makes more sense to name it only redis and I'll make that change later on:)

Thanks foryour feedback though :)


    namespace redis = cpp_redis;
there you go.


A quick fix, but having many of these can make code much harder to read since you will need to trace through the various aliases to find the actual implementation.


now you have

    redis::redis_client
a bit better, but not

    redis::client


So it doesn't conflict with any of the stuff you might've written yourself already to deal with redis (which, presumably, you named the stuff you've written `redis`). Besides, you can just namespace the thing at the top.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: