Using std Namespace

前端 未结 16 724
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-22 04:57

There seem to be different views on using \'using\' with respect to the std namespace.

Some say use \' using namespace std\', other say don\'t but rathe

16条回答
  •  旧时难觅i
    2020-11-22 05:26

    This discussion is going to be alive as long as the IDE you work with is not flexible enough to show or hide the exact information you need.

    That is because what you want your code to look like depends on the task at hand.

    While creating my source code, I prefer to see exactly which class I'm using: is it std::string, or the BuzFlox::Obs::string class?

    When designing the control flow, I'm not even interested in the types of the variables, but I want a focus on if's and while's and continue's.

    So this is my advise:

    Depending on the audience of your code and the power of your tools, choose the way that either reads easiest, or gives most information.

提交回复
热议问题