Albert Barnes' Bible Commentary
Psalms 139 - Introduction
This psalm purports to be a psalm of David, and there is no reason to doubt that it is properly attributed to him. See introduction to Psalms 138:1. At what time it was composed is, however, unknown. It contains reflections which might have occurred at any period of his life; yet it would seem most probable that it was not written in his early years, but that it is a record of his most mature thoughts on a great and very important subject.
The psalm relates to the omnipresence of God, and contains such reflections as would occur to one meditating on that attribute of the Deity. It is the most distinct and full statement of that doctrine which is to be found in the Hebrew Scriptures, and the doctrine is presented in language which has never been surpassed for sublimity and beauty. The leading idea in the psalm seems to be that of comfort from the fact that God is everywhere; that he knows all that pertains to us; that we can never be hidden from his view; that he has known us from the beginning; that as he fashioned and formed us - making us what we are - he knows all our necessities, and can supply them. The psalm consists of three parts:
I. A celebration of the Omniscience and Omnipresence of God, as a ground of confidence and hope, Psalms 139:1.
(a) The fact that he knows all that there is in the heart, Psalms 139:1.
(b) The fact that he is everywhere present, Psalms 139:7.
(c) The fact that all in our past life has been known to God; that he has created us, and that his eye has been upon us from the beginning of our existence, Psalms 139:13.
(d) The fact that his thoughts toward us are precious, and numberless as the sand, Psalms 139:17.
II. The feelings of the psalmist in relation to the acts of the wicked as a proof that he loved God, Psalms 139:19. These reflections seem to have sprung from his contemplation of the divine character and perfections, as leading him to hate all that was opposed to a Being so pure, so benevolent, so holy. On looking into his own heart, in view of what God was, he was conscious that he had no sympathy with the enemies of God as such; that such was his love for the character of God, and such his confidence in him, that he could have nothing in common with them in their feelings toward God, but wished to be dissociated from them forever.
III. The expression of a desire that, as God saw all the recesses of the human soul, he would search his heart, and would detect any evil he might see there, and deliver him from the evil, and lead him in the way which conducted to life eternal, Psalms 139:23. Anyone may feel, and must feel, that after all which he knows of himself - after all the effort which he makes to ascertain what is within his heart - there are depths there which his eye cannot penetrate, and that there may be sins of thought and feeling there which he has not detected; but it is only from the consciousness of sincerity, and a true desire to honor God, that one can pray that God would search him, and that he would detect and bring out every form of sin which he may see concealed and lurking in the soul He who can sincerely offer this prayer is a pious man.