logoalt Hacker News

Jachlast Sunday at 6:42 AM0 repliesview on HN

I enjoy the programming, and the problem solving, but only sometimes the typing. Advent of Code last month was fun to do in Common Lisp, I typed everything but two functions myself, and only consulted with the subreddit and/or the AI on a couple problems. (Those two functions were for my own idea of using A-star over Morton Numbers, I wrote about those numbers with some python code in 2011 and didn't feel like writing the conversion functions again. It didn't work out anyway, I had to get the hint of "linear programming" and a pointer to GLPK, which I hadn't used before, so I had the AI teach me how to use it for standard sorts of LP/MIP problems, and then I wrote my own Lisp code to create .lp files corresponding to the Advent problem and had GLPK execute and give the answers.)

If it's a language I don't particularly enjoy, though, so much the better that the AI types more of it than me. Today I decided to fix a dumb youtube behavior that has been bugging me for a while, I figured it would be a simple matter of making a Greasemonkey script that does a fetch() request formed from dynamic page data, grabs out some text from the response, and replaces some other text with that. After validating the fetch() part in the console, I told ChatGTP to code it up and also make sure to cache the results. Out comes a nice little 80 lines or so of JS similar to how I would have written it setting up the MutationObserver and handling the cache map and a promises map. It works except in one case where it just needs to wait longer before setting things up, so I have it write that setTimeout loop part too, another several lines, and now it's all working. I still feel a little bit of accomplishment because my problem has been solved (until youtube breaks things again anyway), the core code flow idea I had in mind worked (no need for API shenanigans), and I didn't have to type much JavaScript. It's almost like using a much higher level language. Life is too short to write much code in x86 assembly, or JavaScript for that matter, and I've already written enough of the latter that I feel like I'm good.