When Yahoo CEO Marissa Mayer issued a memo earlier this week ordering everyone to stop working from home and come back to the office, the inevitable complaints followed (it didn’t help that she built a nursery in her office to be close to her own baby). Mayer’s intention, however, wasn’t necessarily punitive. Some analysts see it as a Hail Mary pass to restore the level of innovation at the floundering company, and she’s doing it the best way she knows how: a la Google (her former employer).

Companies like Google and Facebook have heralded a new era in workplaces, engineering every detail down to the length of the cafeteria line to maximize opportunities for creative collaboration, and, ultimately, innovation. But, does it work?

Look at the numbers, suggests John Sullivan, professor of management at San Francisco State University. Google is No. 3 in market capitalization. Yahoo is No. 238.

PHOTOS: Best Inventions of the Creative Years

“At Apple, employees generate $2.2 million per year,” Sullivan said. ”At Yahoo it’s $350,000. The data says it will increase innovation. It’s not an opinion.”

So why can’t you innovate from the laptop in your kitchen just as well as in the office? First, it’s important to distinguish between creativity and innovation.

“You can come up with a great idea on marijuana or walking along the beach at night,” Sullivan said. That’s creativity: a novel ideal. When it’s put into place it becomes an innovation, said Mike Fox, co-author of a book called Exploring the Nature of Creativity and faculty member at the International Center for Studies in Creativity at Buffalo State.

“An innovation is an outcome after creativity,” Fox said. “And innovation in the marketplace is associated with cash.”

Not to say that creativity is easy to define, either.

Yahoo CEO Marissa MayerMartin Klimek/Corbis

“What works for whom under what circumstances?” Fox said. “The answer to that is the holy grail. I’m 67 and I suspect I won’t live long enough to find the answer.”

The perfect creativity-fostering environment changes from day to day, based on a person’s specific needs, Fox said.

“If the person is an introvert and finds that their own productive environment is at home and away from people, they will excel based on that,” Fox said. “However, if you were going to make a simple statement, we find that folks perform better in terms of creative outcomes when working in small groups.”

CEO Moms: Good For Child and Business?

But say a telecommuter does have great ideas at home, Sullivan postures.

“If I send in an idea via text or e-mail, how do I know someone’s going to read it?” he said. “If I sent 50 e-mails a day, people would be pissed. But if I’m walking up and down the hallways asking, ‘Watcha doing?’” people are pleased, and the conversation might lead somewhere.

At Google headquarters, experts believe those conversations happen more frequently because the environment is incredibly conducive to such interactions. Take the cafeteria. The length of the line is measured so that people will have to wait for a certain number of minutes designed to foster conversation. After you get your tray, it’s likely you might literally bump into someone while finding a seat.

“That’s the Google bump,” Sullivan said. “It’s engineered. They have long tables set up close to each other so that when you walk between them with your tray you bump people. That way, you won’t sit with the engineers you came in with, you’ll sit down and talk with whoever you bumped into.”

And those types of interactions increase collaboration, new solutions, competition, energy, and learning, Sullivan said.

Facebook paid its employees $7,000 extra to live within one mile of the office (until the city got angry when it drove up rent), Sullivan said.

“So when you’re 21, you bike or skateboard to work, where there’s free food. You come early, stay late, you come in on weekends for no reason ... these people are geniuses,” Sullivan said. “It’s all data driven.”

So far, the data on Yahoo might tell the story: the stock is higher now than before the announcement.

“They might feel like they’re losing freedom, but they’re gaining job security,” Sullivan said. “Otherwise, in five years will be gone ... I’m betting it’s the smartest move ever.”