I remember the story of the Publican and the Pharisee from Sunday School. Luther had an interesting take on the self righteous.
As Luther preached on Matthew 2;2-10 he said this concerning those who wanting to be good for the sake of the Gospel and because of that they practice a strange sort of conceit. 33. Hence you see who are the greatest enemies of the Gospel, namely, the work-righteous saints, who are self-conceited, as has been said before. For the Gospel has not the least in common with them. They want to be rich in works, but the Gospel wills that they are to become poor. They will not yield, neither can the Gospel yield, as it is the unchangeable word of God. Thus they and the Gospel clash, one with another, as Christ says, “And he that falleth on this stone shall be broken to pieces; but on whomsoever it shall fall, it will scatter him as dust.” Math. 21, 44.