20

A programmer walks into a bar. He has a concussion because you were using namespace std and didn't scope to building.

Comments
  • 0
    I don't get the joke but I like it.
  • 0
    @chadd17 do you know C++?
  • 1
    what the fuck is a namespace
  • 2
    @BindView once upon a time there was this language called C++. And you had to define all kinds of things in libraries. So in order to keep it all organized, they decided that they would group all the functions in to namespaces. And that was pretty great. You just had to call out a namespace and the scope resolution operator (::) and you could call that method. Then C++ said "you know, we can make this better." And introduced the using keyword. It would automatically scope unscoped methods to the namespace defined in the using line. This was bad though, because the defaults could clash or, worse, you would forget to scope something, it wouldn't be caught and you would have a really hairy error. So using fell out of favor.

    That is until C# came along with it's strict scoping and mandatory scope definitions and made everything better. And that is why @runfrodorun hates C#.
  • 3
    OUCH!!! I just learned c++ in this past month. I got burned by shared_ptr, since it is in boost and in the c++ 2011 standard. Apparently, the code was compiled without the 2011 standards.. grrrr
  • 1
    aha, so a namespace is a way more complicated package, i get it noe, thanks
  • 1
    It is basically a way to isolate code into different libraries, so you can have classes with the same name. std::shared_ptr is in the c++ standard library, whereas boost::shared_ptr comes from boost. If you import std, you can really hosed yourself.
  • 0
    @runfrodorun C# is awesome and does all the things. Btw. I am slowly training my autocorrect to replace C# with "the awesome language that does all the things that @runfrodorun hates"
  • 0
    @bremen242 yeah. The reason I thought of this joke is that my co-workers and I were talking about scope resolution today.
  • 0
    @projektaquarius c# is great. I'd use it any day over c++.
  • 0
    I've used C# in dev. I read up on C and liked it. I looked at examples of C++ and hated it.
  • 1
    @chadd17 C++ is great. Personally I would use it over C. But that's because I have seen horrible things done in C. But like @bremen242 said I prefer C# over C++. I feel like C++ requires an amount of management that bothers the ever loving shit out of me. More power to the people that can code in C++ though. I give them a lot of shit but I respect the hell out of the way their brains work.
  • 0
    @chadd17 C++ is not a language I love, but it is simply the one I need. Memory management goes a long way in writing scientific simulators.
Add Comment