The reason these â€œare you sureâ€ dialogs exist is because of broken applications. If applications just automatically saved your state and could restart with zero delay, youâ€™d never need to see this dialog, because there would be no penalty to accidentally closing an application.
Fortunately, web applications are fixing this. Because the web has so many errors, web applications are forced to auto-save all the time. Also, unlike their desktop counterparts, web applications are much faster to restart. They still need to be faster, of course, but they are an order of magnitude faster than their desktop equivalents already.