DEV Community

Discussion on: Which mainstream programming language has the ugliest syntax?

 
skyrpex profile image
Cristian Pallarés

Indeed. +1 for using \n instead of std::eol.

Thread Thread
 
ybalrid profile image
Arthur Brainville

Indeed! (You probably mean std::endl ;-))

And yes, this thing is the devil and should not be used. I'm sad so much books and courses about C++ use this thing as a "new line" character, it is not. It happens to print one before flushing.

std::cin and std::cout will synchronize themselves, you don't need to flush by hand, you just makes your program slower that it should be, and this tend to make me angry ;-)

Thread Thread
 
skyrpex profile image
Cristian Pallarés

Oh yeah, I meant std::endl... haha I have read too much about LF and CRLF eol's these days

Thread Thread
 
ybalrid profile image
Arthur Brainville

Remark, I wouldn't be a bad thing to have a global called "eol" or "lf" in std that doesn't flush the output. :-)

But it's really a shame that they called this thing "endl"...