Ask HN: Scolded on a job interview for not namespacing
Ask HN: Scolded on a job interview for not namespacing I went on a job interview for a Quant position. I wrote out some c++ and I used namespaces like: std::cout, std::merge, etc. I did not write: using namespace std; The interviewer just lost it. Went on this rant that "how can programmers now write such confusing code", "just name space it ahead of time". And he was just plain mad. Uncomfortable mad. I tried saying "what if functions have the same name"..he spouted off about "how compilers are smart enough to know what the programmer wants based upon parameters provided and why would any programmer use functions with the same name and how so many people he talks to don't know how to code but call themselves coders...and why didn't I write my own code to merge 2 files. Did I need to use the std.." What does everyone else do? using namespace std; cout >> "blah" >> endl; merge(...); or std::cout >> "blah" >> std::endl; std::merge(...); and I always use std:: instead of writing my own. I mean "time tested" versus "have I had enough coffee...". In 25 years of c++ I always used std:: before re-creating. Has anyone else had a horror interview like this? more