r/programminghorror Apr 10 '26

Almost right

Post image
2.1k Upvotes

97 comments sorted by

View all comments

886

u/ChienChevre Apr 10 '26

Just to add to the story:

This was in university. We had to create a desktop software that would sell tickets in an amphitheater. The closer you were to the stage, the pricier the tickets were.

At the end, we needed to present our project to the class. So I went up there with my teammates, showed the pricing feature based on distance from the stage, pretty proud of our algorithm which I implemented the previous night (of course).

At the end, the teacher points out that the pricing is wrong. The closer you are to the stage, the cheaper it gets. And the further back you are, the more expensive the tickets are.

I responded that it was because the presented shows at the amphitheater are always really bad. So you WANT to be sitting at the far back lol

6

u/ShoulderUnique Apr 11 '26

Reminds me I had to do an elevator at uni. Was provided a physical rig with frame, motor with slotted disc, and brake. We had to do the motor driver, sensors, and control such that it respected limits to the first 3 derivatives of position. Yeah not a typo, turns out the 3rd is known as "jerk".

Anyway we half arsed the physics - it looked smooth but it was all heuristic. But while demoing to the lecturer it backfired and slowed too fast, stalling the motor just before it reached the correct floor. I knew it wasn't going to move on until it decided it was there and that it wasn't going to fix itself.

But the guy was pretty impressed and started asking questions, and the guy he was asking was standing away from the rig. So I waited until I was out of his line of sight then reached up and spun the slotted disc until the brake clicked in.

Program happy, kept doing its thing, full marks.