Forum.wordreference.com and www.usingenglish gloss the phrase he who touches pitch shall be defiled. It means, generally, one cannot associate with dirty things (eg, mediocre programmers) without getting dirty oneself. As I'd expect, google ngrams shows use of the phrase touch pitch as far more common in the 1800's than before or after, pitch being in common use aboard sailing ships.
From idioms.thefreedictionary.com, tarred with the same brush means “sharing the same characteristic(s); having the same good or bad points as someone else”, and from en.wiktionary, “To characterize using the same undesirable attribute, especially unjustly”. If a job shop is known for so-so products, people are likely to think of its employees as tarred with the brush of mediocrity. A worldwidewords.org entry for the phrase notes “There’s nothing directly racist in its history” but indicates why some may mistakenly think so.
Also, although not it's not well-known in English, the following proverb may apply in much the same way as “If you lie down with dogs, you will get up with fleas”:
How can you avoid wetting your shoes when you frequently walk on the riverside. ‒ WISDOMCHINA.htm