Some APIs change because the world evolves, some because they are fundamentally broken from the start; looking at you Thread.stop!

What makes API design hard is that it must endure time. As soon as the contract is out there, you can't just take it back without a world of pain. Stadia is a perfectly good example of lost trust.

What's with a recipe?

Both Coca-Cola and Pepsi have iterated their formulas over the years. It's a known fact that one of the major ingredients in Coke is now missing; coca-leave (cocaine) and cola-nut (caffeine) gave Coca-Cola its name.

Did you know that a single Illinois company, Stepen (NYSE:SCL), has DEA approval to import coca-leaves? They come from Bolivia or Peru and, after cocaine removal, Coca-Cola buys the leftovers to flavour its soft drinks.

The 70s saw the commodities boom and, with it, the last formula change.

In the aftermath of the six-days war, Egypt closed the Suez Canal, which stirred the oil crises. There was also a massive spike in Coffee price given that Brazil lost 2/3rds of its coffee plants and both Angola and Guatemala saw a civil war and a major earthquake.

Amidst the instability, the largest sugar producer at the time, the Soviet Union, started hoarding the carbohydrate to fend off further uncertainty.

That was the last change Pepsi and Coca-Cola made: high-fructose corn syrup. Until now.

Not all soda is corn-syrup based. Some countries kept using sugar. Most soda factories in Europe use beet sugar, whereas those in South America preferentially use cane sugar.

What's up with Pepsi API, then?

Given that for the last 50 years there was an implicit contract, it came as a surprise to learn that PepsiCo was sneakily messing with the original drink's recipe.

The idea is pretty smart, but for it to work, Pepsi can't make any fuss around it. The splashy campaigns of the past gave way to a covertness operation.

As of March 2023 Pepsi Original has only 15g of sugar per 330ml can. Less than half what it originally had!

During the pandemic, Pepsi Original, the blue can, saw a remake. On the outside, everything stayed surreptitious the same. On the inside, though, a tiny bit of sugar was replaced by AcesulfameK.

The idea is to keep replacing sugar by AcesulfameK in tiny amounts and, eventually, Pepsi Original will be sugar-free. Or not. Depends on market reaction.

On the few occasions PepsiCo talked about the change, it did so under the ruse of promoting a healthier lifestyle and without conceding a timeline. My best guess is that they'll be monitoring sales to see how far can they go.

But let's be honest, the end goal is profit and sugar-tax, which is not yet a thing in the US, eats a lot of profit in Europe.

In 2017 Pepsi sold 127 million litres of Pepsi original in the UK alone. In sugar-tax only, this amounts to over 10 million pounds. Coca-cola will pay more than 22 million of sugar tax just in the UK!

Sugar is bad, so this should be good, right?

Let's get back to the API. When you implement a public contract, your consumers, fittingly, have a certain degree of expectation. You will most definitely have an EULA that gives you free reigns over the system, but having people use your product is the end goal. As such, backward incompatible change will be frowned upon and, if it must be so, has to be explicit and perfectly documented.

Pepsi's strategy to bypass the sugar-tax is precisely the opposite.

You may argue that the majority of users will not notice and, if you're being pedantic, that it wasn't an API change, just a data change. While most people will definitely not notice, there's a minority whose systems will break.

People who are allergic to AcesulfameK and Aspartame!

A lifetime ago, I pursued a healthier lifestyle by switching to zero sugar sodas. As symptoms only showed up three weeks after the change, I missed the connection.

A constant need to pee. So bad it troubled my sleep and messed my work. A visit to the urologist and a multitude of exams later, I was running on empty. "Stress" and "the bladder is the canary in the coal mine of the human body" didn't bring resolve.

One day, out of despair, I gave way to bad habits of before. Two weeks later I was perfectly fine. Took me a relapse into zero-sugar drinks to make the connection!

I was lucky.

I got to know people who endured decades of misery before realizing Canderel® or similar, messed them up.

Embrace change, but engage users!

A good API is designed taking into consideration the consumer's needs. It should be explicit and allow for seamless integration. It should be complete. Concise and hard to misuse.

Be a good API designer.

Don't be like Pepsi.

By the very talented Jordan Crawford. Check out his latest creations on Twitter.

Out of spite, get yourself some Coca-Cola.

Edit: There's a Reddit thread where users say that in the US, Pepsi is still using the original formula. On top of that, in Peru (a sugar-tax country), Coca-Cola is following Pepsi's lead by feeling the markets' reaction to changing the formula without warning users.