AlephZero said:
Don't kid yourself. If somebody tried to pull that sort of trick in the group I work in, everybody would know about it within half a day - including your boss, and probably your boss's boss as well.
It's not a trick. Where I work, the policy usually is I use your code, you use my code. If someone has published code on the internet that does what we want, we use that.
You forgot one thing. In a work situation, your pay depends on how you perform. Unless giving out free advice to incompetents is part of your assigned work load, doing it won't increase your annual bonus by one cent.
It's called "customer support" and yes one thing on my 360-annual review is how friendly I am at dealing with requests for help. A lot of the people that I help *aren't* technical people, and I get paid to write code which other people can use so that they can do stuff.
And the more money the incompetents get by taking advantage of your good nature, the less money there will be for you.
Where I work, everyone is incompetent at something. Also trying to deal with support requests with a smile is really hard, but being nice for support requests is part of my job.
It should be noted that in any company that I've ever worked at, the people that make the really big bucks tend to be people that are completely incompetent at programming, which is why they pay me to do it.
The other thing is that I don't get any credit for "doing stuff on my own." If I can fix a problem in five minutes by copying code off the internet or finding the answer to the problem on google, then people want me to do that rather than spending several hours working out the problem myself.
Also, it should be pointed out that you usually can't just cut and paste something off google, and if you find some software that has been written by someone else, you'll have to spend a non-trivial amount of time trying to rework it to do what you want it to do.