Hey, so I was taught to used standard library before the int main, but i have seen programmers here write with every c-out. I have seen different libraries being used and c-in. Things, I have not covered yet. Thank you for the link. |
There are as many styles as there are programmers. Different programmers will pick different styles based on their past experiences and what they believe will lead to better code, and what their own definition of "better" is.
For example, some people use
using namespace std;
either because they don't know any better or because they think that the added brevity offsets the problems that dumping an entire namespace into the global namespace creates. I prefer my code to be as explicit and unambiguous as possible, so, at least with std, I always write
std::
explicitly.
As another example, I prefer to always write
this->
when referencing members, following my previous rule of minimizing ambiguity. If someone comes along and looks at my code, they can immediately know whether a particular usage refers to a global, a member, or what. Some people think that this advantage doesn't make up for the added verbosity of all those
this->
s, so they only write them to disambiguate for the compiler.