this post was submitted on 29 Jan 2024
707 points (98.0% liked)
Memes
44901 readers
4824 users here now
Rules:
- Be civil and nice.
- 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
view the rest of the comments
It's all fun and games until you have to implement
goingToCrashIntoEachOther()
// TODO: needs improvements but works 99% of the time
return false;
This looks good. PR approved.
return (staticCrashCounter++ % 100 == 0 ? true : false);
To improve that, you could get rid of the comment to save space.
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!
this calls for a whiteboard
Did a Japanese lunar probe write this?
You leaked the code for when it's out of warranty
Or when your subscription to braking has lapsed.
Love me some clean code. Just please don't look at the function definition or ever expect me to change my pyramid of abstractions.
That's what interns are for.