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.
The lengths we have to go to
Submitted 1 year ago by alphacyberranger@sh.itjust.works to programmer_humor@programming.dev
https://sh.itjust.works/pictrs/image/e6791cc8-2cd3-44e0-828c-db41f5dd29ff.webp
Comments
Rhllor@feddit.de 1 year ago
sznio@lemmy.world 1 year 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 1 year 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.
SkyeStarfall@lemmy.blahaj.zone 1 year ago
Nono that’s genius
…ignoring the part that it’s just a discrete approximation of an integral a la a Riemann sum.
Quereller@lemmy.one 1 year ago
I was reading an old book about chromatography in laboratory and they exactly describe this method to determine the amount of substance.
Liz@midwest.social 1 year ago
That was a common way to do it before computers were common.
PixxlMan@lemmy.world 1 year ago
That’s pretty clever!
cybervseas@lemmy.world 1 year ago
If it works it isn’t stupid.
thedolanduck@lemmy.zip 1 year ago
I’m guessing she didn’t make any zoom either
gerryflap@feddit.nl 1 year 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 1 year ago
Precisely. It’s like programmers lost their humor.
DarkenLM@kbin.social 1 year ago
I have not known happiness for 12 years now.
calzone_gigante@lemmy.world 1 year 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 1 year ago
The, you never had to share a codebase with someone who had different ideas about how things should be indented.
gerryflap@feddit.nl 1 year ago
Hmmm nope. That sounds like hell indeed
amanaftermidnight@lemmy.world 1 year 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 you’re not being pythonic. Nesting too deep is the problem, not the significant whitespacing.
UlrikHD@programming.dev 1 year 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.
joey_moey@feddit.dk 1 year ago
Yeah I remember picking up a script after a reinstall, and gedit had reverted to default settings. It’s fun trying to spot whether it’s 1 tab or 4 spaces. After that day, I switched to two spaces as my default.
JonEFive@midwest.social 1 year ago
This post on programmer humor is now funnier as a result of your analysis. Everything is funnier when it is 100% accurate.
mexicancartel@lemmy.dbzer0.com 1 year ago
Why not TABs? I hate 4 spaces cuz it can get real messy sometimes.
CoderKat@lemm.ee 1 year ago
I normally love tabs and it’s what Go uses both by convention and it’s semi opinionated formatter. But PEP-8 suggests spaces and ultimately, consistency is more important.
Not having to argue about tabs vs spaces lets us focus on the real problems, like vim vs emacs.
amanaftermidnight@lemmy.world 1 year ago
My editor turns tabs into 4 spaces. No more “mixing tabs and spaces” errors afterwards.
pamymaf@kbin.run 1 year ago
@alphacyberranger
This is why I have my VSCodium set to highlight all indentation levels in my settings.jsonTo 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.Toldry@lemmy.world 1 year ago
Can you please share a screenshot of how this looks like?
pamymaf@kbin.run 1 year ago
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" } }
Attachment: media.kbin.run ↗
UrbonMaximus@feddit.uk 1 year ago
Let me introduce you to YAML, you’ll love it!
CoderKat@lemm.ee 1 year 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 1 year 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.
vrighter@discuss.tchncs.de 1 year ago
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
lhamil64@programming.dev 1 year ago
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.
merc@sh.itjust.works 1 year ago
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.
dansity@lemmy.dbzer0.com 1 year ago
I got my hair torn out till I setup my home assistant. I f*cking hate it its stupid
knobbysideup@lemm.ee 1 year 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 1 year 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.
lemmylommy@lemmy.world 1 year ago
That was interesting. And possibly the most Dutch name I have ever heard of.
mexicancartel@lemmy.dbzer0.com 1 year ago
Use TABS guys TABS.
AntEater@discuss.tchncs.de 1 year ago
Tabs suck. Use a real editor and spaces work fine.
beckerist@lemmy.world 1 year ago
spaces or tabs
reflex@kbin.social 1 year ago
Doesn't PEP 8 say spaces somewhere?
UlrikHD@programming.dev 1 year 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 1 year ago
Tabs. But really with modern IDE it’s irrelevant. Whatever the tech lead says I guess.
GBU_28@lemm.ee 1 year 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
RogueBanana@lemmy.zip 1 year ago
Yeah but outside of that where the code is implemented or in a documentation, tabs are still easier to look through. And it does look pretty as long as there aren’t too many nested functions.
Ocelot@lemmies.world 1 year ago
Wuestions like that are likely to start a war
Jakylla@sh.itjust.works 1 year ago
4 Spaces, then one tab, then 3 spaces, then 2 tabs, then 2 spaces, then 3 tabs…
Python supports that (and I hate this)
grozzle@lemm.ee 1 year ago
“indentation is indentation!” (mr_incredible_cereal.jpg)
it may look messy, but would you actually rather Python didn’t support some inconsistency when the intent is clear?
being exact just for the sake of being pedantic isn’t useful.
somegeek@programming.dev 1 year ago
Python syntax is the absolute worst
lemmyingly@lemm.ee 1 year ago
Why do you believe that?
thepianistfroggollum@lemmynsfw.com 1 year ago
And God forbid you use tabs in a document with spaces instead of tabs (or vice versa)
radix@lemm.ee 1 year ago
:retab
is your friend!
RoyaltyInTraining@lemmy.world 1 year 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.
embit@feddit.de 1 year ago
He could wrap a rubber band around the screen
some_guy@lemmy.sdf.org 1 year ago
I started with Perl. This taught me a certain mindset that works well with Bash and Ruby. I’ve tried to learn Python several times and I just fucking hate it. I gave up when I realized that it just doesn’t work the way that my brain works.
I wonder if the outcome would have been different if I’d started with Python? How might that have shaped my thinking / reasoning? Fwiw, I was also ok with PHP and SQL, but I don’t know much or anything about the backgrounds on those foundations. Maybe my above statements were completely bullshit.
pinkdrunkenelephants@sopuli.xyz 1 year ago
And that is why I don’t bother with that garbage. C++ for life
GlitchSir@lemmy.world 1 year ago
Just draw whitespace…
ipha@lemm.ee 1 year ago
Better than counting curly braces.
sentient_loom@sh.itjust.works 1 year ago
I’ll take the curly braces
TheGreenGolem@lemm.ee 1 year 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!
wols@lemm.ee 1 year 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.
30p87@feddit.de 1 year ago
Even vim can show you that
^(fucking nano user)
UndefinedIsNotAFunction@programming.dev 1 year ago
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.Overshoot2648@lemm.ee 1 year ago
Obligatory mirco is better.
kameecoding@lemmy.world 1 year ago
if you have to count the curly braces I understand why you are a python developer
Knusper@feddit.de 1 year ago
You don’t usually count them. They just have to form a neat diagonal.
Reptorian@programming.dev 1 year ago
Also, highlighted the way you expect when you click next to braces works too.
cerement@slrpnk.net 1 year ago
parentheses
shotgun_crab@lemmy.world 1 year ago
Why not both
EvokerKing@lemmy.world 1 year ago
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.
vosjedev@lemm.ee 1 year ago
yep.
fidodo@lemm.ee 1 year ago
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.