MAX7219 and 51 MCU 8x8 LED matrix

I have seen similar sketches that use pins 10' 11' 12.

Yes those use the inbuilt SPI interface to talk to the chip. If you do not use this then you have to bit bang the SPI interface like the sketch you posted.