You can attack an idea without attacking a person. As long as people realize they are distinct from the code they write, you can be direct and brutal about code, without devolving into ad hominem. The problem is fostering a culture where people don't feel as if they are socially defined solely by the code they write.