And I hope to retire in Italy some day.
And I hope to retire in Italy some day.
Good time to watch clouds and eat ice cream.
How often have you accomplished something really worthwhile all by yourself, in a complete vacuum? You did something good without any help or advice from anybody, no information, materials or services from any outside sources? Perhaps you have but most of the time when we accomplish something worthwhile it isn’t in a complete vacuum but rather with help, inspiration or information from outside sources.
Web applications are much the same: most web applications nowadays aren’t stand alone, siloed applications anymore but share information with other computer systems. Web applications can source news, weather, maps, feedback widgets and many more from other computer systems and similarly provide their own information to outside systems.
REST API is a bit of a buzzword nowadays in programming but essentially it’s an architectural style of programming to allow independent computer systems to communicate with each other. For many developers the nuts and bolts are actually easier to understand than the concept and this past week I found myself at the office explaining the concept of REST APIs using Peruvian history, culture, and my inlaws. Listen in!
Let’s say Bloomie got tired of mellow and decided to run some IKN content. And the Economist, Otto’s alma mater and a handful of his blogging buddies all wanted to run IKN content as well. Prior approval and a small nominal fee. Otto decides to make the following content available to other computer systems:
The programmer bloke sets up a new URL at api.incakolanews.com which is essentially the home page of the machine readable version of IKN. The output of this URL is not human-readable, it’s some machine-readable format like JSON. Asi:
All that jibberish just means that the machine readable home page of IKN has no content other than 3 links to the specific sections Otto makes available to client computer systems.
But you wanted to hear about my inlaws, and Peru, no?
Once upon a time there were big land owners in Peru, you can still see the abandoned mansions around the Peruvian countryside. Under the military government of Velasco in the late 1960s land owners were expropriated. Then followed a collapse of the agricultural economy and massive migration to the cities. Among the land owners who were expropriated were my wife’s family. They weren’t big land owners or wealthy by today’s standards but they were land owners nonetheless. Today divisions remain in Peru, not just between rich and poor but who you are, where you come from, the part of town you live in, often determines how you live more than your personal economy does.
Better if Mamacita Linda doesn’t hear about this but it’s possible every now and then I might have vented at the office about my inlaws, how supremely spoiled some of them are. Not in terms of material possessions but rather “I’ll be attended, any time all the time”. I know that sounds terribly harsh but maybe they were just a product of their environment. Maybe they still hold a grudge over the expropriations, on some level I could understand.
Back to the REST API. APIs are big money, not the kind of “can I write some sponsored content on your blog and pay you $0.35 for every 2 million clicks” kind of money. APIs provide your core content or functionality to other computer systems, so if your content or functionality has value, your API is worth a lot of money. The overriding concern then in programming an API is to make life easy on your client applications. The easier your API is to consume, the happier your clients will be.
If I had to write the fictional IKN API, the only code Bloomie and all of Otto’s other clients would need is this:
Five lines of code, give or take. Of course there’s a lot of work on the IKN side to make this possible but on the client side 5 lines of code should be all that’s needed to present the information to the end user and allow the end user to navigate through the content provided by the API.
The other day some of our developers were working on code for the next phase of the CoolCalc applications and a whole bunch of code was in the process of being written for client applications. I struggled to explain the REST API concept for a moment. You see where this is going.
“Think of the client applications like my wife’s aunt so-and-so!”
Not to generalize but it isn’t sarcasm or an exaggeration to say some children of expropriated Peruvian land owners don’t know how to cook a hard boiled egg. They don’t want to know how to cook a hard boiled egg. Obviously – in their mind – the hard boiled egg should be served for them. Once I’m done you can clean the table.
A REST API should be designed as if the client applications are those types of Peruvian inlaws. Our developers are from all types of backgrounds but every one of them understood 😉
Did you know only sexy people read this blog? Sure you did! Other than that we get a pretty good mix but for all you sexy people who aren’t 3×7 anymore I’ve got some bad news:
I just heard Avril Lavigne on the radio. On the classic rock station.
If you’re like me, you’re older than you feel 😖
We’re having friends over tonight so you know what that means: papi gets to cook his super world famous Kiwicha chicken strips. Seriously, kids come from far and away to eat my Kiwicha chicken strips. For full disclosure, they also come over because I serve Mamacita Linda and all the other mamacitas fernet con coca.
Kiwicha, Amaranthus caudatus or Love-lies-bleeding if you prefer is a staple here in the Andes. You people in the industrialized world – at least most of the readers of this fine blog hail from those parts – now call Kiwicha a “super food” but that’s only because you’re so used to eating processed, industrialized food-like substances that anything natural like or milk or honey is now considered a super food up there.
The recipe for my world famous Kiwicha chicken strips? There isn’t a recipe per se because in my kitchen everything is al gusto but the secret is you need 2 bowls: flour in one bowl, with condiments of your choice, and not-too-liquidy liquid in a second bowl. The key to beautiful golden crisp chicken is this: first you roll the chicken in the flour, then dip in the liquid and then back again in the flour. When all the chicken strips are ready, fry 8 or 9 minutes (at 3,400 meters elevation, may be a few minutes less at lower altitudes) and eat!
It works with any kind of flour but I use about 50% Kiwicha and 50% white flour. Sometimes I’ll use 50% Quinoa which works just as well as the Kiwicha. When you use more than half Kiwicha (or any other darker color flour) it’s a bit trickier to obtain the nice golden crisp color. The liquid where the pollitos go “swimming” consists of 50% milk, 50% cerveza, some eggs and a dab of flour. Both bowls get salt, pepper, whatever condiments spin your propeller on any given day.
Fair warning: when you have 2 or 3 kids that “help” you cook, it sometimes gets a wee bit messy. If you do the liquid just right, have a fire hose ready to wash their little hands afterwards.
OK you got me, it’s not actually a selfie but I did just get my first ever smartphone thingy. Cute, no?
Yes I know it’s 2018 and it’s a terrible thing that I would put a picture of a girl on the blog just because she’s cute. Spare me your righteous lecture and hear me out:
So you might imagine if there was ever a guy who’s under some external pressure, my poor cousin Jeroen is that guy. Jeroen needs to fly out to Peru and find out who’s in that picture.
Look this is the least bad picture from Mamacita’s birthday bash, eat the cake moment. Whatever the picture taker person tried to do obviously didn’t work. The camera has an “auto” setting but inebriated people don’t use “auto” settings any more than middle age guys ask for directions. Hey Kodak & co, don’t be a bunch of stiffs. Add an “inebriated” mode to your products already and preserve millions of happy moments for future generations!
No good pics but the party was a blast, take my word for it 🙂