I remember a manager during an internship telling me to do clean code because later I might have to reuse piece of code in further work experiences. It was the time when code was shared with zip and so or net shares.
At that time there wasn't that many "software shop" and it was just a way to do things in other company like hardware manufacturers. Obviously you would have been trusted not to take or disseminate or reuse company trade secret or coffee things like expected by your non competition clause in your contact anyway.
Since then, a lot of company became like "software production" company and developers are now considered like factory workers.
And in some way I would say that you are nowadays robbed of your code and there isn't even attribution anymore.
Look, in the 80/90s it was more common to know the name of the main dev of major companies, and their contributions were clearly attributed to them. But now you will very very rarely know the dev that did the code for anything. Top manager/architect/... Might be recognized but not really for their code contributions.