C++ hello world example should not use bad practice #8029
Peter Sommerlad (PeterSommerlad)
started this conversation in
General
Replies: 3 comments 6 replies
|
Peter Sommerlad (@PeterSommerlad) I can create this suggestion for you at https://github.com/microsoft/vscode-docs/issues if you'd like, or you're welcome to create another issue there too. |
0 replies
|
Peter Sommerlad (@PeterSommerlad) |
0 replies
|
What? std::endl is bad practice now? That is news to me. Where did you find that guideline? The std::endl was supposed account for \r\n on some platforms. I know "using namespace std;" has always been not recommended. |
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
using
using namespace std;and outputting a new line withstd::endlis bad practice in modern C++ and should not be shown to beginners who will think that is the only way to output a new line. it would be better to useas a compile sanity check instead.
https://code.visualstudio.com/docs/languages/cpp#_add-hello-world-source-code
All reactions