Contrasting Wisdom and Folly (Ecclesiastes 7:1-13)

The saying in this age is that “laughter is the best medicine.”  I grant that no one likes an Eeyore crashing the party.  We all know that such a pessimist is not someone very fun to be around or listen to complain all the time.  So, if this is true then why does the preacher tell us that it is better to be in the funeral parlor rather than wedding feast?  Are we not to enjoy the fruits of our labors?  How can we go through life with such a pessimistic outlook?  Where is the joy and wisdom in such pessimism?