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

Memes

46031 readers
2570 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
 
top 26 comments
sorted by: hot top controversial new old
[–] [email protected] 73 points 11 months ago (5 children)

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

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

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

return false;

[–] ifGoingToCrashDont 26 points 11 months ago

This looks good. PR approved.

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

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

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

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

[–] tourist 39 points 11 months ago (2 children)
void dont() {
    fuckenNoseDiveLmao();
}
[–] [email protected] 5 points 11 months ago* (last edited 11 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 11 months ago

this calls for a whiteboard

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

Did a Japanese lunar probe write this?

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

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

[–] Viking_Hippie 3 points 11 months ago

Or when your subscription to braking has lapsed.

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

That's what interns are for.

[–] iAvicenna 55 points 11 months ago (2 children)

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

[–] [email protected] 45 points 11 months ago (1 children)
if (launch) {
   landOnMoon()
}

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

[–] IndiBrony 21 points 11 months ago (1 children)

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

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

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

[–] [email protected] 19 points 11 months ago (2 children)

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

[–] [email protected] 5 points 11 months 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 2 points 11 months 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.

[–] [email protected] 35 points 11 months ago (1 children)
[–] bruhduh 26 points 11 months ago
[–] twoshoes 26 points 11 months ago* (last edited 11 months ago) (1 children)

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

[–] [email protected] 19 points 11 months ago (1 children)

#pragma OccasionallyCrash false

[–] [email protected] 8 points 11 months ago (1 children)

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.

[–] [email protected] 6 points 11 months 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.