When programming goes wrong

Mantas Donelavicius
2 min readFeb 11, 2017

--

You are probably expecting some funny story about somebody messing up. Then how the other guy solved the problem and they laught about it while drinking beer.

This isn’t this type of story. It won’t have the happy ending, at least not in the near future. This story is how simple code gets so complicated that it’s ridiculous.

As today's examples we will look at Google and PayPal API’s code. You are probably thinking: those are successful companies with a lot of resources and talented developers. How their code can be bad?

Google (Youtube)

In this example your job is to upload video to Youtube from PHP. Google’s example of doing that:

Whaaaaat? Over 100 lines of code to upload a video? Don’t believe me? Check it out for yourself. Can we improve it?

Was it hard to make it simple? Or at least have a simple interface for 95% of usage cases? We will never know…

Ok, that’s just one example. Let’s not make hasty conclusions and let’s take a look at PayPal. They are handling money. They must know what they are doing, right?

PayPal

Your job is to charge client’s creditcard when he enters his creditcard information on the website. Let’s look at the example:

Seems not to bad and the code is much shorter. They probably know what they are doing. Bzzzz, wrong!

This example if from real library that makes charging creditcards easier.

So why they are making things more complicated than they should be? Is this sadistic way to torture developers? Why things can’t be simple? Do you like working with such contraptions?

Conclusion

Not only big companies do that. A lot of API’s look like this. What do you think, why is this happening?

--

--