Do any of the developers out there have thoughts on how to avoid saying bad things about old developers due to annoyances in the old code? I always try to remember that you never know the circumstances that the old code was written under, but I am hoping for some more kind approaches :-). #php #WebDev

@ben "Let's take a moment to understand why this approach was the best one at the time of writing.

...

Given the constraints and the resources available.

...

Given the skillset of the people that had to make it work.

...

Given the state of the industry.

...

Ok this one might just have been a mistake"

@ben that's at least my approach when teaching people to work with legacy code.

Nobody wants to do bad work and nobody is the villain in their own story. So let's see if we can understand constraints and motivations and go from there.

@edorian Thank you Edorian! That is very similar to my approach most of the time. Unfortunately, we often get stuck on that last one :-) But still, everyone makes mistakes and I prefer to forgive and forget, especially when it comes to code πŸ˜„

@ben From non senior devs I saw a lot of those complaints coming from a "it's not my fault" place.

Especially Germans where complaining about something is how we say hello.

And people want to proactively communicate that maybe there will be issues, but pick an approach that isn't very healthy.

"Legacy code means your business was successful. The reason you have a salary now is because someone got the project to this point. These are their stories and trade-offs".

@edorian I love that quote, thank you!

@ben We're all still learning constantly and things could always be more optimal.

Hindsight is 20/20 and there is a ton of discovery work that happens while writing something that isn't obvious until after it's complete. Due to time constraints we can't always go back and fix every little "mistake" or inefficiency.

Keeping this in mind and having empathy towards yourself and other devs will go a long way. Sometime I look back at code I wrote a few months ago and wonder what I was thinking.

@Gur814 I've been programming professionally for 17 years and 3 month old code of my own is still always a bit of a head shaker :-)
@ben Well, one day other developers may be saying bad things about you and your code. Or probably that already happened. We all learn by making lots of mistakes. And like you said, the circumstances are not always ideal, there could have been bad management, too tight deadlines, unclear or changing requirements etc.
@lhengstmengel That has definitely happened, but it happens less to me because I'm still around. I find that it's so much easier to throw people who no longer are with the company (or never were) under the bus. I think this is a great idea to expand on, we should all try to remember that even if they are gone, those devs were trying their best. Thank you!
@ben yes indeed, most of the time the "blame game" is not a game worth playing, especially if the person taking the blame is no longer around. Better just try to fix and improve the code, and move on.
@ben I try to shift the focus to finding ways out of the situation we are in. β€œIt is not our fault, but it is our responsibility.” We gain nothing from assigning blame to the departed, but might find motivation in trying to improve what we have now.