To visualise the order of execution of asynchronous operations

Image for post
Image for post

I remember when I first worked in JavaScript, I found it difficult to understand how to correctly handle asynchronous operations. I made some common mistakes like assuming AJAX is synchronous which causes my function always returning undefined. It was also difficult to get used to how setTimeout works. The fact that it does not block the code frustrated me.

It took me a long time to get used to how callback, promises and async/await work. One way I find it useful is to visualise the sequence of the execution in two dimensional timeline.

Synchronous World

In Python, I can use time.sleep

Building a Variable Name Dictionary by parsing React, Angular, Express and other JS library

Image for post
Image for post
A word cloud generated by parsed verbs

The problem

When an error message is thrown in the error log or finding a solution to “sort json array by key python”, it is likely that I can find the answer or at least some hints on the Internet. But when it comes to naming a variable, it tells me to name a meaningful, expressive, self-descriptive variable. The variable names need to follow the convention. In Javascript, variable and function names should be written in camelCase. I should use nouns for variable names and verbs for function names. …

Jack Siu

Comes up with ideas. Implements ideas.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store