{"id":409,"date":"2011-04-08T01:37:32","date_gmt":"2011-04-08T08:37:32","guid":{"rendered":"http:\/\/blog.mezeske.com\/?p=409"},"modified":"2011-04-08T01:37:32","modified_gmt":"2011-04-08T08:37:32","slug":"please-dont-request-user-input-in-the-middle-of-a-lengthy-task","status":"publish","type":"post","link":"http:\/\/blog.mezeske.com\/?p=409","title":{"rendered":"Please Don\u2019t Request User Input in the Middle of a Lengthy Task"},"content":{"rendered":"<p><img loading=\"lazy\" src=\"http:\/\/blog.mezeske.com\/wp-content\/uploads\/2011\/04\/say-no-to-cesura.png\" alt=\"Just Say No\" title=\"Just Say No\" width=\"375\" height=\"375\" class=\"alignleft size-full wp-image-410\" srcset=\"http:\/\/blog.mezeske.com\/wp-content\/uploads\/2011\/04\/say-no-to-cesura.png 375w, http:\/\/blog.mezeske.com\/wp-content\/uploads\/2011\/04\/say-no-to-cesura-150x150.png 150w, http:\/\/blog.mezeske.com\/wp-content\/uploads\/2011\/04\/say-no-to-cesura-300x300.png 300w\" sizes=\"(max-width: 375px) 100vw, 375px\"><\/p>\n<p>It\u2019s hap\u00adpened to every\u00adone.  You kick off a soft\u00adware installer, answer a few ques\u00adtions about how you\u2019d like things set up, click <em>next<\/em> and you\u2019re pre\u00adsent\u00aded with a long progress bar.  \u201cNo prob\u00adlem,\u201d you think to your\u00adself, \u201cthis is a good excuse to grab a cup\u00adpa joe.\u201d  You leave the com\u00adput\u00ader to its busi\u00adness and hit the kitchen, maybe catch\u00ading a glance at the paper.  After some time has passed, it occurs to you that the installer\u2019s prob\u00ada\u00adbly been fin\u00adished for a while, so you head back to your com\u00adput\u00ader to start using your fresh new soft\u00adware.  And then <strong><span class=\"caps\">BAM<\/span>!<\/strong>  You get slapped in the face with just one last ques\u00adtion that the installer needs you to answer.  It turns out that it\u2019s only par\u00adtial\u00adly com\u00adplete, and when you click <em>next<\/em> again, you\u2019re pre\u00adsent\u00aded with anoth\u00ader long progress bar.  Now you\u2019re faced with a deci\u00adsion: do you switch tasks again, or do you babysit the installer, in case it has anoth\u00ader question?<\/p>\n<p>This behav\u00adior dri\u00adves me <em>absolute\u00adly mad<\/em>.  I\u2019m impa\u00adtient with installers to begin with; they\u2019re a hic\u00adcup (albeit a nec\u00ades\u00adsary one) between me and the soft\u00adware I want to use.  Of course, it\u2019s not just installers that suf\u00adfer from this prob\u00adlem.  Any piece of soft\u00adware that has to per\u00adform some kind of long-run\u00adning task can be sub\u00adject to this annoy\u00adance, sim\u00adply by requir\u00ading user input any\u00adwhere except at the very begin\u00adning or end of a lengthy task.<\/p>\n<p>The amount of frus\u00adtra\u00adtion this bug caus\u00ades is direct\u00adly pro\u00adpor\u00adtion\u00adal to how long the task will take.  I recall a recent mishap where I was installing an old\u00ader Debian dis\u00adtro on an extreme\u00adly slow <span class=\"caps\">ARM<\/span> machine.  I thought I had answered all of its ques\u00adtions, and left my office to do errands for sev\u00ader\u00adal hours.  I was con\u00adfi\u00addent that when I returned, the machine would be ready to go.  Of course, you know how this sto\u00adry ends: upon my return, I found the installer wait\u00ading for input, and it took sev\u00ader\u00adal more hours for the instal\u00adla\u00adtion to com\u00adplete.  My work for the day was set back, and my sched\u00adule was thrown off.<\/p>\n<p>Thankfully, the solu\u00adtion to this prob\u00adlem is extreme\u00adly obvi\u00adous: batch up and prompt for all of the nec\u00ades\u00adsary user input before start\u00ading a long run\u00adning task.  Never, ever inter\u00adrupt the task to prompt for more input unless it is 100% unavoid\u00adable.  If tru\u00adly unfore\u00adseen cir\u00adcum\u00adstances do require user action, try to con\u00adtin\u00adue any work that can still be per\u00adformed.  If all of the work is depen\u00addent on the user feed\u00adback, con\u00adsid\u00ader con\u00adtin\u00adu\u00ading the work in the back\u00adground by guess\u00ading the most like\u00adly user response.  If the user shows up and enters a dif\u00adfer\u00adent response than the one guessed, back out the guess work and do the right thing.  If the user is not present to see the prompt, at least there\u2019s a chance that the long-run\u00adning task will con\u00adtin\u00adue down the right path uninterrupted.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It\u2019s hap\u00adpened to every\u00adone. You kick off a soft\u00adware installer, answer a few ques\u00adtions about how you\u2019d like things set up, click next and you\u2019re pre\u00adsent\u00aded with a long progress bar. \u201cNo prob\u00adlem,\u201d you think to your\u00adself, \u201cthis is a good excuse to grab a cup\u00adpa joe.\u201d You leave the com\u00adput\u00ader to its busi\u00adness&nbsp;and&nbsp;[\u2026]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"wp_typography_post_enhancements_disabled":false},"categories":[3,16],"tags":[20,5,6,24],"_links":{"self":[{"href":"http:\/\/blog.mezeske.com\/index.php?rest_route=\/wp\/v2\/posts\/409"}],"collection":[{"href":"http:\/\/blog.mezeske.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.mezeske.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.mezeske.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.mezeske.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=409"}],"version-history":[{"count":16,"href":"http:\/\/blog.mezeske.com\/index.php?rest_route=\/wp\/v2\/posts\/409\/revisions"}],"predecessor-version":[{"id":426,"href":"http:\/\/blog.mezeske.com\/index.php?rest_route=\/wp\/v2\/posts\/409\/revisions\/426"}],"wp:attachment":[{"href":"http:\/\/blog.mezeske.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=409"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.mezeske.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=409"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.mezeske.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=409"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}