The Folly of Short Term Gains (Ecclesiastes 8:10-17)

When we go through this life it might look like it is wise to please man because then one will receive more in return.  If man is pleased with you then it seems you will go far because people will promote you, remember you, and help you advance through life to greater amounts of success.  So, it seems that there is a great advantage to keeping up appearances.  So, is there a downside of trying to keep up an appearance before man?  Why would the preacher in Ecclesiastes say that such a view of life is short sighted?  What is a a view of life that is much wiser?