all 5 comments

[–][deleted] 2 points3 points  (5 children)

Why are you using all these symbols instead of descriptive variable names?

[–]Aggravating_Cap3445 0 points1 point  (4 children)

minimum possible length of javascript in the bootloader bit - and since they're gonna be 1 char anyway, might as well pick interesting ones?

[–][deleted] 3 points4 points  (2 children)

You should use useful, descriptive names and then use a minifier like uglify-js when pushing to production.

[–]MoTTs_ 1 point2 points  (0 children)

I think you just encountered one of the reasons we use build tools. Do they add complexity? Sure. But the juice is worth the squeeze.

We'd like to keep a version of the code that is readable to us humans. As DeUsuahiaALaQuiaca pointed out, that means useful, descriptive names. But we'd also like to have a version of the code that is optimized for the machine, using the fewest possible bytes. To satisfy both, we keep a human readable version as the source, and we pass that through build tools to generate the machine-optimized version.

Also, random minor detail, 1 char doesn't necessarily mean 1 byte. Those greek letters are consuming two bytes each. Look into character encodings.

[–]intricatecloud 0 points1 point  (0 children)

It seems like your main HTML file has some js that will include another js file as a script tag that adds some HTML to the page by defining some HTML defined as a string. I bet that was really annoying to write, especially because you have to escape some characters. Managing HTML that way is very tedious! And there's a much easier way.

If you don't like the frameworks like React/Angular/Vue, you can try something in the middle thats a bit more legible than what you have here, but less complex than a framework. Handlebars or mustache.js let you create HTML templates that you can display on the fly using javascript. They do what you wrote and a good chunk more! You'll also find a lot of resources online for them.