1211
top 50 comments
sorted by: hot top controversial new old
[-] Rhllor@feddit.de 66 points 10 months ago

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.

[-] sznio@lemmy.world 39 points 10 months ago

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

[-] siipale@sopuli.xyz 20 points 10 months ago

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.

[-] jadero@programming.dev 5 points 10 months ago

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.

[-] SkyeStarfall@lemmy.blahaj.zone 10 points 10 months ago

Nono that's genius

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

[-] w2qw@aussie.zone 6 points 10 months ago
[-] jcg@halubilo.social 10 points 10 months ago

How inaccurate is your scale?

load more comments (2 replies)
load more comments (3 replies)
[-] cybervseas@lemmy.world 11 points 10 months ago

If it works it isn't stupid.

load more comments (1 replies)
[-] ipha@lemm.ee 65 points 10 months ago

Better than counting curly braces.

[-] sentient_loom@sh.itjust.works 40 points 10 months ago

I'll take the curly braces

[-] TheGreenGolem@lemm.ee 20 points 10 months ago

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!

load more comments (2 replies)
[-] wols@lemm.ee 15 points 10 months ago

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.

load more comments (1 replies)
[-] 30p87@feddit.de 27 points 10 months ago

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

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.

[-] thanevim@kbin.social 10 points 10 months ago* (last edited 10 months ago)

Import python.Joke.ShellProgramming()

load more comments (1 replies)
[-] Overshoot2648@lemm.ee 6 points 10 months ago

Obligatory mirco is better.

[-] 30p87@feddit.de 11 points 10 months ago

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

load more comments (1 replies)
load more comments (1 replies)
[-] kameecoding@lemmy.world 11 points 10 months ago

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

[-] cerement@slrpnk.net 7 points 10 months ago

parentheses

[-] Knusper@feddit.de 7 points 10 months ago

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

load more comments (1 replies)
load more comments (8 replies)
[-] gerryflap@feddit.nl 37 points 10 months ago

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

[-] alphacyberranger@sh.itjust.works 13 points 10 months ago

Precisely. It's like programmers lost their humor.

[-] DarkenLM@kbin.social 7 points 10 months ago

I have not known happiness for 12 years now.

load more comments (2 replies)
[-] calzone_gigante@lemmy.world 8 points 10 months ago

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.

[-] merc@sh.itjust.works 8 points 10 months ago* (last edited 10 months ago)

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

load more comments (1 replies)
load more comments (8 replies)
[-] UrbonMaximus@feddit.uk 33 points 10 months ago

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

[-] CoderKat@lemm.ee 14 points 10 months ago

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).

[-] sonnenzeit@feddit.de 8 points 10 months ago

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.

load more comments (1 replies)
load more comments (3 replies)
[-] pamymaf@kbin.run 24 points 10 months ago

@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

load more comments (2 replies)
[-] amanaftermidnight@lemmy.world 15 points 10 months ago* (last edited 10 months ago)

Most disingenuous post ever.

The image shown is a dude with a browser dev console, probably measuring a div for the its CSS size (which do support centimeters and inches).

In python, 4 spaces is just enough spacing between indent levels. And if your levels get too deep it's a sign that you're not being pythonic. Nesting too deep is the problem, not the whitespacing being significant.

[-] UlrikHD@programming.dev 8 points 10 months ago

Python are fine with whatever number of spaces you want to use. You can use 8 spaces which forces you carefully consider each nest, you can use 1 if you're a monster, or you can use tabs if you're enlightened, python only demands consistency.

load more comments (2 replies)
load more comments (6 replies)
[-] beckerist@lemmy.world 14 points 10 months ago
[-] reflex@kbin.social 15 points 10 months ago* (last edited 10 months ago)

Doesn't PEP 8 say spaces somewheres?

[-] UlrikHD@programming.dev 10 points 10 months ago

4 spaces, although I'll die on the hill that tabs should always be used instead of space for indentation. Not just in python.

[-] GandarfDeGrape@midwest.social 12 points 10 months ago

Tabs. But really with modern IDE it's irrelevant. Whatever the tech lead says I guess.

[-] GBU_28@lemm.ee 6 points 10 months ago

With things like black, flake 8 and Isort I can code however I want, list/format however I want, and commit team compliant content. The dream is real

load more comments (3 replies)
load more comments (2 replies)
[-] kevincox@lemmy.ml 10 points 10 months ago
  1. Use tabs.
  2. Enable visible whitespace.

Tada, your indentation level is nicely visible.

[-] Ocelot@lemmies.world 5 points 10 months ago* (last edited 10 months ago)

Questions like that are likely to start a war

load more comments (7 replies)
[-] knobbysideup@lemm.ee 12 points 10 months ago* (last edited 10 months ago)

Programming languages that use white space to delimit structure are annoying at best. I get annoyed at yaml too, but I'm ok once I have a few templates set up.

[-] corytheboyd@kbin.social 18 points 10 months ago

YAML comes with its own unique pains in the ass https://ruudvanasseldonk.com/2023/01/11/the-yaml-document-from-hell

These things actually matter, come up often enough to actually be annoying, and are a bit difficult to explain and learn into people. You’re basically fine if you just string quote everything that you can, but nobody does that.

load more comments (7 replies)
[-] thepianistfroggollum@lemmynsfw.com 12 points 10 months ago

And God forbid you use tabs in a document with spaces instead of tabs (or vice versa)

load more comments (1 replies)
[-] embit@feddit.de 9 points 10 months ago

He could wrap a rubber band around the screen

load more comments (1 replies)
[-] RoyaltyInTraining@lemmy.world 9 points 10 months ago

I don't think this is a huge problem with a correctly set up text editor and the right techniques to limit code nesting. Doesn't change my dislike of python tho.

load more comments
view more: next ›
this post was submitted on 05 Sep 2023
1211 points (97.3% liked)

Programmer Humor

18292 readers
1365 users here now

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

founded 1 year ago
MODERATORS