this post was submitted on 03 Aug 2023
649 points (95.9% liked)

Programmer Humor

32710 readers
1338 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 28 points 2 years ago (4 children)

Most languages support concatenation of strings using the + operator. The only mainstream languages I can think of that don't are PHP (which uses ".") and low-level languages like C & C++.

[–] [email protected] 23 points 2 years ago

JavaScript might even concatenate some integers instead of adding them just for shits and giggles.

[–] [email protected] 12 points 2 years ago

R uses paste0() for some reason

[–] [email protected] 8 points 2 years ago
[–] [email protected] 7 points 2 years ago (1 children)

C++ does as well, doesn't it? Though I don't often use std::string, so I'm not sure. But every other string type I worked with had + overloaded.

[–] [email protected] 1 points 2 years ago

I dunno, I've never actually worked in C++, but I tried it out online and it didn't seem to work.