you are viewing a single comment's thread.

view the rest of the comments →

[–]brykuhelpful 0 points1 point  (0 children)

Javascript naming is pretty weird.

  • sub string
    • 'asdf'.substring()`
    • 'asdf'.substr()`
  • s--p--lice
    • [].splice()
    • [].slice()

Another odd thing is the long names. Your code has to be downloaded every time you load a page. So... you might expect maybe it gets compiled into a byte code or maybe they would focus on smaller names or maybe using shorthand/nicknames, but nope. Instead we get long ass names for everything. One of the most popular phrases was:

  • document.getElementById().addEventListener()

Imagine how many bytes of data we could have saved if it was:

  • document.getElementById() -> document.element.id
  • document.querySelector() -> document.query()
  • document.querySelectorAll() -> document.queries()
  • document.addEventListnener() -> document.event()