(Read More: Goodbye Apple iPhone? Wearable Tech Is Coming)
Critics say that while some workplace perks and benefits are a good thing, the large, multibillion dollar corporate headquarters are colossal wastes of money that snub the pioneering technology these firms actually create.
"Companies led by older management tend to be very controlling, but when I look at people in the 20s or 30s, they're totally capable of working on their own and being productive," said Kevin Wheeler, whose Future of Talent Institute researches and consults on human resources for Silicon Valley businesses. "To have artificial structures that require everybody to be in the office at certain hours of the day is simply asinine."
Wheeler said he thinks Yahoo called everyone back to work "because they had gotten into a culture of laziness," and that the firm will likely loosen the restrictions soon.
Yahoo was, in fact, an early model of Silicon Valley's happy workplace culture, touting their espresso bar and inspirational speakers as a method of inspiring passion and originality. Today yoga, cardio-kickboxing and golf classes at the office, as well as discounts to ski resorts and theme parks, help it receive top ratings as one of America's happiest workplaces.
Companies say extraordinary campuses are necessary to recruit and retain top talent and to spark innovation and creativity.
(Read More: Cool Things Your Smartphone Will Soon Do)
And there are business benefits and financial results for companies that keep their workers happy. The publicly traded 100 Best Companies To Work For in America consistently outperform major stock indices and have more qualified job applicants and higher productivity, according to the San Francisco-based Great Place to Work Institute. That may not always be obvious, however.
"People do work really, really hard here," Facebook spokesman Slater Tow said as an engineer glided past a row of second floor conference rooms on a skateboard. "They have to be passionate about what they do. If they're not, we would rather someone who is."
He points out the Jumbotron frame for outdoor movies, the Nacho Royale taqueria, a bank branch with tellers standing by, an artist in residence. Traditional benefits are part of the Silicon Valley packages as well. Facebook offers free train passes, a shuttle to work, a month of paid vacation, full health care and stock options.
Facebook staffers are welcome to stop by and play in Ben Barry's Analog Research Laboratory, a large, sunlit studio with laser cutters, woodworking tools, a letter press machine and silk screening supplies.
"I believe if people feel they can control their environment, that leads to a greater sense of ownership over the product," says Barry, who makes posters for the campus walls with mantras like "What would you do if you weren't afraid?" and "Move fast and break things."
About six miles north at Google's headquarters, workers on one of more than 1,000 Google-designed bikes rolled from one building to another. Others stepped into electric cars, available for free check outs if someone has an errand. In one office, two young engineers enjoyed a beer and shot pool.
Google doesn't want its Googlers to have to worry about distractions in their life.
Concerned about the kids? Childcare is on campus. Need to shop and cook? Have the family dine at Google. Dirty laundry piling up? Bring it in to the office. Bring Fido too, so he doesn't get lonely. There's a climbing wall, nap pods (lay down in the capsule, set the alarm, zzzzz), a bowling alley, multiple gyms, a variety of healthy cafes, mini kitchens, and classes on anything from American Sign Language to Public Speaking. In a shared, community garden, Googlers plant seeds, knowing that if they get too busy, a landscaper will pull their weeds.
(Read More: Who's the Best Boss? A New Winner Is Crowned)
The company has no policy requiring people to be at work. But officials say Googlers want to come in.
"We work hard to create the healthiest, happiest and most productive work environments possible that inspire collaboration and innovation," said spokeswoman Katelin Todhunter-Gerberg.
Wheeler says the mega-complexes being built today will be hard to staff 10 years from now, and that the next era will see smaller workplaces where employees are responsible for meeting achievements and objectives, and have flexibility about when they come in to their office.
"When you look at how some of these companies operate, they're in effect, sweat shops. ... They want 80, 90, 100 hours of work. In order to even make that tolerable, of course you have to offer haircuts and food and places to sleep or else people would have to go home," he said.
(Read More: Why Your Slacker Co-Worker May Be the Happiest One)