Skip to content

Instantly share code, notes, and snippets.

@lingtran
Forked from rrgayhart/1602-es6-assignment.markdown
Last active July 1, 2016 18:21
Show Gist options
  • Save lingtran/b1fd3b908b73146335c964066f0aa6b0 to your computer and use it in GitHub Desktop.
Save lingtran/b1fd3b908b73146335c964066f0aa6b0 to your computer and use it in GitHub Desktop.
ES6 Assignment

Throughout the module (and your journey to Google enlightenment while working on IdeaBox2.0) you may notice a few different ways that JavaScript code is being written.

That might have something to do with something called ES6 and ES5

Fork this gist and answer the following questions:

  • What is ES6?

    • Response: ES6 is the most updated JavaScript language from ECMAScript 2015(ES5), which hasn't been updated since ES5 was standardized in 2009.
  • What is Transpilation and how does it relate to ES6?

    • Response: Transpilation is a specific term for taking source code written in one language and transforming into another language that has a similar level of abstraction. It is a specific type of compiling, meaning it is a specific type of transformation of source code written in one language into another language. JavaScript has various transpiler libraries, leveraging notable tools such as Babel and Gulp (it seems?). It appears to be popular to transpile from ES6 to other languages. Transpilers enables code written in ES6 to be executed in every browser.
  • Looking at the ES6 Features link below, discuss one update from ES5 and if it seems useful/superfluous:

  • Response: The update for modules seems really useful, even though module systems are commonplace. Simply looking at the overview and comparison between ES5 and ES6 here, what is immediately apparent are the syntactical differencse. ES6 introduces export and import keywords that appropriately express duties. Looking at the ES5 language, it looks more cumbersome and less readable (almost frightening). I found this article to be really helpful in understanding ES6 modules. It explains how it is actually static syntax, and will require utilizing a more dynamic, programmatic loader API such as Babel, etc. It seems because of the static syntax and ambiguously defined import in the standard, leveraging a dynamic loader API probably has interesting pros and cons. Any issue that arises while import processing will not give an error, but the API may provide errors. This may vary depending on which loader API is being used. Game Time will be interesting in this sense! Noted in the article is the advantage of saving network round trips, which means that this improvement will save any run-time performance costs. Neat!

Resources:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment