Sooner or later, nearly every entrepreneur and every leader of a mid-sized company discovers that failure is part and parcel of the entrepreneurial journey. The best of them, however, get back up, dust themselves off, and proceed more or less unharmed, if not chastened.

As investors say in Silicon Valley, "Failure is an education on somebody else's dollar." Failure in life and in business, as it turns out, is a pretty good teacher.  

Lessons about breaking the rules.

Notwithstanding the value of such lessons to those who directly experience them, there are wider lessons anyone can learn by studying the failures of others and taking on board lessons learned. Take for example Josephine, a 2014 California startup whose founders, Tal Safran and Charley Wang, wanted to create an online marketplace to bring home cooking to San Francisco Bay Area consumers and, in the process, provide livelihoods for the cooks who were doing the cooking.  A perhaps noble and creative idea, to be sure.

Having observed other Bay Area entrepreneurs, including the founders of Airbnb and Uber, take on entrenched industries without regard to whether their startups were permitted under the current regulatory frameworks, Safran and Wang figured they would be fighting a regulatory battle at some point in the business. They saw such an effort as a good thing: removing the regulatory barrier for home cook entrepreneurs would further their mission on a larger scale than the business itself would.

The duo rented a small house in Oakland and began experimenting and learning. It soon became apparent that Josephine would empower mostly low-income cooks-typically women, immigrants, and people of color-to become entrepreneurs, and would provide their time-pressed neighbors access to an incredible diversity of interesting and healthy food. Both customers and cooks quickly relished the opportunity, and the experience, too!

The Josephine team already knew that food was a regulated business. In California, the Homemade Food Act of 2012 specified that cook-at-home practices were only allowed for food that was safe at room temperatures-cookies, candies, snack foods, granola, jams and the like. Dairy and meat were excluded. Permits were required, through a somewhat burdensome and costly process. Annual sales for such a home business were limited to $50,000. But Safran and Wang moved forward.

Lesson number 1: On taking the high road.

Some local legislators loved the idea. They helped the Josephine founders seek changes in the law which would expand what could be prepared at home under the Homemade Food Act. But alarm bells were ringing in regulatory circles.

In late 2015, the regulators pounced, delivering cease and desist orders to Josephine's cooks and to Josephine, too. Justin Malan represented the Environmental Health Directors from 62 state jurisdictions in California. He imagined the risks of improperly handled raw sushi. He thought about home cooks who might come home from the grocery store with raw chicken, get distracted by something else, and then re-refrigerate it after hours on the kitchen counter. Malan filed a brief opposing the bill immediately. Others chimed in. "Sharing is great," said Sarah Desmond, the executive director of Housing Conservation Coordinators, "but not every law is ‘outdated' just because it gets between a startup's CEO and his payday."

The lesson here? Taking a principled high road can be a good idea and may win supporters in legislative circles. But there's no guarantee that such a strategy will succeed.

Lessons number 2 and 3: On getting laws changed.

The Josephine founders were probably naïve to believe that engaging with the regulatory authorities in one city after another would bring about different results than had played out the first time in Alameda County, and that any such changes would happen quickly.

The lessons here? The wheels of justice almost always turn very slowly. And regulators only enforce the laws. They don't make them. Even when laws change, getting them implemented is a nontrivial matter. In Josephine's case, despite an eventual change in the California law in 2018, selling home-cooked meals from one's kitchen remains a nonstarter in almost all of the state.

Lesson number 4: Legal ambiguity is the difference-maker.

Not asking permission and (eventually) begging forgiveness had served Airbnb and Uber very well as their founders started and then rapidly grew their businesses. It's a time-honoured mindset under which many entrepreneurs operate. But taking that approach when there is legal ambiguity or when there is no applicable legislation is entirely different to doing so when what's being done is clearly illegal, as was the case with Josephine's home cooking.

If there's regulatory ambiguity, as was the case for Airbnb and Uber, it can make good sense for an entrepreneur to put their head down and forge ahead. As observer Julie Samuels noted, "If Uber had gone to the regulators first, the entrenched interests would have crushed them in seconds."

The lesson here? When the law is clear, ignoring it is no excuse. If what you plan to do is plainly illegal, as for Josephine, my advice is to forget about your idea and move on.

Lesson number 5: On the appropriateness (or not) of taking the law into one's own hands.

"Is it appropriate for entrepreneurs to set sail into uncharted waters where the law has not yet ruled or where the laws are in conflict with one another?" one might ask. That's a moral and ethical issue for which there's not always a clear answer. Sometimes, however, societies make progress when bold entrepreneurs take them forward. Who would have invented the on-demand ride-hailing industry if not Uber's Garret Camp and Travis Kalanick? Who would have made it possible for millions of people around the world to earn income when all or part of their home is unused if not Airbnb's Brian Chesky and Joe Gebbia?

The lesson here? Who will make your corner of today's world a better place, if not you?

On breaking the conventional rules.

Happily, I've discovered that many successful entrepreneurs exhibit one or more of six break-the-rules mindsets that allow them to take advantage of opportunities that present themselves along the entrepreneurial path. Surprisingly, however, these mindsets fly in the face of what's taught in business schools about strategy, core competencies, target marketing, financing and more. They run counter to the conventional wisdom that's typically found in large and well-established companies. Never asking permission, and begging for forgiveness later, if necessary, is but one of them.

If you've spotted an opportunity to change the world, or at least your small corner thereof, if you're doing something in a completely new way which the existing laws have not contemplated, a la Airbnb and Uber, I suggest you proceed. But breaking the law where the law is clear? Most certainly not. You'll waste lots of time and money and your entrepreneurial talent, too, as Tal Safwan and Charley Wang now know. Your entrepreneurial talent is too precious an asset to waste!

John Mullins is an Associate Professor of Management Practice at London Business School and author of new book Break the Rules! The Six Counter-Conventional Mindsets of Entrepreneurs That Can Help Anyone Change the World