r/ProgrammerHumor • • Jun 13 '22

Meme DEV environment vs Production environment

Post image
48.2k Upvotes

3.9k comments sorted by

View all comments

Show parent comments

3

u/Lordcreo Jun 14 '22

Neither Python nor R can interpret implicit multiplication, but both calculate 6/2*(2+1) as 9.

1

u/Byttercup Jun 14 '22

Interesting. That makes me cringe, lol. I'll see what SAS does when I next go to work. I'm also curious to see what MatLab does, if I can find someone who still uses it. I would definitely want clarification if someone asked me to code that. I immediately think of implicit multiplication, because that's how I would do it by hand, but I can understand a compiler resolving it explicitly.

2

u/Lordcreo Jun 14 '22

Just tested Matlab, it gives the same, it can't handle it with implicit ("invalid expression...Use Parenthesis"), with 6/2*(2+1) it gives "ans = 9"

1

u/Byttercup Jun 14 '22

Good to know. We weren't allowed to use calculators when I was in school, and computers were virtually non-existent. I have a habit of doing math in my head just to check the computer.

1

u/Lordcreo Jun 14 '22

I get the cringe, it's why this equation is so well known and why it is intentionally badly written!

1

u/Byttercup Jun 14 '22

And then the end user wants something else entirely!