3 ms·
On my first day at my current company several years ago I was told to refactor something that was very poorly designed and written by the tech lead who had writ
by Aqueous 4y ago
On my first day at my current company several years ago I was told to refactor something that was very poorly designed and written by the tech lead who had written it. The code was impossible to work with and it took months to add the features they wanted, both because the PR process demanded small deployable PRs and because I had to avoid breaking the thing while working on it. Because I was new and because the tech lead I was working under had written the terrible code I was working on, I didn’t immediately say ‘This code is awful and the entire thing needs to be rewritten, both backend and front end.’ Instead I attempted to introduce right patterns to the data shape, etc. Suffice it to say the code was even worse and less maintainable at the end, only now I was taking the blame for it being that way because now my name was all over the git history.
It was eventually rewritten anyway by another team. Suffice it to say, DO NOT touch code if it is designed in such a way as to be impossible to change. Throw it back up the chain and say , This needs to be rewritten, now. The consequences will be worse for you if you try to work around other people’s bad architecture as you will eventually be blamed for both the original mess and whatever you did to work around it given whatever condtraints on process you have.
Years later. I am fixing another massive architecture mistake by the same engineer, who has since been promoted to higher levels. Over a year in, another data design mistake at a fundamental level that makes the system impossible to change without a huge refactor.
Sigh.
Throw people under the bus if necessary. Don’t accept ownership of code that sucks.
- randomluck040 4y agoIn my experience bad code isn’t written for the sake of being bad. A lot of companies don’t value IT and software they work with almost daily as much as they should. The idea is that if they click a button and it works, it works. Next project. Not enough time, pressure from everywhere to develop new features and behaviours and there you go, badly written code.