48

Normal person in an elevator:
- gets in
- pushes the floor number
- patiently waits
- gets out

Programmer in an elevator:
- gets in
- pushes the floor number
- thinks about how elevators are programmed, what the data structures would look like.
- regrets his life decisions 😂
- gets out

Comments
  • 6
    Controls Engineer:

    In an application that could literally rip your arm off if done wrong. No, I would use an industrial controller such as a safety significant PLC. One that even an idiot could troubleshoot. The data structures would be literally bits on or off. Over-complicating a system like that would kill someone.
  • 3
    I think I would think a while about all the production code I've seen on the way to the elevator and how it probably runs on java despite the fact that it could be written in ASM in an hour, and finally decide to take the stairs instead. I haven't done all that much sports recently anyway.
  • 2
    @Lor-inc great, I now have elevaphobia! Nicely done! 😉
  • 0
    i'd do
    bool[numOfFloors, 2]

    the second dimension being: one bit for "go to this floor and stop on it if you're below and/or going up", the other one "go to this floor and stop on it if you're above and/or going down".
Add Comment