https://github.com/rogersavage/byte_trainer
Like many programmers, after hours of working with modern super-high-level languages, libraries and frameworks, one of my favorite ways to relax is to immerse myself in the most primitive and laborious methods of software development I can find.
Lately, I’ve been learning 6502 assembly with an eye to the early Commodore series and the NES. I quickly decided that I’d like to practice sight-reading 8-bit hexadecimal values, but after some web searching I couldn’t find any quiz games or apps that were anything like what I wanted, so I decided to build one in React.
To take my old-and-new combination further, I decided to see if ChatGPT could help get me started. I was skeptical and disinterested in AI for a long time — after all, I love programming, I’m not trying to get out of it — but after a few minutes of experimentation, I got the sensation you may have experienced the first time you used a power drill to assemble an IKEA shelf after years of wasted effort with hex wrenches.
Incidentally, absorbing development practices from the late 1970s has vastly shifted my notion of what constitutes a “power tool” in the software world. I had never thought about what a Loader actually does, and having grown up with MS-DOS, I never appreciated that the kinds command-line tools from the late 1980s onward that I take for granted represented a huge and luxurious advancement over a kind of user interaction that operated at or barely above the syscall level. (I haven’t decided whether I want to accustom myself to using the Commodore 64 “historically”, so to speak, or to jump straight to something like JiffyDOS).
Anyway, it turns out that after about two hours of exploring ChatGPT’s capabilities, and iterating on my queries, I was able to get it to generate a React app that achieved, subjectively, about 70% to 80% of what I wanted to do. Not only that, but when I went back to build it from scratch using the ChatGPT output as a model, I found that its syntax and technique are generally very similar to what I’ve been learning from Mosh Hamedani, whose paid tutorials I have found incredibly helpful. Conditional rendering, standard nomenclature for state management and higher-order functions, using map() to dynamically generate DOM elements from a dataset, etc.
The code is pretty simple to look at now that it’s done. All I really had to do was expand the functionality to add a toggle between Hex-to-Decimal and Decimal-to-Hex quiz modes, and tweak the CSS and some other presentation details. I don’t actually like thinking about how many divs I want in my divs and where to put them, so having an AI assist made the whole process vastly more pleasurable.
All of which brings me to my point — that this is another instance of goal-oriented software development. I wanted my computer to do something, so I made it do something.