On this topic: I'm building a computer for the first time in many years, mostly for writing C & C++ code. But do I optimize for RAM or CPU? Is multithreading helpful in compilation?
In the middle ground it's mostly about CPU and disk, but exactly what cpu specs are use case specific. Depending on what software you're building I could easily see the bottle neck in either single core performance, core count, or file io.
At the high end, if you're bottlenecked on IO even with nvme disks you could consider getting enough RAM to develop on a ramdisk.
The great thing though is you don't have to guess. AWS and friends will give you short term rentals on a wide variety of hardware. Try them out on a representative workload and see what the difference is.