Day 214: 20% Work
Spent 14 hours coding today (been a while since I’ve done a mega coding session) mostly because I woke up at 2am, couldn’t fall back asleep, said “ok, fine” and then started working around 4:30am.
I was focused, but the work today was no fun at all.
Today’s work was of the “80% of effort for 20% results” variety (in case you’ve somehow managed to miss the billion productivity bloggers, authors, and podcasts who’ve harped on this, I’m referring to the Pareto principle which is the observation that 80% of effects come from 20% of the causes. With building products, the idea is that 20% of your time is spent building 80% of the product and the 80% is spent toiling away getting the last 20% done.)
I onboarded one of my friends yesterday, and one of the demo flows that I had him build bugged out. While recording his flow, he pressed Enter in a search box to load the results, but when replaying the flow, it didn’t work consistently.
I designed Browserflow so that people would have to do as little work as possible when creating their flows, and a big part of that is being able to detect what’s happening so that Browserflow waits appropriately. For example, if someone clicks a link, Browserflow should wait for the new page to load before proceeding. In my friend’s case, when he presses Enter, Browserflow should wait until the results appear before executing the next command.
The tricky part is that it’s really freaking hard to know what an action’s going to do . I might create a flow with a click, and it’s only when the click happens that I know that it opens a link. Even then, there’s usually a delay between the click and when the page starts navigating. Previously, I assumed that the delay between a user action and the start of a navigation would be short enough where checking immediately would work, but this turned out not to be the case some of the time.
As a result, you end up in a special circle of computer science hell called The Land of Race Conditions where stuff sometimes works and sometimes doesn’t based on your network speed, how your computer’s feeling that day, what you had for breakfast, and whether an albino alpaca sneezed within 3000 miles of you in the last 36 hours.
The problem with waiting to see whether a new page loads after a click or pressing a key is that you need to wait after every single click or keypress, which slows things down. If you try to minimize that delay, you’ll increase the chances that you’ll incorrectly continue when you should have detected a page load and waited.
I spent hours trying to figure out if there was a better solution but ended up deciding to have the user specify whether to wait for a new page to load. I’m not thrilled with this solution because it requires extra work on the part of the user and it’s easy to forget, but it’s better than having Satan laugh at me when things work 90% of the time but not always.
I ended up rolling back a lot of the changes I made related to the smart loading logic, which never feels good because it feels like you’re taking 10 steps back. And then I wrote a bunch of code that I later recognized as being just way too complicated.
After that, I got to work on a really fun problem where elements on Javascript heavy applications display for a split second before disappearing due to re-renders and I had to develop heuristics to know when elements are stable enough to interact with. So. Much. Fun!!!
Basically, today was lots of debugging, rolling back code, writing code that I later deleted, and generally feeling like this project is ridiculously big for just one measly engineer to work on.
I don’t know whether I should be thankful for my perfectionist engineering side for helping me slog through these sorts of bugs or not because maybe I’d have more fun working on making things look pretty with nice interactions rather than toiling away in the bowels of the automation architecture. But the thought of things working almost dependably but not quite is enough to literally keep me up at night.
The unfortunate part is that I’m up against the complexities of the Web, which means I already know how this story ends and it doesn’t look good for me. Now I am become [Sisyphus], the destroye[d] of the World [Wide Web].
That was terrible but I’m sleepy so give me a break gimme a break gimme a break of i’m losing my mind