Data Scientist Learning JS: Promises and resolve()
A data scientist shares insights on transitioning to software development and overcoming confusion between blocking and asynchronous code.

Stock photo for illustration only, not from the actual event
- A data scientist transitioning from Python and R is learning web development from scratch.
- The learning journey was triggered by building a mock data layer for a fitness social app.
- The author initially confused asynchronous logic with blocking code behavior.
Transitioning from a data science background heavily reliant on Python and R to software development brings inevitable learning curves. A writer on Dev.to shared their journey of learning JavaScript Promises and the resolve() function through the lens of their existing knowledge, specifically while building a mock data layer for a fitness social app to simulate users fetching new posts from a feed.
Initially, the author fell into the trap of confusing the logic with blocking behavior commonly seen in web scraping tasks—such as using time.sleep() or Selenium's WebDriverWait. In those blocking scenarios, the output strictly follows an order where the script pauses entirely until the wait concludes or a condition is met.
Grasping the shift from synchronous blocking to asynchronous non-blocking code is a classic hurdle for developers migrating from data analysis languages. JavaScript's ability to keep executing the rest of the program while waiting for network requests ensures that client-side applications remain responsive, which is foundational for modern web architecture.
However, the actual output yielded a different sequence: the synchronous code ran and printed first, followed subsequently by the fetched posts. Unlike the former approach where a single thread pauses completely, asynchronous handling allows the rest of the application to continue running smoothly during the waiting period.
Source: Dev.to
Found something wrong in this article? Report an issue with this article
Comments
Leave a Comment