DEV Community

Discussion on: What simple things annoy you about your favourite programming languages?

Collapse
 
mortoray profile image
edA‑qa mort‑ora‑y

C and C++ both do such string concatenation as well, though I've always considered it a feature. Put in this form it definitely will lead to unintended defects.

I wonder why it's there, given PYthon has string concatenation with a simple +.

Collapse
 
tbodt profile image
tbodt • Edited

Because

"hello" +
"world"
Enter fullscreen mode Exit fullscreen mode

is a syntax error, since the + doesn't make python join the lines. You'd have to do

("hello" +
"world)
Enter fullscreen mode Exit fullscreen mode