Own and respect your legacy code
The majority of developers will find themselves working with legacy code at one time or another. Many will even be working with legacy code for their entire software development career. There is a tendency in our industry to have a very negative attitude towards legacy code.
"Who wrote this crap"
"What were they thinking when they did this - this is awful"
"This is a mess"
Not only are statements like that unprofessional - they are the easy way out. Many developers never take ownership of the legacy code they are working in. The fact that they did not build the application from scratch is used as an excuse every time something goes wrong.
It's not that I don't understand people that have this negative attitude. It's hard and can be very frustrating to work with legacy code. The attitude just isn't very constructive.
I suggest another approach.
Show respect
The code may very well be messy and full of hacks, but you should treat it with respect. You don't know under which circumstances it was created - tight deadline, low budget, high-stress levels, false promises from manager to get the time to refactor later. It might also be sloppy and bad work ,but that does not change your situation.
Do not speak badly about the original developers. They are very likely to have a lot of respect within the organization and badmouthing them will make you look arrogant - and rightly so.
Take ownership and responsibility
How long does it require for you to take ownership and responsibility of a legacy application? A month, a year, 3 years, never?
You should take responsibility for the legacy applications you are working with from day one. It's not someone else's code anymore - It's your code, and the sooner you come to terms with this, the sooner you can start to improve it.
Taking ownership and responsibility will make you want to improve the code.
Not all developers can clean up bad code accumulated through years of tight deadlines and bad practices - that requires skill and experience. But all developers no matter the skill level can change their attitude. By changing your attitude from negativity and blame to taking ownership and showing respect, you are changing your whole mindset towards legacy code, and software development in general.
Try it out. After all, what's the worst that could happen - You can always fall back to complaining and blaming other developers.