Today I finished my robotics project. I had in my team a total idiot (the one who used the hidden divs, some might remember from another rant). I wanted to share with you the beginning of a ranting adventure.

Me: "you can begin with a simple task. I will send you the obstacle avoidance sensors values from Arduino, and you will send the data for the Arduino motors to dodge the obstacle".

The sensors give 1 if clear, 0 if obstacle is detected.

Below is his code (which I brutally rewrote in front of him).

Now, in the final version of the robot we have something like 9 sensors of the same time to work with.
Imagine what would have happened if we kept him coding. (Guess it: 2^9 statements! :D)

I was not that evil, I tried to give him some chances to prove himself willing to improve. None of them were used rightfully.

I'm so fucking glad we finished. I'm not gonna see him anymore, even if I'd like to be a technical interviewer for hiring just to demolish him.

I'm not always that evil, I promise (?)

Ps. He didn't even have any idea on what JSON is, even if we had already seen it during FIVE YEARS of computer engineering. (And should've known anyway if he had a bit of curiosity for the stuff he "studies")

  • 3
    I feel sorry for this guy. I feel like if he knew how much simpler and easier he could do that, he might actually appreciate it.
  • 6
    @chadd17 When I rewrote the code in front of him I explained what I did and why. He did not send much feedback of appreciation... It was more "you're demolishing what I did" :/
  • 3
    [[[ sadness intensifies ]]]
  • 9
    Can you post your edition of code i want to learn how did you refactor his code.
  • 1
    @rabingaire I'll do it when I get home.
  • 2
    @magicleon Commeting for notification.I'd like to know the refactor aswell
  • 5
    Here's the version of the file that I wrote in front of him. Note that the response was replaced with a single constant relative to a motion, but that's not the point of course. The very same code with a little bit of editing was adapted to use 2 sonars on the sides of the robot, and 2 IR sensors on the grabbing system. If you're curious you can find everything on my github (nickname: magicleon94, file robot.py in the main root of the robotics2017 repository, in the "reactive(blah blah args)" function)
  • 2
    @magicleon Looks much better, good job
  • 2
    Wow new code is far better :) loved it :)
  • 2
    @magicleon I literally just learned the 'variable (boolean) = argument == value' statement by reading your code. Don't know why I never stumbled across this until now. Either way thanks for the inadvertent lesson!
Add Comment