You are reading a single comment by @barbiani and its replies. Click here to read the full conversation.
  • Fri 2018.11.09

    Well @barbiani, quite an impressive advancement in just over a week. Be careful, as at this rate, you may be teaching the class you are about to take!!

    Gordon mentioned this in your other post #2, and I called your attention to it again in #2 above. Templated Strings. And although I see you switched from the single quote ' to a back tick ` it isn't clear and may not have been explained well enough as to the reason why. The simple explanation is to maintain alignment to ensure valid Html is being coded, typically to locate closing elements in a tag set.

    If it wasn't clear, maybe using Line 9 rewritten will bring it all in to focus:

    toElement(`
     div align="right" class="td td_btn" pressed="${pressed}">
           span>${opts.label}</span>
           div class="td_button">${opts.glyph}</div>
    /div>
    `));
    

    In order to allow the code block to display and show the indent, I had to remove the Html leading angle brackets < so that the embedded code would not get rendered, (it formats and disappears) but rather just presented.

    Much easier to read, and to ward off possible debug scenarios.

  • ...quite an impressive advancement in just over a week. Be careful, as at this rate, you may be teaching the class you are about to take!!

    Actually js is not too far from C. What I find hard to digest is .NET with its amount of reserved words.

    @Robin You know that I am not writing these from scratch, right? I am taking many samples and figuring out what and how each thing does what it does. The rest is finding the hundreds of variable fields available on each element. Like the < select > < option > set() function from js that is still missing in the dash.

    ...The simple explanation is to maintain alignment to ensure valid Html is being coded, typically to locate closing elements in a tag set.

    I am not used to read html anyway... so it does not make a big difference to me. I was only following the original sources style.

About

Avatar for barbiani @barbiani started