Gen AI, Developers, Chess Engines & Software Architecture: A Sunday Ramble
2026-02-01en4 minhandwritten
I’m implementing a chess engine as a personal project (here, nothing fancy, it’s just for fun). It started as a “vibes coding project”, after the success of another “project” I made a couple of months ago, a mini-games website I built and deployed with Next.js and Vercel in a couple of days.
I had to abandon it pretty quickly (so much for “programmers will be unemployed by next year”) when generating a couple of moves started taking several seconds (not even that smart ones, I was at the start of the “project”). Note: This was almost a year ago. Time flies when we’re talking about AI models, so they’ve improved, but the training data is scarce anyway, so I am not sure now.
Given that, I decided to do the exact opposite: a project without vibe coding.

Use AI only as a “reinforced Google”—asking concrete things like C++ syntax, information about C++ frameworks, and the performance difference between various possible implementations.
I have to say it worked. Reading a couple of articles, I discovered bitboards, chess programming wiki and this amazing tutorial online Bitboard CHESS ENGINE in C by Code Monkey King that explains piece by piece, without implementing everything at once, like I was vibes coding (and for learning, that’s gold because you understand everything you’re doing).
Actually, I wanted to start the article by talking about the commit that gave me the idea of how to start writing this. My code had two main classes: Chessboard and Engine. The first was supposed to be a “dumb” representation of a chessboard, holding the board logic, the bitboards, whose turn it is, basically the board status and other utilities. The other was supposed to be the thinking heart that generated moves and decided which ones to make.
My initial “architecture” consisted of keeping these two classes completely separate, a sort of two bounded contexts. At the beginning, I didn’t have a clear idea of what and how I wanted to do everything, so this separation idea was wrong.

There were problems with this separation right away. The engine needs to know what’s on the board at any given moment. To work around this, I created a ChessBoardStatus class that contained all the board information. Smart move, or so I thought.

Of course, without realising it, I ended up with thousands of lines of code and a super dependency on the status. And, this went fine until I implemented the makeMove function, then it was obvious something wasn’t right. Then the enlightenment hit: of course, something was wrong. How could two completely separate classes work well together? It’s obvious the engine needs the board; it needs to see the status, it needs to make moves, even if virtually. The dependency is obvious. And here comes the commit I mentioned earlier that refactored in that direction.

This improved the code in terms of readability and, as a consequence, maintainability. It also reduced the lines of code, which, for a personal project, whatever, but the idea is what counts.
So what? You may ask. Here again, we dismantle a bit more of the narrative that programmers will disappear next year (maybe we can push it back another year or so). In fact, even in this project, I ask AI for feedback on performance and stuff (It is a vibe coding-free project, not an AI-free project) when I reach certain milestones (like creating the makeMove function or other “checkpoints”). I ask more generic questions about how to improve performance. Usually, for frameworks like CMake, these feedbacks are useful, but for architecture or performance in general, l I’ve found mostly useless advice. I’m speaking from my personal experience, especially in C++, but also in JS/TS on other work.
The thing I find really annoying, though, is that many times these “suggestions” are additive. They try to add code or modify things by adding complexity. This last point scares me a bit. So many people now brag about how many lines of code they wrote in an afternoon thanks to AI, and I keep hearing more about using lines of code as a metric for performance. The serious programmer knows the best commit is the one that removes lines of code instead of adding them. Right? right?

Anyway, just a small Sunday reflection to say that maybe, maybe we’ve still got a few years( or months) left before we all switch to farming.