If you want that you probably shouldn't be outsourcing to freelancers in general. People aren't going to make clean code if they know they are never going to see it again and arent being paid for how clean it is.
If you want that you probably shouldn't be outsourcing to freelancers in general. People aren't going to make clean code if they know they are never going to see it again and arent being paid for how clean it is.
Of course, a clueless non-technical client, esp. if they are inexperienced on top of this, will not care and thus my hire someone who works like you suggest. A bit more sophisticated client will find someone who's experienced in managing and hiring developers, a tech lead, and help them pick and sometimes giude/check-in on their freelancer. Though very few people actually do this.
To be fair, a lot of full-time developers in big companies also do not get paid for how clean the code is, because no one cares.
I'd probably lean more towards personal character deciding this than just looking at people behaving only and always as incentives tell them to in any situation. Some people take pride in their code and some don't.
To say that "of course this freelance code is garbage, they're paid peanuts" is naive, because it implies that:
a) Well paid engineers always write beautiful code, and the more they get paid the more beautiful it becomes, which obviously isn't true.
b) Badly paid engineers don't care about code quality if they don't get paid for it, which isn't true because open source is a thing.
Reducing everything to economical incentives is, in my opinion, not very useful.
When you do open source, you are the one who has to live with the results. Forever. I think open source proves the point you're arguing against.
Besides, the argument is not that they are paid peanuts, just that they are being paid for other things. The incentives are not lined up for freelancers to give high investment up front to reduce long term maintenance costs. That doesnt mean every freelancer writes crap code, just that on average its not a system that selects for easily maintainable code.
You realize freelancers often have ongoing relationships with their clients, right? As well as relying heavily on recommendations and referrals. Why would I risk putting shitty work out there?