Earlier quoted context omitted.
'readSync' does two different things - tells the OS we want to read some data and then waits for the data to be ready. In a good API design, you should exposed functions that each do one thing and can easily be composed together. The 'readSync' function doesn't meet that requirement, so it's arguably not necessary - it would be better to expose two separate functions. This was not a big issue when computers only had…
> tells the OS we want to read some data and then waits for the data to be ready No, it tells the OS "schedule the current thread to wake up when the data read task is completed". Having to implement that with other OS primitives is a) complex and error-prone, and b) not atomic.
Even websites had this problem with freezing the browser in the early AJAX days, when people would do a synchronous XMLHttpRequest without understanding it.