710
submitted 2 years ago by lars@lemmy.sdf.org to c/memes@lemmy.ml
top 26 comments
sorted by: hot top controversial new old
[-] morrowind@lemmy.ml 76 points 2 years ago

It's all fun and games until you have to implement goingToCrashIntoEachOther()

[-] lobelia581@lemmy.dbzer0.com 65 points 2 years ago* (last edited 2 years ago)

// TODO: needs improvements but works 99% of the time

return false;

[-] ifGoingToCrashDont@lemmy.world 27 points 2 years ago

This looks good. PR approved.

[-] ApeNo1@lemm.ee 13 points 2 years ago

return (staticCrashCounter++ % 100 == 0 ? true : false);

[-] Scubus@sh.itjust.works 10 points 2 years ago

To improve that, you could get rid of the comment to save space.

[-] tourist@lemmy.world 40 points 2 years ago
void dont() {
    fuckenNoseDiveLmao();
}
[-] r00ty@kbin.life 5 points 2 years ago* (last edited 2 years ago)

Well I think goingToCrashIntoEachOther needs to return another drone object. Then don't can take that object. Based on self.serialNo and other.serialNo a mutually beneficial avoiding manoeuvre could be executed.

If you're about to crash into more than one other drone.. Good luck the function specifies "EachOther" meaning just one other drone!

[-] tourist@lemmy.world 3 points 2 years ago

this calls for a whiteboard

[-] lars@lemmy.sdf.org 3 points 2 years ago

Did a Japanese lunar probe write this?

[-] AnonTwo@kbin.social 12 points 2 years ago

You leaked the code for when it's out of warranty

[-] Viking_Hippie@lemmy.world 2 points 2 years ago

Or when your subscription to braking has lapsed.

[-] YIj54yALOJxEsY20eU@lemm.ee 4 points 2 years ago

Love me some clean code. Just please don't look at the function definition or ever expect me to change my pyramid of abstractions.

[-] AnUnusualRelic@lemmy.world 2 points 2 years ago

That's what interns are for.

[-] iAvicenna@lemmy.world 56 points 2 years ago

for the person who wrote that "coding and algorithms" is the same as "magic and alchemy"

[-] sxan@midwest.social 45 points 2 years ago
if (launch) {
   landOnMoon()
}

What's so hard, Japan?!? Sheesh.

[-] IndiBrony@lemmy.world 21 points 2 years ago

Hey, the code was executed perfectly. The orientation wasn't defined!

[-] sxan@midwest.social 4 points 2 years ago

You could even say it self-optimized and saved fuel by not decelerating!

[-] r00ty@kbin.life 19 points 2 years ago

I think they call algorithms AI these days. At least I caught one of our VPs saying that a few months ago.

[-] haui_lemmy@lemmy.giftedmc.com 5 points 2 years ago

I think the vast majority of people has no idea how coding works, doesnt know what an algorithm does and is oblivious to the fact that AI isnt everything its hyped to be.

[-] ChickenLadyLovesLife@lemmy.world 2 points 2 years ago

I had a manager 10 years ago tell me we should start using these "API" things he had just read about. A conspicuously non-technical manager, obviously.

[-] majestic@sh.itjust.works 35 points 2 years ago
[-] twoshoes@lemmy.world 26 points 2 years ago* (last edited 2 years ago)

I work in IT. My boss is by all accounts very competent in both programming and administration, yet all his documentation basically says "remember to set DoTheRightThing=True"

Edit: I just looked up the documentation for an internal service and under "Error recovery" it just says "The output of command xy should make sense". fml

[-] r00ty@kbin.life 19 points 2 years ago

#pragma OccasionallyCrash false

[-] xthexder@l.sw0.com 8 points 2 years ago

Damn, I must've been missing this in my code the whole time.

Not even joking, I've got a project that crashes the MSVC linker with "Internal compiler error occurred" like 1 out of every 5 builds.

[-] r00ty@kbin.life 6 points 2 years ago

Back in the olde days of programming (I'm talking about compilers from the 80s) the coding connoisseur knew that getting a certain error that seemed like nonsense could easily be solved by adding an extra, or removing a remark line from the top of the code and recompiling.

this post was submitted on 29 Jan 2024
710 points (98.0% liked)

Memes

51691 readers
1947 users here now

Rules:

  1. Be civil and nice.
  2. Try not to excessively repost, as a rule of thumb, wait at least 2 months to do it if you have to.

founded 6 years ago
MODERATORS