Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 46
In academic environments, it can frequently be the case where many are condemned for not using 'using namespace std'. Lecturers, especially those who lack experience in actual software development, want an easy job marking the papers. Were we taught about it's purpose and why 'using namespace std' is needed, or how it works? No. We weren't even taught what namespaces are. It is simply a bad practice to freely use something when you don't understand how it works. What I see essential is for namespaces to be taught to beginners with sufficient explanation, and not forced upon them. The recent disagreements I had with the system got me trying to not use it (which is a royal pain once you've stuck with it for some time, all the more reason to eliminate blind practice of 'using namespace std').
4th Apr 2017, 12:45 PM
Hatsy Rei
Hatsy Rei - avatar
+ 14
I think namespaces are unneeded...the problem with C++ is that it tries to do certain things in too many different ways. Why use namespaces when you can use header files with class declarations? It does not seem necessary.
4th Apr 2017, 12:56 PM
Karl T.
Karl T. - avatar
+ 12
the problem is I don't know how to code without the namespace........ I learned C++ in sololearn and all of the example given are with namespace 😓😓😓 (I feel like the answer is out of the question ==)
4th Apr 2017, 1:09 PM
Leon lit
Leon lit - avatar
+ 11
@Ace i agree with you as beginner i will try to remember your advice. but i think i will gonna need a time to adapt.
4th Apr 2017, 2:25 PM
Agus Mei
Agus Mei - avatar
+ 7
Personally, I only use namespaces for quick codes. My first usage of it was here in SoloLearn Playground. The whole concept didn't exist when I started using 'C with Classes' and I ignored it, when it did get added. It became needed as the standard libraries grew, masively increasing the symbols being defined.
14th Jun 2018, 11:48 AM
John Wells
John Wells - avatar
+ 6
In my opinion namespaces are a good practice. Well i am not much experienced in C++ and mostly work on turbo IDE in which namespaces are absent but from what I know about Namespaces they are very good for creating different scopes of variables. Using them we can use variables in a systematic manner with defining our own scopes.
4th Apr 2017, 12:13 PM
Sahaj Bamba
Sahaj Bamba - avatar
+ 6
Your own argument is in favor of namespaces. You're pointing out the dangers of (ab)using the "using namespace" syntax, which I completely agree with.
4th Apr 2017, 1:55 PM
Igor B
Igor B - avatar
0
i am agree with u #Ace Thats what im questioning to them
26th Jul 2018, 6:19 PM
NITHIN RAJ NAVANEETH
NITHIN RAJ NAVANEETH - avatar
- 15
Java is more hard or c++
5th Apr 2017, 5:03 PM
Atul Kumar
Atul Kumar - avatar