"Hope for the best; expect the worst."

Basically, cautious optimism. So, you’re not negative and you strive for the best and try for the best and keep hope for the best, but psychologically you “insure” yourself for the worst to minimize emotional damages.

Is this a good attitude to have towards life?

Pretty much.

People are much more optimistic about the future than it turns out to be, on average. Virtually no one thinks “I’m sure that I’ll be unemployed for eight months of next year” and yet a pretty decent percentage of people actually are.

Someone did a study that showed that people suffering from depression actually make better predictions about the future than an average person.

On the other hand, simply saying that the future will suck gets you labeled as a negative person, so you have to couch that advice with platitudes about hope. (OK, less cynically, there’s actually a lot of evidence that risk-taking is also important for success, whether we’re talking stock markets or changing careers.)

I prefer “Hope for the best; Plan for the worst.”
It strikes me as negative thinking to expect the worst but simply being prepared to plan for it.

Heinlein phrased this concept: “Pessimist by policy, optimist by temperament.” Basically, when you know that you are prepared for the worst case scenario, you can happily go about your business without a care in the world.

That’s basically how I view things. I plan for the most likely of the worst-case scenarios, but hope that things will come out better than that. And they usually do.

Like if I go into a store, I don’t expect cheerful knowledgeable help. If I get it I’m pleasantly surprised. If I don’t get it, I’m not surprised but as long as it isn’t too bad it’s not a big deal anyway.

I’d reword it to “Expect the best and prepare for the worst”. I’m one of those annoy types who believes that a positive attitude brings good fortune, so go forth expecting the best and it will find you.

I’m more of an “Hope for the borscht, expect the wurst” kind of guy.