The “Bug-O” Notation
I&#x27;m not familiar with the language, and yet I remain unconvinced because I could still understand what the code in the first example is doing, and more importantly, <i>see it all at a glance</i>. I don&#x27;t have to jump around between functions to follow the logic. More verbose code means more opportunity for errors and more code to look through and debug.<p>That said, I&#x27;d probably write something closer to this (once again, not sure if this is even valid, but you can just treat it as pseudocode):<p><pre><code>    &#x2F;&#x2F; don&#x27;t create these every time, we&#x27;re just changing their visibility
    let retryButton = createRetryButton(); &#x2F;&#x2F; calls trySubmit() when clicked...
    let successMessage = createSuccessMessage();
    let spinner = createSpinner();
    let errorMessage = createErrorMessage();
    ...
    function trySubmit() {
     &#x2F;&#x2F; assume these don&#x27;t cause errors if the child isn&#x27;t already there
     formStatus.removeChild(errorMessage);
     formStatus.removeChild(retryButton);
     formStatus.appendChild(spinner);
     succ = submitForm();
     formStatus.removeChild(spinner);
     if(succ)
      formStatus.appendChild(successMessage);
     else {
      errorMessage.setMessage(error);
      formStatus.appendChild(errorMessage);
      formStatus.appendChild(retryButton)
     }
    }</code></pre>