Herman Hesse, in Gertrude:

I think one can draw quite a distinct division between youth and maturity. Youth ends when egotism does; maturity begins when one lives for others. That is what I mean. Young people have many pleasures and many sorrows, because they have only themselves to think of, so every wish and every notion assumes importance; every pleasure is tasted to the full but also every sorrow, and many who find that their wishes cannot be fulfilled, put an end immediately to their lives. That is being young. To most people, however, there comes a time when the situation changes, when they live more for others, not for any virtuous reasons, but quite naturally. A family is the reason with most people. One thinks less about oneself and one's wishes when one has a family. Others lose their egotism in a responsible position, in politics, in art or in science. Young people want to play; mature people want to work. A man does not marry just to have children, but if he has them they change him, and finally he sees that everything has happened just for them. That links up with the fact that young people like to talk about death but do not really think about it. It is just the other way round with old people. Life seems long to young people and they can therefore concentrate all their wishes and thoughts on themselves. Old people are conscious of an approaching end, and that everything one has and does solely for oneself finally falls short and lacks value. Therefore a man requires a different kind of continuity and faith; he does not work just for the worms. That is why one has a wife and children, business and responsibility, so that one knows for whom one endures the daily toil. In that respect your friend is quite right, a man is happier when he lives for others than when he lives just for himself, but old people should not make it out to be such an act of heroism, because it isn't one really. In any case, the most lively young people become the best old people, not those who pretend to be as wise as grandfathers while they are still at school. "