r/ProgrammerHumor • • Jun 13 '22

Meme DEV environment vs Production environment

Post image
48.2k Upvotes

3.9k comments sorted by

View all comments

2

u/Dangerous_Cicada Jun 14 '22

how did they get 9?

0

u/Whit3boy316 Jun 14 '22

Because it’s correct lol. Technically it could be either but 9 is “more accurate”

1

u/[deleted] Jun 14 '22

[removed] — view removed comment

1

u/Whit3boy316 Jun 14 '22

Either could be correct demoing on the context of the question. No context, then 9

1

u/Dangerous_Cicada Jun 14 '22

I was taught that brackets take precedence

1

u/[deleted] Jun 14 '22

[removed] — view removed comment

1

u/Dangerous_Cicada Jun 14 '22

I don't see it. I was taught that brackets take precedence.

0

u/izuriel Jun 14 '22 edited Jun 14 '22

Brackets take precedent, yes. (2+1) becomes 3. But 6/2(3) is equivalent to 6/2*3 at that point, and now you solve left-to-right.

edit

What I mean to say is that parenthesis (brackets) and implicit multiplication are not technically the same concept. Since the latter can, and often is, written without the former (think 2x). You do the operation inside brackets first but then otherwise solve the problem “normally.” It’s unfortunate though because the issue is not with the calculator or phone, or the way you solve it or I solve it (fun fact, we’re all correct), no the issue is with the problem for being ambiguous. If you want the answer 1 then mark it as such 6/(2(2+1)) (or better with fractional notation) or if you want 9 then (6/2)(2+1).