The current push for codes of conduct in software projects isn't about harassment per se. Realistically anyone can be harassed out of a community regardless of rules. The point of the rules is to change the norms such that behavior that would otherwise have been exclusionary or just off-putting is specifically called out and recognized as "wrong".
"This code is fucking garbage and you should be ashamed" may or may not be "harassement" according to the intent of the writer or interpretation of the reader. But it's still wrong and we don't want that.
"This code is fucking garbage and you should be ashamed" may or may not be "harassement" according to the intent of the writer or interpretation of the reader. But it's still wrong and we don't want that.