Home vs. office: Where should you work?

FORTUNE — For a while, working from home was the hip corporate perk. Best Buy got glowing press for its Results Only Work Environment in which corporate employees could work anytime, anywhere. The federal government embraced telecommuting arrangements, in part for the ability to regroup in emergencies, and several studies showed that telecommuting had upsides for performance and retention.

But over the past year, there’s been a shift. Yahoo’s (YHOO) new CEO, Marissa Mayer, famously shut down the company’s telecommuting arrangements this winter. In an April speech, she acknowledged that “people are more productive when they’re alone,” but also claimed “they’re more collaborative and innovative when they’re together. Some of the best ideas come from pulling two different ideas together.”

The notion of innovation via serendipitous encounters is gaining popularity: this year’s South by Southwest Interactive Festival in Austin, Texas featured panels on the topic, and companies including Google (GOOG) and Zappos are redesigning their office space to spark more chance meetings.

MORE: Let the games begin: Fortune’s ‘fantasy league’ returns

Needless to say, serendipitous meetings in the elevator require being in a corporate headquarters, not in your pajamas at home.

So, is it better to work from home or the office?

The answer is that it’s complicated, with upsides and downsides for both.

To be sure, many jobs can’t be done remotely. Most medical and dental procedures still need to be done in person, and most teachers need to be in their classrooms. But much information work isn’t time- and place-specific. The 2013 American Time Use Survey found that on the days they work, 38% of employed Americans with college degrees do some or all of their work from home.

Skipping the commute is a desirable perk, with various surveys finding a majority of people interested in the option. There are environmental benefits to taking cars off the road. One meta-analysis of 46 studies found that telecommuting was associated with more job satisfaction, less desire to leave an employer, and — at modest levels — had no effect on the quality of workplace relationships. In another study, researchers from BYU analyzed 24,436 IBM (IBM) employees in 75 countries to identify the point at which 25% of employees reported work-family conflicts. People with the ability to work from home and set their own hours could work 57 hours per week before a significant chunk experienced work-life stress. For those who had to be in the office at set hours, that break point occurred at 38 hours.

But there are downsides, too. Karen Finerman, co-founder and president of Metropolitan Capital Advisors and author of Finerman’s Rules, tried working from home. “For me, working from home was literally the worst of everything,” she says. There were fewer boundaries, with work bleeding into non-work hours, and kids — she has four — interrupting at the most inconvenient times.

As a boss, she says she understands if people need to work from home sometimes, but “it is not my first choice.

“If there’s something very timely we need to talk about right away, not having to track someone down is helpful,” she says. “Serendipity is important, that interaction.” She’s also found that “it’s hard to manage people virtually,” likening it to what gets done in a classroom when there’s a substitute teacher.

Mayer’s change at Yahoo was widely debated, and it’s hard to determine its impact. In its most recent earnings statement, Yahoo reported that earnings are up significantly, year-over-year (though revenue is slightly down). Best Buy (BBY) ended its ROWE policy in early 2013, shortly after Yahoo ended its telecommuting program.

MORE: Why Janet Yellen should succeed Ben Bernanke

But the working-from-home vs. working-from-work debate “kind of misses the big issue,” says Alan Gregerman, a business consultant and author of the forthcoming book, The Necessity of Strangers. “Both of these approaches kind of miss the notion that we can be most successful when we connect with more people.” There’s “a lot that’s cool about collaboration” — the thinking behind work-from-work policies — but if employees “don’t have enough fresh ideas to collaborate around, they kind of miss the point,” he says. “Our companies need to encourage us to regularly get off our butts and explore the world around us.” Organizations need new ideas, after all. “We’re not as likely to get those new ideas if we simply hang out at the office or work from home.”

To that end, Gregerman often leads teams on adventures to museums, city streets, markets, and other places. The day before I interviewed him, he’d gone to the Smithsonian’s National Portrait Gallery and the American Art Museum to study (among other things) folk artists, and how they felt about themselves and their identities. He’s also been known to take clients to zoos to study animal behavior and asks them to come up with observations that might be helpful for dealing with customers.

“At the beginning of all these things, people look at me like, ‘You are the weirdest person on the planet,’” he says. At the end, he often hears “Whoa, that was awesome, I never even imagined I could think in those ways. It’s just by getting out of the office.”