Well, I’m stuck… I felt like I’d made great progress on the EPIC side and that I had things fairly nicely decoupled, but then I went to implement the same thing on the Poker side, and whoops, circular dependencies because of one function that I need in the room!
I’m actually taking this as a sign that it is not decoupled well, but if it’s not (and even if it is), I’m stuck without changing Poker. The only other thing I can think of to do is have the client-side make all the calls through the websocket, but even that would be kind of ugly with poker code throughout several namespaces in EPIC and client-app code thoroughly throughout poker when it comes Poker’s turn to send data to EPIC.
Circular dependencies are one of those problems that feel personal. The code is telling you something about how you organized your thinking, and you do not want to hear it. In my case, the issue was that EPIC and Poker both needed to talk to each other, but neither was designed with a clean boundary between them. One function in the room namespace was the thread pulling the whole sweater apart.
This is exactly the kind of thing that refactoring exists to solve, but it is also the kind of refactoring that feels risky when you do not have good test coverage to catch what breaks. The lesson I keep re-learning is that coupling problems are design problems, and design problems do not fix themselves by adding more code on top. You have to go back and restructure, which means accepting that the progress you thought you made was actually just velocity in the wrong direction.
In hindsight, this was a turning point. Getting stuck here forced me to think about architecture differently -- about interfaces between systems, about which side should own the communication, and about the cost of taking shortcuts early. The HTTP linking challenge that came later was essentially the same lesson, just wearing different clothes.
Rex & Leo:
All my boys are back home now after their exciting & busy weekend up north. They landed last night just before midnight and got home around 1am, so they were tired today.
They came home much more grown up than when they’d left. It’s amazing how much change takes place in just four days when you’re in your toddler years. Leo came back pronouncing words much more clearly and had picked up several new words--he got very frustrated with me this evening though, when I couldn’t understand a word he wanted me to draw on his chalkboard--that was an event.
And Rex’s speech fluidized tremendously over the four days. To be able to see/hear a change in just those short days is very eye-opening as to how much they change each day.