Given that the current employer knows and has been given appropriate notice ahead of time, how can a programmer make a clean job transition from his old job? What things should the programer consider? How should one tie up unfinished projects? For example, should one make a list of places they have password access, or a master password list to hand over?  When I say clean transition, I mean where one would leave the company without leaving any messes, drama, or headaches, and still enabling the company to hire someone to replace you and continue work without problems. (For example, suddenly disappearing and not returning is not a clean transition, nor is encrypting all one's code into types of food). 
What should I do to leave a job professionally?
documentation;teamwork;knowledge transfer
It is advisable to organize your work during the entire time in that fashion that your sudden demise would not wreak havoc on the company operation. One should always keep this in mind. Keep things clearly and logically structured, report your progress regularly and check things in promptly.What you could do specifically in your last days:Prepare a list of credentials which are supposedly unknown to those to replace youPrepare a status report concerning your projects and their statusDocument any open and outstanding issues that you intended to take care of at some future point of timeAsk your superiors if there is something specific they want you to documentAsk your superiors if there is any tutoring they want you to give to anybody involvedIf you were involved in dealing with customers and external parties it might make sense to notify them of their upcoming contact change. But ask for a permission first, sometimes your superiors don't want the customers be notified of people leaving.That pretty much covers it.