Skip to main content
Question Protected by gnat
Meta questions about votes don't belong into a question body, they can be posted as a comment.
Source Link
Doc Brown
  • 220.3k
  • 35
  • 410
  • 623

I'm a career programmer, very comfortable writing programs in Python, and recently started learning Node.

I understand the asynchronous features are useful in many situations, but when I debug my code, I find myself adding await before every single statement (including debug log statements), to be absolutely sure the program is doing what I expect, and is outputting logs in the order I expect so that I can see what is happening.

I always want my code to execute synchronously. Is there a better way to achieve this than adding await at the start of every line?

UPDATE: Why the downvotes? This is a serious question about software engineering in an appropriate forum.

I'm a career programmer, very comfortable writing programs in Python, and recently started learning Node.

I understand the asynchronous features are useful in many situations, but when I debug my code, I find myself adding await before every single statement (including debug log statements), to be absolutely sure the program is doing what I expect, and is outputting logs in the order I expect so that I can see what is happening.

I always want my code to execute synchronously. Is there a better way to achieve this than adding await at the start of every line?

UPDATE: Why the downvotes? This is a serious question about software engineering in an appropriate forum.

I'm a career programmer, very comfortable writing programs in Python, and recently started learning Node.

I understand the asynchronous features are useful in many situations, but when I debug my code, I find myself adding await before every single statement (including debug log statements), to be absolutely sure the program is doing what I expect, and is outputting logs in the order I expect so that I can see what is happening.

I always want my code to execute synchronously. Is there a better way to achieve this than adding await at the start of every line?

added 107 characters in body
Source Link

I'm a career programmer, very comfortable writing programs in Python, and recently started learning Node.

I understand the asynchronous features are useful in many situations, but when I debug my code, I find myself adding await before every single statement (including debug log statements), to be absolutely sure the program is doing what I expect, and is outputting logs in the order I expect so that I can see what is happening.

I always want my code to execute synchronously. Is there a better way to achieve this than adding await at the start of every line?

UPDATE: Why the downvotes? This is a serious question about software engineering in an appropriate forum.

I'm a career programmer, very comfortable writing programs in Python, and recently started learning Node.

I understand the asynchronous features are useful in many situations, but when I debug my code, I find myself adding await before every single statement (including debug log statements), to be absolutely sure the program is doing what I expect, and is outputting logs in the order I expect so that I can see what is happening.

I always want my code to execute synchronously. Is there a better way to achieve this than adding await at the start of every line?

I'm a career programmer, very comfortable writing programs in Python, and recently started learning Node.

I understand the asynchronous features are useful in many situations, but when I debug my code, I find myself adding await before every single statement (including debug log statements), to be absolutely sure the program is doing what I expect, and is outputting logs in the order I expect so that I can see what is happening.

I always want my code to execute synchronously. Is there a better way to achieve this than adding await at the start of every line?

UPDATE: Why the downvotes? This is a serious question about software engineering in an appropriate forum.

Source Link

How can I code synchronous programs in Node?

I'm a career programmer, very comfortable writing programs in Python, and recently started learning Node.

I understand the asynchronous features are useful in many situations, but when I debug my code, I find myself adding await before every single statement (including debug log statements), to be absolutely sure the program is doing what I expect, and is outputting logs in the order I expect so that I can see what is happening.

I always want my code to execute synchronously. Is there a better way to achieve this than adding await at the start of every line?