Stories from the field:

Why would anyone code an API in Javascript?!

Let me answer this by indulging you in a little real-life story.

Recently I spent some time in Milan. I was consulting a leading digital services company on how to integrate client-side software I’ve sold to one of their fintech clients. So these guys are sort of contractors and they have around 5000 coders worldwide, their own multi-story buildings in many cities and all that fancy stuff. I was called on sight to work with one of their best back-end and front-end devs they’ve brought for me from their offices around nearby cities.

I mostly worked with the back-end dude, let’s call him Sebastian, since they already had a design that was very back-end oriented. Sebastian was enthusiastic, skillful and well informed on the stack his company uses. Being the huge corporation they are, they operate on traditional, tried-and-true technologies like Java with Spring framework to build their APIs.

By the end of the day, we were chilling about and I was showing him a node API I was working on. At some point, I made a quick change in the code, hit ctrl+s and went straight back to the browser to demo it.

But Sebastian had already stopped following me at that point. Seb was struck in awe and bewilderment…

Sebastian: Wait, was that… But… wait, you need to compile, deploy and re-serve it, no?
Me: Just did. Typescript compiled to Javascript, linting passed, all the unit and integration tests passed and the API was re-served, see?

As I say this, I show him in the terminal the output of the typescript compiler and mocha test runner. Then I show in the browser that the API returns the updated response, as expected after my last code change.

Sebastian looks back at me square in the eyes, clad in denial and disbelief like a kid who just found out there is no Santa Claus.

Seb: This cannot be right. When I make a change, it takes me at least 5 minutes, more like 10 actually, before I can connect to the API. How do you do this?
Me: Well it’s node. I do have some extra “doodads” I have set up in here so that whenever I save, all of this is done automatically, but really it’s node, it’s fast, yes! You’re doing Java, right?

That last one… I really shouldn’t have said that last one, but hey, that’s me :P.

Seb was now quiet. His face was getting red and kinda shaking and his expression was a mix of “my whole life is a lie” blended with an “I’ll just curl into a ball here and cry” and possibly some “fuck off” for good measure (but I deserved that, ok :P).

With all this going on, I was squirming like a proud cheesy “wha, dude, want some o’ dis?!”.

I felt like a superhero motherfucker. But really, I was only just using node.

Sebastian had heard about node, but being a back-end developer in a corporate environment, he doesn’t code in Javascript at all. He always thought that JS on the back-end was a crazy idea. Now there’s a lot to be said for and against each technology, and honestly I will not go into that now.

I do know, though, that waiting 5 freaking minutes because you added a new line in your source, is very close to the definition of crazy…


If you found this was worth your time, please click the ♡ below so that other people may see it here on Medium.
Thank you for your attention.
 -- maninak