I’ve reworked SO many systems that started clean and were obviously updated by a series of different people over a span of years. New features nailed on with apparently little understanding of the overall app. It’s like, “Oh dude it was already doing 90% of what you wanted, you didn’t have to add all this… <sigh>.” Especially true when offshore contract agencies had been involved - to churn through jobs as fast as possible (with no other concern) they tend to copypaste sections of the app that do something similar to what’s desired, and make minimal changes to them, with zero code cleanup. This leaves all sorts of misleading unnecessary code, as well as inefficiencies like grabbing a large dataset to get a single item, etc. I found things that made me literally LOL.
Addendum: one that stands out was an in-house survey app that allowed you to create questionnaires and email them to people in the company. Responses were saved in a database and you could make complicated statistical inquiries like, show me how people answered questions 7 and 8 who said Yes to question 12, No to 13, and filled in the “Other” blank for 19.
My job was to speed up the SQL queries, which were so complex and slow the max runtime had to be increased to like an hour to let them finish. This was because the original database of questions and multiple-choice answers had been modified in several stages, which ended up with response details in multiple fields in multiple tables depending on the type of question. After about a month I managed to streamline the queries so the longest one took less than 10 minutes, but this was still enormously slow because questionnaires had maybe 2000 responses max. The problem was the database structure relationships was too complex because things had been scabbed onto it.
One day at lunch I spent about 20 minutes noodling a redesign with fewer tables. All user responses would be in one place, and the longest queries probably would have run in a second or two, plus maintenance and enhancements would be WAY easier. When I proposed actually doing this, management said they would think about it if they ever did a new version.
Our off shore contractors produce some of the worst code. But it’s impossible to get work done and also be vigilant enough to reject their bad pull requests. So basically you’ll end up looking a code one day that is godawful and think, “this is off shore”. And yep, git blame tells you you’re right.
It’s a contracting agency. Not individual contractors. Unfortunately we have lots of rubber stampers on our team who approve code while you’re not looking. And let me be clear, we have on shore who contribute awful code, too.
I’ve reworked SO many systems that started clean and were obviously updated by a series of different people over a span of years. New features nailed on with apparently little understanding of the overall app. It’s like, “Oh dude it was already doing 90% of what you wanted, you didn’t have to add all this… <sigh>.” Especially true when offshore contract agencies had been involved - to churn through jobs as fast as possible (with no other concern) they tend to copypaste sections of the app that do something similar to what’s desired, and make minimal changes to them, with zero code cleanup. This leaves all sorts of misleading unnecessary code, as well as inefficiencies like grabbing a large dataset to get a single item, etc. I found things that made me literally LOL.
Addendum: one that stands out was an in-house survey app that allowed you to create questionnaires and email them to people in the company. Responses were saved in a database and you could make complicated statistical inquiries like, show me how people answered questions 7 and 8 who said Yes to question 12, No to 13, and filled in the “Other” blank for 19.
My job was to speed up the SQL queries, which were so complex and slow the max runtime had to be increased to like an hour to let them finish. This was because the original database of questions and multiple-choice answers had been modified in several stages, which ended up with response details in multiple fields in multiple tables depending on the type of question. After about a month I managed to streamline the queries so the longest one took less than 10 minutes, but this was still enormously slow because questionnaires had maybe 2000 responses max. The problem was the database structure relationships was too complex because things had been scabbed onto it.
One day at lunch I spent about 20 minutes noodling a redesign with fewer tables. All user responses would be in one place, and the longest queries probably would have run in a second or two, plus maintenance and enhancements would be WAY easier. When I proposed actually doing this, management said they would think about it if they ever did a new version.
At least I tried.
Our off shore contractors produce some of the worst code. But it’s impossible to get work done and also be vigilant enough to reject their bad pull requests. So basically you’ll end up looking a code one day that is godawful and think, “this is off shore”. And yep, git blame tells you you’re right.
How do code reviews work with contractors? Is it just “you don’t get paid until we approve it”?
It’s a contracting agency. Not individual contractors. Unfortunately we have lots of rubber stampers on our team who approve code while you’re not looking. And let me be clear, we have on shore who contribute awful code, too.
It’s all a mess.
I just need to add 20 if-branches in 15 methods across 10 different files from 5 modules.