A good tool is not born on a drawing board, but out of a concrete annoyance. map.patchy.ch, my interactive route planner, came about exactly that way — and taught me more about clean programming along the way than any tutorial.
Why build my own map?
Existing map apps give rough suggestions, but I wanted to draw and measure a route exactly myself. For the Swiss map data I integrated the geo.admin API — the federal government's official geodata interface. That sounds simple until you realise that map tiles, projection and coordinate system all have to line up precisely. If one conversion is off, the drawn path suddenly sits a few metres away from the actual trail.
Where it hurts mathematically
The most instructive part was the distance calculation. When you work with floating-point numbers, you rarely get round results: a clean route quickly turns into a length like 666.67 instead of 666.7, because the computer can only approximate fractions such as 2000 divided by 3. Those tiny inaccuracies add up over many segments. I had to round deliberately, catch the rounding error in one single place and format values consistently, so the same route always returns the same result — and not a slightly different one on every reload.
Logic that does not guess
I know this precision from C. When a state there runs against a fixed value — say a threshold of 275 — a single character decides the behaviour: whether the condition checks for "greater than" or "greater than or equal". I needed exactly the same discipline for struktogramm.patchy.ch, my editor for Nassi-Shneiderman diagrams. Structograms represent program logic; if the branches and loops in the editor do not match the real logic exactly, the diagram is not just ugly, it is simply wrong.
Small, but complete
Both tools follow the same principle: one task, done properly. I would rather have a tool that fully masters drawing, measuring and exporting a route than ten half-features. Everything runs directly in the browser where possible, with no heavy back end, and loads instantly. Whatever I do not need, I deliberately leave out.
What makes projects like this so valuable is how directly they connect to practice: I am not reproducing an invented exercise, but solving a problem that bothers me personally. When the route length in map.patchy.ch suddenly differs by a metre after a reload, I notice immediately — because I use the tool myself. That kind of feedback from my own everyday use has taught me more about clean programming than any textbook.
From these projects I learned that the difference between "somehow works" and "works reliably" almost always lives in the details: in the one number, the one condition, the one edge case. You can find more projects on my projects page.