499
Hilarious (lemmy.ml)
top 17 comments
sorted by: hot top controversial new old
[-] KidnappedByKitties@lemm.ee 35 points 3 months ago
[-] Rubanski@lemm.ee 8 points 3 months ago
[-] stevestevesteve@lemmy.world 44 points 3 months ago
[-] jaybone@lemmy.world 11 points 3 months ago

But that was before she set the requirement. I assume she meant from then on, and not since the beginning of time.

[-] someguy3@lemmy.ca 6 points 3 months ago

If they have eggs, get a dozen.

[-] Rubanski@lemm.ee 3 points 3 months ago

Wow that went over my head haha

[-] AWittyUsername@lemmy.world 29 points 3 months ago
[-] tja@sh.itjust.works 28 points 3 months ago

You should always check https://xkcd.com/1205/ first to see if it makes sense to automate something

[-] Zagorath@aussie.zone 17 points 3 months ago

Let's say it takes half a second to copy/paste and submit the message. That's 50 seconds saved, round it to one minute. You're only doing it once, so let's cross over to yearly. According to the Munroe Automation Scale, you can spend up to 5 minutes on it.

I'd say that code took about 1 minute to write. Maybe 2.

Result: do the automation.

[-] bisby@lemmy.world 7 points 3 months ago

Caveat: This is all written assuming the message is being written on a computer with a real keyboard. But if we're assuming this is written on a phone, then my analysis doesn't apply, but then again, writing a java program to execute in your messaging app is also a terrible idea. Which means we're suspending disbelief, so I choose to believe that a computer keyboard and shortcuts are available.

Type the phrase once. Select all. copy, paste, paste (the first paste replaces what you already have highlighted, the second paste adds a second copy). Now you have 2. Control + A, Control + C, Control + V.. Now you have 4.

It will take you only 7 cycles of this get 128*, you only need to copy/paste it one by one if you want to send each message separately. and even then, it's would purely be copy the original, then paste, send, paste, send, paste send, paste, send.

Assuming you can hold down control and just hit ACVV 7 times, that's 28 keystrokes. I'd bet I can get that done in 5 seconds or less (i tried it, it's less than that), so now I only save 5 seconds. Which means I only get 25 seconds to write the script. Which he chose to write in java for some reason?

[print("I'm sorry") for x in range(0, 100)] is actually a script I could write in less than 25 seconds.

*And I disagree with the "reason 4" given. She didn't say "exactly 100 times" she said "100 times before I forgive you" and to me, "before" implies >= and not ==. So if you drop it in 128 times, that exceeds the criteria. No one has ever rescinded forgiveness for receiving extra apologies.

[-] Huschke@programming.dev 3 points 3 months ago

I miss /r/theydidthemath

[-] FaceDeer@fedia.io 1 points 2 months ago

He must have to apologize to her a lot.

[-] Tja@programming.dev 13 points 3 months ago

Reason 5: she doesn't exist and you're bad at cropping

[-] python@programming.dev 9 points 3 months ago

I'll do you one better

function* sorry() { yield "I'm sorry"; }

Call sorry.next().value as many times as you need to baby, hell you can even use it in a for-of loop because Generator functions are Iterable. I fucking love JavaScript

[-] brian@programming.dev 5 points 3 months ago

lol that doesn't work either tho. it yields the string once and then is done. you still need a loop inside

[-] python@programming.dev 1 points 2 months ago

You're right! That's actually a really cool point about Generator functions too, them having while(true) loops is very unproblematic :D

I'm correcting myself to:

function* sorry() { while(true){ yield "I'm sorry"; } }

[-] Jakylla@sh.itjust.works 4 points 3 months ago

Twitter PR review

this post was submitted on 05 Apr 2024
499 points (94.3% liked)

Programmer Humor

18253 readers
1 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