709
submitted 10 months ago by lars@lemmy.sdf.org to c/memes@lemmy.ml
you are viewing a single comment's thread
view the rest of the comments
[-] morrowind@lemmy.ml 76 points 10 months ago

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

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

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

return false;

[-] ifGoingToCrashDont@lemmy.world 27 points 10 months ago

This looks good. PR approved.

[-] ApeNo1@lemm.ee 13 points 10 months ago

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

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

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

[-] tourist@lemmy.world 40 points 10 months ago
void dont() {
    fuckenNoseDiveLmao();
}
[-] r00ty@kbin.life 5 points 10 months ago* (last edited 10 months 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 10 months ago

this calls for a whiteboard

[-] lars@lemmy.sdf.org 3 points 10 months ago

Did a Japanese lunar probe write this?

[-] AnonTwo@kbin.social 12 points 10 months ago

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

[-] Viking_Hippie@lemmy.world 2 points 10 months ago

Or when your subscription to braking has lapsed.

[-] YIj54yALOJxEsY20eU@lemm.ee 4 points 10 months 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 10 months ago

That's what interns are for.

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

Memes

45753 readers
1139 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 5 years ago
MODERATORS