this post was submitted on 03 Apr 2024
1332 points (98.8% liked)

Science Memes

16919 readers
2729 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
 
top 50 comments
sorted by: hot top controversial new old
[–] rockerface@lemm.ee 227 points 2 years ago* (last edited 2 years ago) (7 children)

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

[–] dustyData@lemmy.world 65 points 2 years ago (6 children)

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.

[–] zalgotext@sh.itjust.works 18 points 2 years ago

Exactly. You read code way more times than you write it, so it makes all the sense in the world to prioritize readability.

[–] Swedneck@discuss.tchncs.de 13 points 2 years ago

Source code is for humans, then the compiler turns it into code for machines.

[–] oce@jlai.lu 7 points 2 years ago (2 children)

Python forcing end of line and tabs kinda does. Add Black auto-formatter and it's pretty good.

load more comments (2 replies)
[–] rockerface@lemm.ee 6 points 2 years ago* (last edited 2 years ago) (1 children)

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

[–] Mic_Check_One_Two@reddthat.com 20 points 2 years ago

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

[–] feinstruktur@lemmy.ml 5 points 2 years ago

This. Always be kind to your future self.

load more comments (1 replies)
[–] Quetzalcutlass@lemmy.world 59 points 2 years ago (1 children)

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.

[–] rockerface@lemm.ee 29 points 2 years ago

Autoformatter? More like obfuscator

load more comments (3 replies)

Also works if you dont trust yourself with correctly ordering your operations.

[–] mathic@lemmy.world 29 points 2 years ago (1 children)

I, my head, shake.

  • RPN user
[–] rockerface@lemm.ee 6 points 2 years ago

Also known as: Japanese speaker

[–] Qkall@lemmy.ml 24 points 2 years ago (6 children)
load more comments (6 replies)
[–] ASeriesOfPoorChoices@lemmy.world 24 points 2 years ago (1 children)
load more comments (1 replies)
[–] Omega_Haxors@lemmy.ml 19 points 2 years ago* (last edited 2 years ago) (2 children)

(I used(LISP)one time(and it(permanently))changed the way I (program(computers)))

load more comments (2 replies)
[–] SmoothLiquidation@lemmy.world 17 points 2 years ago (2 children)

This is why every calculator should be a RPN calculator.

[–] lemmyng@lemmy.ca 5 points 2 years ago

I still have my HP 48 series calculator. It's a sturdy beast.

load more comments (1 replies)
[–] MeDuViNoX@sh.itjust.works 11 points 2 years ago (1 children)

( . ) ( . ) ( . Y . )

[–] Voyajer@lemmy.world 11 points 2 years ago

Improved readability is always good

[–] FatTony@lemmy.world 7 points 2 years ago* (last edited 2 years ago) (4 children)

My calculator says -2² = -4, so yeah...

[–] ByGourou@sh.itjust.works 7 points 2 years ago (5 children)

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.

load more comments (5 replies)
load more comments (3 replies)
[–] Lemmy_Cook@lemmy.world 5 points 2 years ago

I feel this in my bones

[–] lolcatnip@reddthat.com 5 points 2 years ago* (last edited 2 years ago) (3 children)

I've never seen a calculator that had bracket keys but didn't implement the conventional order of operations.

But anyway, I'm on Team RPN.

[–] isolatedscotch@discuss.tchncs.de 9 points 2 years ago (1 children)

my dumb ass reading this: "Team rock paper nscissors"

load more comments (1 replies)
load more comments (1 replies)
[–] EunieIsTheBus@feddit.de 4 points 2 years ago* (last edited 2 years ago) (1 children)

I recall that there is a myriad of memes of the form 'what is 4-2*3' under which there is always a never ending discussion of confidently incorrect dumbasses denying the existence of the multiplication before addition rule.

So your suspicion is at least not unreasonable

load more comments (1 replies)
load more comments
view more: next ›