To me there are two aspects of any task assigned to a developer in a software project. These are not exclusive, so a task can be (for example) 40% aspect 1 and 60% aspect 2:
- Tasks requiring you to learn new things or improve your existing understanding on them. Doing this will improve you as a developer and gained knowledge/experience is transferable, either to other areas in the same project or to other projects.
- Tasks which are specific to the project or even to one very small area of it. Doing them may only improve you as a particular developer on that project. Even then, gained knowledge/experience is only useful in that specific part of the project, therefore useless, unless there will be many tasks in the future focused on that same part.
I don't have a problem working on tasks which are entirely type 2, since they are part of the job, but when there are other team members who have already spent a lot of time on those specific areas, me doing them seems like a waste of time and resources for everyone. This absolutely kills my motivation. Especially in a project close to finishing, when it is clear that there won't be any more tasks regarding those areas.
This may be useful to share knowledge among the team, e.g. if someone quits, others would be able to take over, but anyone can spend a few days to figure out a code. Doing it upfront is like paying for some accident that has not happened yet or may actually never occur.