Timeline for What's the problem with "using namespace std;"?
Current License: CC BY-SA 4.0
11 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Aug 26, 2021 at 13:42 | comment | added | ttbek | @Swift-FridayPie Even having had my education in an institution still attached to starting with C and C++... we do not spend a lot of time with printf. Cout was introduced very very early and was pretty much the only C++ thing we were allowed to use as we implemented a whole bunch of other things restricted to the C rough subset of C++. From day one we could use printf or cout, and cout is what most people went with because the syntax was easier to recall. Of course we couldn't use std::accumulate while taking a sum, but printf wasn't considered algorithmically important in any way. | |
Sep 19, 2019 at 22:24 | history | edited | Peter Mortensen | CC BY-SA 4.0 |
Active reading.
|
Jul 30, 2019 at 22:48 | comment | added | Martin Beckett | @mckenzm I might put it in a book or lecture notes to reduce clutter, but not in code | |
Jul 29, 2019 at 5:07 | comment | added | mckenzm | Really? It's pretty much in the first example of the first chapter of sooo many books on C++, if anything it (with insertion operator usage) is the only C++ some new bods know. | |
Apr 24, 2018 at 18:49 | comment | added | Swift - Friday Pie | @BrentRittenhouse maybe a little bad example, there are at least four different libraries that have cout. May be "is it standard library? libstdc++? stl? something else?" And no, not everyone knows std::cout, at least inherently, 6 of 7 new workers we receive don't. Because curricula of education doesn't use those in education. I have to chase away printfs. Or debugs() - from Qt. | |
Apr 5, 2018 at 20:20 | comment | added | James Hollis |
@BrentRittenhouse cout is a bad example because everyone recognizes it. But imagine future in a financial app. Is it a contract to buy or sell something at a specified date? No it isn't. If the code said std::future you would not be so easily confused.
|
|
Mar 29, 2018 at 12:40 | history | edited | Azeem | CC BY-SA 3.0 |
Formatted keywords
|
Mar 5, 2018 at 22:43 | comment | added | Brent Rittenhouse | Is this a joke? I genuinely can not tell. If not then I personally would assume it's the normal 'cout' unless you don't trust the code since otherwise that would be a BEYOND MAJOR code smell, IMO. ... And if you don't trust the code then why are you using it in the first place? Note that I'm not saying "TRUST EvERYThING!!" but this also seems a bit far fetched if you're, say, dealing with some well known library from GitHub or something. | |
Nov 18, 2014 at 13:48 | history | edited | Martin Beckett | CC BY-SA 3.0 |
typo
|
Sep 21, 2009 at 3:17 | history | edited | Matthew Scharley | CC BY-SA 2.5 |
No, you don't :)
|
Sep 21, 2009 at 3:13 | history | answered | Martin Beckett | CC BY-SA 2.5 |