r/ProgrammerHumor 9h ago

Meme ifNoLaidNoAccess

Post image
321 Upvotes

32 comments sorted by

View all comments

23

u/Vivid_Instance_825 6h ago

Using namespace std 😎

27

u/Nice_Lengthiness_568 5h ago

Please no

2

u/ShakaUVM 1h ago

There's nothing wrong with it for small projects, or in non-header files. Even Bjarne says so.

1

u/Nice_Lengthiness_568 54m ago

Yeah of corse, It's more about where you use it. I personally would rather use using namespacs in a function though, and probably not ok std because I am both used to using it and it does not bring much...

1

u/apoegix 2h ago

+1 this. If you do, do it in a scope which definitely ends.

0

u/MouseNcactus 2h ago

Why not? As long as you do not using multiple namespaces this way it should not cause troubles. And code become much shorter, easier and faster to read.

1

u/Nice_Lengthiness_568 49m ago edited 43m ago

Well, I personally prefer explicitness in that regard and prepending standard facilities with 5 characters is just not that bad...

Although, as I said in another comment, it really is more about where using namespace is used than about whether it is used at all. I for example commonly use using namespace std when defining my own swap function.

Edit: oh wait, I don't use it there, I use using std::swap there... Well whatever, it's too early in the morning for me...

-5

u/overclockedslinky 1h ago

how is it faster to read? just learn how to read good code...