You can learn coding on online servers for various programming languages, so any basic computer with a 2 GB ram will do. If you are looking for a top of the line computer for programming games, a workstation PC should be your way to go. Although, you should keep in mind that workstations are very expensive for the average consumer's pockets. An average workstation comes equipped with a Xeon Processor(64 cores), a DDR Ram and extensive cooling systems.
The following specs are enough for a good PC. CPU:
Intel i7-8700K
RAM:
4 x Crucial DDR4 16 GB PC4-19200 non-ECC (64 GB in total)
SSD 1:
Samsung SSD 960 Pro M.2
SSD 2:
Samsung SSD 850 Pro (data disk from my previous machine)
CPU cooler:
Thermalright Macho Rev.B
Power supply:
Pure Power 10 400 Watt
Case:
Pure Base 600
GPU:
MSI GeForce GTX 1060 Gaming X 6G 6GB