It’s not a Maginot Line. It’s happiness.

As a strategy, building walls is frowned upon. The Great Wall of China. Hadrian’s Wall. The Maginot Line. AOL’s “walled garden.” Defensive moves — all failed.

But maybe in certain circumstances walls can be beneficial?

A New York Times article describes how researchers used an iPhone app to contact some 2,200 individuals and get a total of roughly 250,000 replies as to how each person was feeling and what they were doing at the time they were contacted. Forty-seven percent of them reported that their minds were wandering when contacted — in other words, half of them were not focused on whatever it was they were doing. Most interestingly, there was no correlation between the joy of the activity and the pleasantness of their thoughts.

Whatever people were doing, whether it was having sex or reading or shopping, they tended to be happier if they focused on the activity instead of thinking about something else. In fact, whether and where their minds wandered was a better predictor of happiness than what they were doing.

This finding jibes perfectly with the focused attention inherent in Mihaly Csikszentmihalyi’s concept of “flow,” in which a person so completely immersed in a task that feelings of time, effort, and energy disappear.

The problem today, of course, is that the state of flow is increasingly difficult to achieve. Psychologist Edward Hallowell says that

30% to 40% of people’s time in the workplace is spent tending to unplanned interruptions, and then reconstituting the mental focus the interruption caused. I’m sure that was not the case 20 years ago simply because the tools of interruption were not so plentiful. And all the distraction has created blocks in thinking and feeling deeply. We’re being superficialized and sound-bit.

In fact, when he asks people where they do their best thinking, the most common response is, “In the shower.” Apparently, the shower is one of the last places left where we’re not often interrupted.

That’s where the Maginot Line comes in. While it’s not possible (or advisable) to completely wall off the outside world all the time (who wants to end up like France in 1940?), it’s essential to recreate some boundaries around your work time so that you can think without interruption. Close the door. Go to a conference room or a coffee shop. Spend a weekend at a meditation center. Whatever works for you. But for god’s sake, put away the iPhone and turn off the internet connection.

Thinking and creating is hard work. It requires energy. Often it isn’t very much fun. The prevalence and ease of distraction — particularly electronic — is a seriously enticing alternative to hunkering down with your thoughts and a blank piece of paper. But if you can maintain your focus on that blank piece of paper instead of mindlessly and reflexively following another distraction, you’ll be much happier.

What’s your Maginot Line going to be? What kind of defensive walls will you build?