Submitted by TheManNamedPeterPan t3_z8c5vf in explainlikeimfive
Cypher1388 t1_iyc76hc wrote
Reply to comment by DecentChanceOfLousy in ELI5 why we first multiply, then add by TheManNamedPeterPan
I live in excel for work... Color coded parentheses ftw
... Seriously though, I probably use more than I need to, but they reduce ambiguity to a point that any loss of immediate readability is a sacrifice worth making imo
the_running_stache t1_iyc8r0r wrote
As a financial engineer, I write a lot of mathematical code. I, too, use more parentheses than I need to, but they reduce ambiguity to the next person reading the code. Long love parentheses!
DecentChanceOfLousy t1_iydvi3w wrote
Yup. Programming languages or technical formulas end up having so many parenthesis that most editors support color coding or matched pair highlighting so you can sort out which is which. And you'd need more if every operation had to have parenthesis around it to clarify which order it's supposed to be done in. If you kept the left-to-right convention (despite throwing other conventions which are no more arbitrary away), you could reorder some things to remove a bit of the confusion. But it wouldn't help nearly as much as every symbol having an order of operations so you skip as many parenthesis as possible while remaining unambiguous.
[deleted] t1_iyc7x79 wrote
[removed]
Viewing a single comment thread. View all comments