loading...
Cover image for If Javascript was a person...

If Javascript was a person...

derder56 profile image DerDer56 ・4 min read

Javascript takes care of everything from frontend to backend and has been used on an estimated 2 billion sites. There's no doubt that it's a pretty succesful programming language. But what if it wasn't a programming language? What if it was a person? Would it still be succesful? How would it go to school or work? How would it talk, drive, shop, or eat? Prepare to have your questions answered in this article.

NOTE: All opinions expressed in this post are jokes and are not meant to be taken seriously.

How would it talk?

How Javascript would talk

The only "Talking" Javascript does is responding with either an error, a value, or undefined. So I'm guessing that if somebody tried to talk to Javascript, saying something like "Hi, how are you?", it would say

Parsing Error: Unexpected token are

Which is exactly what my Javascript editor says when I type in the same message. I think everyone can agree that trying to communicate with Javascript would be pretty hard.

How would it drive?

How Javascript would drive

Road signs such as stop signs are intended for humans, who take time to see them and react to them. Sadly, Javascript is near-instant and would stop the second they see the stop sign, causing quite a few car crashes.

I really doubt that Javascript could get a driver's license. Also, yes, I know I'm amazing at drawing orange cars.

How would it go to school?

How Javascript would go to school

Javascript would normally be an amazing student. Why "normally"? Well, when you explain the question, Javascript would solve it in a millisecond. But the second you use × or x as a multiplication symbol, Javascript would just give up. Better stick to *.

After all, you have to explain the question perfectly or Javascript will get an F in your class.

How would it shop?

How Javascript would shop

Javascript is single-threaded. That means that it can only do one thing at once, and it does things in the same order you give them. This is a helpful trait as a programming language or else your variables would be undeclared and it would pretty much break the whole web. But it's not quite the optimal trait for a person.

So if you had a shopping list function, it would do it all in the exact order you wrote it in. However, that might not be the most efficient way. If you wrote a shopping list that went Ham, Eggs, Beef, Milk, Pork, Cheese, Javascript would zig-zag from the meat side to the dairy side and back. Better send somebody else to do your shopping next time!

How would it eat?

How Javascript would eat

Most Javascript programmers use repeating for loops to complete multiple similar tasks. This means that when Javascript does something, it usually does it all at once. Take eating, for example. If the meal had multiple options, in this case squares, triangles, and circles, (because that's definitely how food looks) Javascript would consume all of the squares, then the triangles, then the circles, unlike how regular people would mix them. In fact, its eating cycle looks like this, when written in Javascript:

var plate = document.plate;
// I made up plate
function eat(food) {
  for (var i = 0; i < food.length; i++) {
    plate.consume(food[i]);
    // I also made up consume
  }
}
eat(plate.squares);
eat(plate.triangles);
eat(plate.circles);

How would it go to work?

How Javascript would go to work

It wouldn't. It just wouldn't. It wouldn't get out of bed, go to work, leave work, or go to bed. Something we have ignored in the previous "how would"s is that Javascript does nothing unless someone else tells it specifically what to do. So Javascript would be pretty good at working, but it would need somebody else to instruct it.

If it could do work by itself, Javascript would always be left picking up after and doing tasks for other people, just like how Javascript is used to do many jobs for other languages such as HTML and CSS.

Thanks for reading!

All in all, Javascript woudn't be a great person. Due to the fact that it would do many things wrong even if you told it what to do, I think it's fair to say that Javascript is better off as a programming language.

If you enjoyed this article, please consider leaving a like or helpful feedback in the comments. Bye!

How Javascript would say goodbye

P.S. The images in this post were made on Google Slides.

Discussion

pic
Editor guide
Collapse
cyril_ogoh profile image
ogoh cyril

Enjoyed reading it 😂😂

Collapse
cyril_ogoh profile image
ogoh cyril

If javascript was a person
It's would always keep to it promises 💚

Collapse
patarapolw profile image
Pacharapol Withayasakpunt

I had to Google, how to break promises, in the middle...

Collapse
derder56 profile image
DerDer56 Author

Lol, you're right!

Collapse
tusharpandey13 profile image
Tushar Pandey

Loved the last one 😂

Collapse
derder56 profile image
Collapse
pefrocht profile image
pefrocht

I am from Brasil.
Muito engraçado. kk
Parabéns

Collapse
derder56 profile image
DerDer56 Author

Obrigado!

Ah yes, the translator.