In v. 15 Solomon describes a situation where a genuinely righteous person receives what the wicked should get, and the wicked person receives what the righteous person should get. The point of v. 16 could be interpreted like this: “Do not be simplistically righteous with the expectation of immediate reward, neither be naively wise, why cause yourself to be astonished that God did not honor your righteous living with immediate blessing?” How does this fit in with vv. 17–18? When one sees the wicked prospering, he may lose heart and turn to an excessively sinful lifestyle. This should not be followed because God may immediately judge this sinner (v. 17). According to v. 18 the believer should avoid both extremes.

Conclusion:

In light of other portions of this book (Ecclesiastes 3:17Ecclesiastes 8:12Ecclesiastes 11:9Ecclesiastes 12:14), Solomon would argue that we should live righteously because God will bring every deed into judgment (Ecclesiastes 12:14); this is when the Lord will certainly reward His people.
 

Bob McCabe is Professor of Old Testament at Detroit Baptist Theological Seminary (DBTS). He received his Th.D. degree in Old Testament from Grace Theological Seminary in Winona Lake, Indiana. Bob has been teaching at DBTS since 1983. He is a regular contributor to the blog "theologically driven."