Optical is better, because there is no electrical connection, and, hence, no ground loops or electronic noise transmitted. The downside of optical is that it can get dirty and fail, but that's not an issue in a studio environment.
I would also mention ADAT, which provides up to 8 audio channels between devices (S/PDIF is only two channels). ADAT uses the same physical "TosLink" optical cables as S/PDIF, which is why some audio interfaces have "Optical ports" that are configurable as ADAT or S/PDIF.
Optical connections are immune to noise but not to jitter, in fact they're highly susceptible to it. I've never used optical S/PDIF for anything, but whenever I run ADAT lightpipe (TOSlink) I also run a separate wired connection for clock - either RCA S/PDIF or BNC word clock.
So I agree with luk - keep the connections very short if you're going to use them for clock as well as audio. Remember, ADATs used the 9-pin connection for clock, not lightpipe.