Alex, when you talk about part writing....what you are refering to? -BW
Part writing or 4 part writing (based upon the four main registers of the human voice) is the art and science of the relationship of these 4 voices to each other. These voices are like building blocks which can be stacked upon each other in different ways as they move linearally through time. They may be constructed well or poorly i.e. strong and resonant relationships or weak cancelling resonance, relationships.
These differences between weak and strong relationships are easily heard by the discerning ear and therefore certain rules were long ago established to help the student/composer avoid the resulting weak or bad sound.
One foundational principle is contrary motion. if a voice (say the top or soprano voice) moves downward, than moving the bass (or another of the remaining 2 voices) upward will be neccessarily strong. In principle generally but if another fundamental rule is broken and this same movement results in an octave (cancelling resonance) then you may still have poor construction. If the remaining 2 voices are interjected in a way to relieve or strengthen this weakness then you have solved a musical problem (which is much of the essence of composition: problem solving or filtering out weaknesses or making things work.
Bachs Remenschneider collection of Chorales (for voice) is a textbook of unerring musical construction in 4 part writing.
Dave Connor