Matthew Henry Commentary6:1-6 A man often has all he needs for outward enjoyment; yet the Lord leaves him so to covetousness or evil dispositions, that he makes no good or comfortable use of what he has. By one means or other his possessions come to strangers; this is vanity, and an evil disease. A numerous family was a matter of fond desire and of high honour among the Hebrews; and long life is the desire of mankind in general. Even with these additions a man may not be able to enjoy his riches, family, and life. Such a man, in his passage through life, seems to have been born for no end or use. And he who has entered on life only for one moment, to quit it the next, has a preferable lot to him who has lived long, but only to suffer.

Ecclesiastes 6:3If a man fathers a hundred children and lives many years, however many they be, but his soul is not satisfied with good things and he does not even have a proper burial, then I say, "Better the miscarriage than he,

Ecclesiastes 6:5"It never sees the sun and it never knows anything; it is better off than he.

Treasury of Scripture

For he comes in with vanity, and departs in darkness, and his name shall be covered with darkness.