Before you judge someone's code, walk a mile in their shoes
It's totally normal for folks to comment on code written by others, pointing out flaws and mistakes. I'll admit, I used to do the same thing back when I was less experienced.
It's easy to jump to criticism, isn't it? It's a bit like when someone cuts you off in traffic—you might think they're a terrible driver. But when you do it, you probably have a good reason, like rushing to a meeting or having urgent work. Code rewrite also a bit like that too.
Sometimes we might look at old code and think the person who wrote it made mistakes because they weren't smart. But here's the thing: that's not always true. We don't know what deadlines they were up against, the pressure they faced or what info they had at the time. They were doing their best with what they had, just like we are now.
Here are a couple of things to keep in mind:
1. When we work on projects that grow, it's normal for code to need rewriting. So, the code you're criticizing today might have been fine when it was written.
2. That old code played a part in getting the project where it is today—making money and funding the rewrite.
By the way, that code you're writing now and feeling proud of. It'll probably get rewritten too when the product scales in the future.
So, next time you're looking at someone else's code, try to be understanding and positive. We're all working together to make things better! 🚀