eli5: What is the difference between a Protocol and API?

201 views

eli5: What is the difference between a Protocol and API?

In: 0

2 Answers

Anonymous 0 Comments

A protocol is basically a set way of doing something.

When you write a letter, you start with a salutation (“dear X”), the body, then an ending (“sincerely”) and your name. That’s a protocol.

When you cross the street, you go to a crosswalk. If there is a light you wait for it to signal for you to cross. If not, you look both ways and wait for a safe time to cross. That’s a protocol.

An API is basically a collection of protocols that allow one piece of software to communicate with another without needing to understand the specifics.

One analogy is how a car works. In a car you have a break pedal on the left, a gas pedal on the right, and a steering wheel. All cars, trucks, vans, what have you, have this set up and a person driving them only needs to know how to accelerate, brake, and steer using them. How the car actually works (how it translates you turning the steering wheel into turning the tires, how it accelerates when you press the gas or brakes when you press the brake pedal) is irrelevant to you. You can operate it without this knowledge.

You are viewing 1 out of 2 answers, click here to view all answers.