Successful software development is a long term activity. If you plan to be successful, you should therefore plan for your code base to be maintained by a succession of many different programmers over a period of many years. Not planning for that is planning to fail.
-- from Why Create Coding Standards and Perform Code Reviews?
Sounds like you might have benefited from code reviews and a company coding standard.
BTW, I see that Perl monk JavaFan was very dubious of the benefit of a company coding standard in Why Create Coding Standards and Perform Code Reviews?
Maybe he was the "Java fan boy" in your old company? :)
Though we've had a company Perl coding standard for many years, consistently enforcing it was problematic.
It still exists but is advisory only, rarely enforced.
Peer code reviews are still mandatory.