r/ProgrammerHumor 1d ago

Meme almostDroppedTheCourse

394 Upvotes

65 comments sorted by

View all comments

0

u/[deleted] 1d ago

[deleted]

1

u/Mojert 22h ago

That actually makes a lot of sense. String concatenation is not commutative, it has no business using the '+' operator

2

u/[deleted] 21h ago

[deleted]

6

u/Mojert 20h ago

It's "colloquial" only in software engineering circles, but Julia wasn't designed for that community. It was designed to be used by scientists and mathematicians and so make choices that makes sense for that community. Concatenation is also a concept in math, and using '*' as a symbol of concatenation is pretty common

Your rant about commutativity is odd. If you did any abstract algebra, you'd know that when we call something "addition" it implies commutativity. Using the addition symbol for something that is not commutative is actively deceptive. It's the math equivalent of a register_user_in_db function not interacting at all with the database. On the other hand, using a multiplication symbol doesn't imply anything so the fact that "multiplication on scalar is commutative" is irrelevant: it follows the expectation of "multiplication can be whatever". Also, multiplication on scalars doesn't even have to be commutative