718
I dunno (piefed.cdn.blahaj.zone)
you are viewing a single comment's thread
view the rest of the comments
[-] jjjalljs@ttrpg.network 46 points 2 days ago

I got some people really angry at me when I suggested writing some math expression with parenthesis so it would be clearer. I think someone told me that order of operations is like a natural law and not a convention, and thus everyone should know it or be able to figure it out.

[-] stray@pawb.social 17 points 2 days ago

I sometimes like to add unnecessary parentheses or brackets to section things off and improve legibility, but I don't do any math stuff collaboratively, so I have no idea whether others would find that disruptive or helpful.

[-] Feathercrown@lemmy.world 5 points 2 days ago

I do this, sometimes it helps reveal a natural pattern when some parts of earlier terms have "disappeared" to simplification

[-] Alaknar@sopuli.xyz 11 points 2 days ago

I mean, there are very few ambiguous cases when you know how the order of operations works.

[-] Quatlicopatlix@feddit.org 5 points 2 days ago

Using parenthesis can really help if you want to simplify a term or need to rewrite something. I do that all the time because a lot of times you then can just cross stuff out fast on equations or get a common term that just has some factor instead of having a convolutet equation.

[-] merc@sh.itjust.works 5 points 2 days ago

I got really angry because the prettier code formatter insists on removing parentheses, making things less clear. Because it's an "opinionated" formatter you can't tell it not to do that without using ugly hacks.

Sure, logically there are times when you don't need them. But, often it helps to explain what's happening in the code when you can use parentheses to group certain things. It helps in particular when you want to use "&&" and "||" to say "do X only if Y fails".

[-] jjjalljs@ttrpg.network 5 points 2 days ago

I think you can do // prettier-ignore, because I remember facing that exact situation.

https://prettier.io/docs/ignore/

[-] merc@sh.itjust.works 2 points 2 days ago

I've done that, but that's ugly.

[-] 87Six@lemmy.zip 1 points 2 days ago

Me trying to write clearer code at work..

this post was submitted on 27 Nov 2025
718 points (91.3% liked)

Science Memes

17472 readers
2916 users here now

Welcome to c/science_memes @ Mander.xyz!

A place for majestic STEMLORD peacocking, as well as memes about the realities of working in a lab.



Rules

  1. Don't throw mud. Behave like an intellectual and remember the human.
  2. Keep it rooted (on topic).
  3. No spam.
  4. Infographics welcome, get schooled.

This is a science community. We use the Dawkins definition of meme.



Research Committee

Other Mander Communities

Science and Research

Biology and Life Sciences

Physical Sciences

Humanities and Social Sciences

Practical and Applied Sciences

Memes

Miscellaneous

founded 2 years ago
MODERATORS