Ha! As a pure mathematician-turned-software engineer, Theory of Computation was one of the few classes I took that remains even remotely applicable. At the time I thought it was really cool, and probably made CS a little more appealing.
Conversely, in my current role as a backend/systems/researchy person, a JS class would broaden my horizons a bit like a literature class might, but I think both would be equally useful to my current job.
My current role involves analyzing and understanding customer-provided SQL. Although vanilla SQL is not Turing complete, in the past I’ve definitely decided to deprioritize thinking about certain approaches due to growing complexity and because they “smelled” like the Halting problem.
Going farther back, I’ve seen a handful of instances where someone was looking for help trying to solve a graph problem, until it was pointed out that it could be reduced to an NP-complete problem. Unfortunately I can’t recall the details.
Conversely, in my current role as a backend/systems/researchy person, a JS class would broaden my horizons a bit like a literature class might, but I think both would be equally useful to my current job.