upvote
This seems like an incredibly unimportant quibble... I would imagine they just used std::endl b/c that's what most random tutorials used in the 2000s and that's how the engineer learned. If you are printing a debug string, you probably don't care that much about perf in the first place.
reply
Ask yourself, would a newbie make that mistake ?
reply
I was wondering if it's a hard real-time constraint or something to ensure consistent timing.
reply
The modern C++ idiom is std::println() anyways...

https://en.cppreference.com/cpp/io/println

reply
For a long time, std::endl demonstrated that you were a proper C++ programmer, not some neckbeard C apologist. It wasn’t until C++ had „won“ that it became acceptable to use \n again.
reply
> And because cout is guaranteed to flush anyways when the program ends, you're adding a delay for no reason.

I mean... If your command line utility doesn't print anything til it's done, that is going to be, _at best_, an annoying user experience.

reply
Cool I did not know that.

Your comment is a bit salty, but I learned something from it, so I don’t think you deserve the downvotes

reply