72 points

Actually had a colleague who determined distances on microscopy images that way. She would measure the scale bar included in the image with her ruler on the screen, measure the distance she was interested in and calculate the distance using the rule of three. I mean, why bother using the measuring tool included in the software.

permalink
report
reply
46 points

I’ve heard of people printing out charts, then cutting out the part they wanted to calculate an integral of, then weighing the paper.

permalink
report
parent
reply
25 points

I’ve heard of it too. You would need an analytical balance to get accurate measurements weighing a piece of paper. Just cut out the part you want to take an integral of, then cut out a piece of paper with known size (or cut several pieces with different sizes to get more accurate results) and weigh each of them. I guess this used to be cheaper and faster than using computers when computers were big and expensive.

permalink
report
parent
reply
5 points

Or maybe just a powder balance. When I was a kid in the 1960s, Dad did a lot of reloading his own ammunition. We kids had fun doing things like weighing our names (weigh a small piece of paper to get the tare, weigh again to get the loaded weight, subtract) and other miniscule things. As I recall, it was accurate to less than a grain (0.065 gram).

One of the things we did was weigh different shapes of paper to calculate area. Start with a sample of a unit area. Cut out a funky shape and weigh it, then do the math.

permalink
report
parent
reply
11 points

Nono that’s genius

…ignoring the part that it’s just a discrete approximation of an integral a la a Riemann sum.

permalink
report
parent
reply
6 points

How thick is your paper?

permalink
report
parent
reply
11 points

How inaccurate is your scale?

permalink
report
parent
reply
5 points

I was reading an old book about chromatography in laboratory and they exactly describe this method to determine the amount of substance.

permalink
report
parent
reply
1 point

That was a common way to do it before computers were common.

permalink
report
parent
reply
1 point

That’s pretty clever!

permalink
report
parent
reply
11 points

If it works it isn’t stupid.

permalink
report
parent
reply
2 points

I’m guessing she didn’t make any zoom either

permalink
report
parent
reply
68 points

Better than counting curly braces.

permalink
report
reply
48 points

I’ll take the curly braces

permalink
report
parent
reply
28 points

Me too, any day. I hate everything where indentation matters. Let me just throw my garbage there and YOU sort it out, you are the fucking computer, not me. You do the work.

So fuck you, YAML! All my homies love JSON!

permalink
report
parent
reply
14 points

All your homies hate comments.

permalink
report
parent
reply
15 points

Yup.

Spaces? Tabs? Don’t care, works regardless.
Copied some code from somewhere else? No problem, 9/10 times it just works. Bonus: a smart IDE will let you quick-format the entire code to whatever style you configured at the click of a button even if it was a complete mess to begin with, as long as all the curly braces are correct.

Also, in any decent IDE you will very rarely need to actually count curly braces, it finds the pair for you, and even lets you easily navigate between them.

The inconsistent way that whitespace is handled across applications makes interacting with code outside your own code files incredibly finicky when your language cares so much about the layout.

There’s an argument to be made for the simplicity of python-style indentation and for its aesthetic merits, but IMO that’s outweighed by the practical inconvenience it brings.

permalink
report
parent
reply
1 point

But, nobody ever copies code from Stack Overflow!

permalink
report
parent
reply
27 points

Even vim can show you that
^(fucking nano user)

permalink
report
parent
reply

There’s a joke here about using echo "some python code" > main.py in here somewhere but I can’t find it. Imagine I did instead.

permalink
report
parent
reply
11 points
*

Import python.Joke.ShellProgramming()

permalink
report
parent
reply
9 points

“the punchline is clearly trivial, the set-up is left as an exercise for the reader”

permalink
report
parent
reply
6 points

Obligatory mirco is better.

permalink
report
parent
reply
11 points

Is mirco a little man sitting on your SSD flipping bits manually as you dictate him?

permalink
report
parent
reply
1 point
Deleted by creator
permalink
report
parent
reply
19 points

if you have to count the curly braces I understand why you are a python developer

permalink
report
parent
reply
8 points

You don’t usually count them. They just have to form a neat diagonal.

permalink
report
parent
reply
3 points

Also, highlighted the way you expect when you click next to braces works too.

permalink
report
parent
reply
7 points

parentheses

permalink
report
parent
reply
4 points

Why not both

permalink
report
parent
reply
4 points

Because Python uses indentation instead of curly brackets, which is why this meme exists. Also jetbrains ide s like pycharm and webstorm do all of this for you.

permalink
report
parent
reply
0 points

Even the mosy basic text editors does indentation for you, not even an IDE needed

permalink
report
parent
reply
2 points

yep.

permalink
report
parent
reply
1 point
Deleted by creator
permalink
report
parent
reply
1 point

Have you tried using an auto formatter? Let’s you write code however and fixes the structure automatically on save. It’s way easier for me to write curly braces then hit ctrl+s than have to select multiple lines manually and tab in and out. I feel the biggest gains I’ve made in productivity came after I learned to embrace tooling.

permalink
report
parent
reply
38 points

People here are taking this way too seriously lol. I love Python, and I never really had any issues with the indentation being used instead of curly braces or something. This is just a silly meme, not a personal attack

permalink
report
reply
13 points

Precisely. It’s like programmers lost their humor.

permalink
report
parent
reply
7 points

I have not known happiness for 12 years now.

permalink
report
parent
reply
3 points

Had humor? /s

permalink
report
parent
reply
6 points

Humor is hard for autists.

(Disclaimer: am autist)

permalink
report
parent
reply
8 points

I really like the identation aproach, or begin/end instead of curly braces or parenthesis. When people start to nest things too deep, it gets painful to look at.

permalink
report
parent
reply
8 points
*

Then you never had to share a codebase with someone who had different ideas about how things should be indented.

permalink
report
parent
reply
2 points

Hmmm nope. That sounds like hell indeed

permalink
report
parent
reply
5 points

Right? Especially since there are plugins for VS Code that colorize the indents.

permalink
report
parent
reply
13 points

VSCode? Is that an Emacs extension? Or is it for vi?

permalink
report
parent
reply
6 points

It’s a bash script made to be run on MS-DOS on a breadboard computer.

permalink
report
parent
reply
2 points

Sadly neither, but it’s Vi plugin is nearly perfect.

permalink
report
parent
reply
3 points

Oooh whats a good one called?

permalink
report
parent
reply
5 points

I’m not at my computer right now, but I think the one I use is called indent-rainbow.

permalink
report
parent
reply
33 points

Let me introduce you to YAML, you’ll love it!

permalink
report
reply
14 points

Ugh, there’s some parts of YAML I love, but ultimately it’s a terrible format. It’s just too easy to confuse people. At least it has comments though. It’s so dumb that JSON doesn’t officially have comments. I’ve often parsed “JSON” as YAML entirely for comments, without using a single other YAML feature.

YAML also supports not quoting your strings. Seems great at first, but it gets weird of you want a string that looks like a different type. IIRC, there’s even a major version difference in the handling of this case! I can’t remember the details, but I once had a bug happen because of this.

Performance wise, both YAML and JSON suck. They’re fine for a config file that you just read on startup, but if you’re doing a ton of processing, it will quickly show the performance hit. Binary formats work far better (for a generic one, protobuffers has good tooling and library support while being blazing fast).

permalink
report
parent
reply
8 points

It’s so dumb that JSON doesn’t officially have comments.

So much this.

Used to work at a company where I sometimes had to manually edit the configuration of devices which were written and read in JSON. Super inconvenient if you have to document all changes externally. As a “hack” I would sometimes add extra objects to store strings (the comments). But that’s super dicey as you don’t know if it somehow breaks the parsing. You’re also not guaranteed the order of objects so if the configuration gets read, edited and rewritten your comment might no longer be above/below the change you made.

Always found it baffling that such a basic feature is missing from a spec that is supposed to cover a broad range of use cases.

permalink
report
parent
reply
5 points

json 5 does support comments. alternatively, yaml is a superset of json. any valid json is also valid yaml. but yaml also supports comments. So you can also write json with comments, and use a yaml parser on it, instead of a standard json parser

permalink
report
parent
reply
5 points

One of these days I’ll actually look up how YAML indentation works. Every time I use it it’s trial and error until I stop getting errors.

permalink
report
parent
reply
2 points

That’s a super risky way to do it. It might stop giving you errors because you finally got the indentation right, or it might stop giving you errors because you got the indentation “right” but not how you you meant to organize the objects.

permalink
report
parent
reply
3 points

I got my hair torn out till I setup my home assistant. I f*cking hate it its stupid

permalink
report
parent
reply
28 points

@alphacyberranger
This is why I have my VSCodium set to highlight all indentation levels in my settings.json

To see the editor indent guides, set “editor.guides.indentation”: true and “editor.guides.highlightActiveIndentation”: true.

editorIndentGuide.background: Color of the editor indentation guides.
editorIndentGuide.activeBackground: Color of the active editor indentation guide.

https://code.visualstudio.com/api/references/theme-color

permalink
report
reply
1 point

Can you please share a screenshot of how this looks like?

permalink
report
parent
reply
2 points

@Toldry

Here’s the relevant section of my settings.json

json { "workbench.tree.renderIndentGuides": "always", "workbench.tree.indent": 15, "editor.guides.indentation": true, "workbench.colorCustomizations": { "editorIndentGuide.background": "#fd6bff", "tree.indentGuidesStroke": "#fd6bff" } }

@alphacyberranger

permalink
report
parent
reply

Programmer Humor

!programmer_humor@programming.dev

Create post

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics

Community stats

  • 5.3K

    Monthly active users

  • 1K

    Posts

  • 38K

    Comments