this post was submitted on 03 Apr 2024
1312 points (100.0% liked)

Science Memes

15246 readers
712 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
[–] [email protected] 224 points 1 year ago* (last edited 1 year 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

[–] [email protected] 64 points 1 year 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.

[–] [email protected] 18 points 1 year ago

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

[–] [email protected] 12 points 1 year ago

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

[–] [email protected] 7 points 1 year 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)
[–] [email protected] 6 points 1 year ago

This. Always be kind to your future self.

[–] [email protected] 6 points 1 year ago* (last edited 1 year 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

[–] [email protected] 18 points 1 year 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

load more comments (1 replies)
[–] [email protected] 60 points 1 year 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.

[–] [email protected] 29 points 1 year ago

Autoformatter? More like obfuscator

[–] [email protected] 9 points 1 year ago

I genuinely hate being human for this stuff. So many things have such crazy computational shortcuts, it's sometimes difficult to remember which part represents reality. Outside of the realm of math, where "imaginary" numbers are still a touch of enigma to me, so many algorithms are based on general assumptions about reality or the specific task, that the programmatic approach NEVER encapsulates the full scope of the problem.

As in, sometimes if you know EXACTLY how a tool works, you might still have no idea about the significance of that tool. Even in a universe where no one is lazy, and everyone wants to know "why?", the answers are NOT forthcoming.

load more comments (3 replies)
[–] [email protected] 29 points 1 year ago

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

[–] [email protected] 28 points 1 year ago (1 children)

I, my head, shake.

  • RPN user
[–] [email protected] 6 points 1 year ago

Also known as: Japanese speaker

[–] [email protected] 23 points 1 year ago (1 children)
load more comments (1 replies)
[–] [email protected] 22 points 1 year ago (1 children)
[–] [email protected] 6 points 1 year ago (3 children)

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?

[–] [email protected] 10 points 1 year ago (2 children)

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.

load more comments (2 replies)
load more comments (2 replies)
[–] [email protected] 18 points 1 year ago* (last edited 1 year ago) (2 children)

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

load more comments (2 replies)
[–] [email protected] 18 points 1 year ago (2 children)

This is why every calculator should be a RPN calculator.

[–] [email protected] 5 points 1 year ago

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

load more comments (1 replies)
[–] [email protected] 14 points 1 year ago* (last edited 1 year ago) (10 children)

The underlying truth of this joke is: Programming syntax is less confusing than mathematical syntax. There are genuinely ambiguous layouts of syntax in math (to a human reader that hasn't internalized PEMDAS, anyways) whereas you get a compilation error if ANYTHING is ambiguous in programming. (yes, I am WELL aware of the frustrations of runtime errors)

[–] [email protected] 6 points 1 year ago (12 children)

Internalized PEMDAS without knowing it's literally the same thing as BODMAS is exactly the problem!

load more comments (12 replies)
load more comments (9 replies)
[–] [email protected] 12 points 1 year ago (1 children)
[–] [email protected] 5 points 1 year ago

( . ) ( . ) ( . Y . )

[–] [email protected] 12 points 1 year ago

Improved readability is always good

[–] [email protected] 9 points 1 year ago* (last edited 1 year ago) (3 children)

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

[–] [email protected] 8 points 1 year ago (2 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.

[–] [email protected] 5 points 1 year ago (2 children)

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

[–] [email protected] 4 points 1 year ago* (last edited 1 year ago) (1 children)

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.

load more comments (1 replies)
load more comments (1 replies)
load more comments (1 replies)
[–] [email protected] 4 points 1 year ago (1 children)

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.

load more comments (1 replies)
load more comments (1 replies)
[–] [email protected] 6 points 1 year ago* (last edited 1 year 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.

[–] [email protected] 9 points 1 year ago (1 children)

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

load more comments (1 replies)
load more comments (1 replies)
[–] [email protected] 5 points 1 year ago

I feel this in my bones

[–] [email protected] 4 points 1 year ago* (last edited 1 year 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)
[–] [email protected] 3 points 1 year ago (1 children)

Or, you know, you could simplify the terms?

[–] [email protected] 12 points 1 year ago

sounds like work for a compooter

load more comments
view more: next ›