PCB design using code instead of clicking a mouse?
Altium has a scripting language, several different languages, in fact. In some cases it may make sense to use algorithms, for example to create repetitive layouts or parts placed precisely in certain positions. 

For example, I've seen it used to place parts (LEDs) in a circular pattern, though with their introduction of polar coordinate snap grids that's much less likely to be worth the hassles. 

We've used algorithms to create shapes (think antennas and that kind of thing) directly in .dxf format which can then be imported into a copper layer. 

In general, code is poorly suited for PCB layout purposes, particularly so for the routing task.