As a software developer, the less ambiguous your notation is, the better it is for everyone involved. Not only will I use brackets, I’ll split my expression into multiple rows and use tabs to make it as readable as humanly possible. And maybe throw a comment or 2 if there’s still some black magic involved
As a professor said, most programming languages don’t care about readability and whitespace. But we care because humans need it to parse meaning. Thus, write code for people, not for the machine. Always assume that someone with no knowledge of the context will have to debug it, and be kind to them. Because that someone might be you in six months when you have completely forgotten how the code works.
Exactly. You read code way more times than you write it, so it makes all the sense in the world to prioritize readability.
Source code is for humans, then the compiler turns it into code for machines.
Yep, if you’re writing code for a machine, just do it in binary to save compilation time (/s just in case). Also, you in six months will indeed be someone with no knowledge of the context. And every piece of code you think you write for one-time use is guaranteed to be reused every day for the next 5 years
This. Always be kind to your future self.
Yeah I totally agree. You can minimize and optimize as part of your build procedure/compilation but the source code should be as readable as possible for humans.
I had someone submit a pull request recently that, in addition to their actual changes, also removed every single parenthesis that wasn’t strictly necessary in a file full of 3D math functions. I know it was probably the fault of an autoformatter they used, but I was still the most offended I’ve ever been at a pull request.
Autoformatter? More like obfuscator
deleted by creator
You’re a good human being.
Ok but that’s unrelated to putting some numbers and operations in a calculator. No one is going to proofread that. If anything, you simply calculate it again.
Also works if you dont trust yourself with correctly ordering your operations.
I, my head, shake.
- RPN user
Also known as: Japanese speaker
Ok man. Wtf did I just watch…
I get it. We are here on the somehow dark side of the internet…
But THIS… without any context. i mean. Im questioning live here man. What do you want to express with that?
I’m pretty sure it’s just a reference to when the kid types ))<>((
Btw, it’s not from the dark side of the Internet. This was a very popular video at the time.
🤦♂️ read the post body, my lad.
Thanks. Im blind AF
back and forth, forever.
Suuuuuch a weird movie lol
(I used(LISP)one time(and it(permanently))changed the way I (program(computers)))
Did it change it in a positive way?
This is why every calculator should be a RPN calculator.
I still have my HP 48 series calculator. It’s a sturdy beast.
This is why every calculator should be a RPN calculator
No, this is why programmers should (re)learn the order of operations rules before writing a calculator.
Improved readability is always good
(‿!‿) (‿O‿)
( . ) ( . ) ( . Y . )
deleted by creator
Counterpoint: C function pointers (or just C in general)
Also: sometimes, a mathematician just has to invent some concept or syntax to convey something unconventional. The specific use of subscript/superscript, whatever ‘phi’ is being used for, etc. on whatever paper you’re reading doesn’t have to correlate to how other work uses the same concepts. It’s bad form, but sometimes its needed, and if useful enough is added to the general canon of what we call “math”. Meanwhile, you can encapsulate and obfuscate things in software, sure, but you can always get down to the bedrock of what the language supports; there’s no inventing anything new.
deleted by creator
Math should be just as deterministic as programming, but it’s not in some situations
Maths is 100% deterministic for order of operations. The issue is people not following all of the rules. Order of operations thread index
deleted by creator
The syntax is arbitrary in some edge cases
Such as?
My calculator says -2² = -4, so yeah…
Isn’t the “-” order of operations the same as a multiply ? I think I learned powers take priority over the “-” so your calculator would be right.
But either way if it can cause confusion you should use parentheses.Every calculator I’ve used has separate negative and subtraction keys for this purpose. There is no order of operations to follow, it’s just a squaring a number
I learned negative as being a separate operation where we need to apply the order of operations. I think it was something like : -2 is a diminutive for -1x2 so it uses the order of operations of a multiplication.
My calculator is the official one used in schools in France (ti-83 premium ce) and it says -2^2 = -4 with the negative key. I don’t think it would make a mistake in such a simple concept.But whatever these concepts can change depending on the field, country, level of education. What I mean is : it’s unclear, so use parentheses. So (-2)^2 or -(2^2) are the correct ways to write it.
I think it was something like : -2 is a diminutive for -1x2
Correct. Things that are usually left out of Maths expressions are plus signs, ones as multipliers/indices, and un-needed brackets. e.g. I could more fully write this as -1(4)², but that just simplifies to -4²
it’s just a squaring a number
The number being squared is 4, unless you put (-4)², otherwise it’s 4² with a minus sign.
I think I learned powers take priority over the “-”
Yes, Exponents is the 2nd-highest precedence (after Brackets) - BEDMAS.
My calculator says -2² = -4
That’s correct
I would never write -n². Either ‐(n²) or (-n)². Order of operations shouldn’t be some sort of gotcha to trick people into misinterpreting you, it’s the intuitive reading of a well constructed mathematical expression.
Either ‐(n²) or (-n)². Order of operations shouldn’t be some sort of gotcha to trick people into misinterpreting you
It isn’t. With ‐(n²), n² is already a single term, so the brackets aren’t needed.
I feel this in my bones
deleted by creator
sounds like work for a compooter
deleted by creator
I just used the calc on window… it cannot respect order of operation
Yeah, I’ve tried several times to get Microsoft to fix their calculators. I’ve given up trying now - eventually you have to stop banging your head against the wall.
Ooh I love brackets

















