Imagine that you are behind the scenes of an API interface, which has already been written by a programmer. You are physically watching all the source code in the program work in sync and perform the way it should. In other words, in the background, behind the wall of code (think in 3D), similar to a movie or cartoon, the code executes in slow motion. You watch and can see each event unfold one at a time, as each line of code executes it does exactly what the programmer programmed it to do. While physically watching in terms of event handling, what would be the difference in viewing a Synchronous or a Asynchronous program in slow motion and watching each unfold in their own three dimensional movie? Which program would look more complex, the Synchronous movie or the Asynchronous movie, and which would be easier for a programmer to implement and code? No doubt, exciting contrasts, as well as huge differences in the two movies.
John Torjo wrote “Boost.Asio C++ Network Programming” which describes the challenges, advantages, and pitfalls of Synchronous and Asynchronous programming. What I like about this book is that Torjo really explains and breaks down in detail the reasons why a programmer would want to use Synchronous or Asynchronous programming. The book contains lots of code and comparisons using specific code examples demonstrating and contrasting the differences in Synchronous and Asynchronous programming. For example, in chapter 2, Torjo displays different code examples in Synchronous and Asynchronous programming, as well as why it is simpler to code in Asynchronous especially when an API uses multiple or hundreds if not thousands of concurrent clients.
This was a very interesting read and it was the first time I have ever read a book from John Torjo. With only 7 total chapters and a total of 156 pages, this is an action packed book and well worth the read. Without hesitation, anyone interested in Network API programming in C++ with Boost.Asio, I highly recommend they check out this book. Mostly because the book contains a lot of valuable information such as how to avoid certain pitfalls, examples of unnecessary code implementation, a vast amount of code to program, and heaps of on hands coding. In addition, throughout chapters 3, 4, and 5, the book also shows how to implement echo/client server applications including many graphical diagrams, which are used to help better understand complex connections. Moreover, there is also information about the differences of Asio (non-Boost) and Asio.Boost. Lastly, this book is written with simple and clear explanations for easy understanding and no fluff. If you’re new to Network Programming, API, or just Boost.Asio, than reading this book will give you a better understanding of Synchronous and Asynchronous programming, as well as how it works if you were physically behinds the scenes.
BOOK is available in an eCopy PDF at: Boost.Asio C++ Network Programming by John Torjo