this post was submitted on 29 Jan 2024
701 points (98.2% liked)

Memes

45661 readers
171 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
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 73 points 9 months ago (5 children)

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

[–] [email protected] 62 points 9 months ago* (last edited 9 months ago) (3 children)

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

return false;

[–] ifGoingToCrashDont 26 points 9 months ago

This looks good. PR approved.

[–] [email protected] 11 points 9 months ago

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

[–] [email protected] 9 points 9 months ago

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

[–] tourist 39 points 9 months ago (2 children)
void dont() {
    fuckenNoseDiveLmao();
}
[–] [email protected] 5 points 9 months ago* (last edited 9 months ago) (1 children)

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 3 points 9 months ago

this calls for a whiteboard

[–] [email protected] 3 points 9 months ago

Did a Japanese lunar probe write this?

[–] [email protected] 10 points 9 months ago (1 children)

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

[–] Viking_Hippie 3 points 9 months ago

Or when your subscription to braking has lapsed.

[–] [email protected] 4 points 9 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 2 points 9 months ago

That's what interns are for.