Solomon had observed many exceptions to the dogma of retribution (i.e, the belief that God always punishes the wicked with adversity and blesses the righteous with prosperity in this lifetime; Ecclesiastes 7:15; cf. Job). Therefore we should not conclude that by being righteous we can escape adversity ( Ecclesiastes 7:16). The righteousness in view here seems to be self-righteousness (cf. Matthew 5:20; Matthew 23:1-36). [1] We should probably translate "ruin yourself" ( Ecclesiastes 7:16, Heb. tissomem) "be appalled, astounded."[source]
Neither should we conclude that because God does not consistently punish the wicked in this life, it is all right to sin ( Ecclesiastes 7:17). One who fears God should avoid both of these extremes ( Ecclesiastes 7:18). Solomon was not saying in these verses that a little wickedness and folly are good, the Song of Solomon -called "golden mean." Rather, he advocated living life in the light of God"s judgment, but not falling into the trap of believing in rigid retribution. Even though Solomon was uncertain about the time God would Judges , he was sure God would judge righteously. [2][source]