DEV Community

Philip Damwanza
Philip Damwanza

Posted on

2 Bugs That Made Me Question My Life Choices (And What They Actually Were)

  1. The Ant That Refused to Take the Shortest Path

Building lem-in, my ant colony pathfinding project. The algorithm kept sending ants down a longer route when a shorter one clearly existed. I spent hours convinced my BFS logic was fundamentally flawed.

The real cause: My "shortest" path check was quietly comparing path lengths before removing duplicate edges. The path wasn't actually shorter — it just looked shorter to a function that hadn't finished doing its job yet.

  1. The Marketplace Listing That Vanished Into the Void

The setup: Uploading a product photo to Cloudinary on the marketplace project, and the listing would save successfully — but the image field was just... empty. No errors. No warnings. Nothing.

The real cause: I was awaiting the wrong variable. The upload was finishing fine; I was just asking a different, unrelated promise how it felt about it.

Top comments (0)