Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

TypeScript, Dart, CoffeeScript and JavaScript Comparison

1,246 views

Published on

Following the emergence of ECMAScript 2015 many developers wonder about the added value of using TypeScript. The same apply for many other programming languages that transpile into JavaScript, such as CoffeeScript, Dart, Scala.js, ELM and others.

During the meetup that took place on September 7th we conducted a detailed comparison between TypeScript, Dart and CoffeeScript as well as their added value comparing with writing our code in ECMAScript 2015.

This video clip at includes my talk in that meeting. The talk was in hebrew.

More information about the FED course I deliver can be found at fed.course.lifemichael.com

Published in: Software
  • Be the first to comment

TypeScript, Dart, CoffeeScript and JavaScript Comparison

  1. 1. TypeScript, Dart, CoffeeScript and JavaScript Comparison LifeMichael.com Haim Michael September 7th, 2016 All logos, trade marks and brand names used in this presentation belong to the respective owners.
  2. 2. Table of Content LifeMichael.com ● What is JavaScript? ● ECMAScript Specification ● Transpiling into JavaScript ● What is TypeScript? ● What is Dart? ● What is CoffeeScript? ● Detailed Comparison ● Questions & Answers
  3. 3. What is JavaScript? LifeMichael.com ● The JavaScript programming language is been used on multiple different platforms. Some belong to the client side. Other to the server.
  4. 4. ECMA Script Specification LifeMichael.com ● The ECMAScript sets some order in the JavaScript eco system. ● ECMAScript 2015 (ES6) ECMAScript 2016 (ES7) ECMAScript 2017 (ES8) ...
  5. 5. ECMA Script Specification LifeMichael.com http://kangax.github.io/compat-table/es6/
  6. 6. Transpiling into JavaScript LifeMichael.com ● There is a huge number of various programming languages we can transpile into JavaScript. https://github.com/jashkenas/coffeescript/wiki/list-of- languages-that-compile-to-js
  7. 7. What is TypeScript? LifeMichael.com ● The TypeScript programming language was developed by Microsoft. It is an open source programming language. ● The code we write in TypeScript is transpiled into JavaScript, so we can basically use TypeScript wherever we use JavaScript. http://www.typescriptlang.org
  8. 8. What is TypeScript? LifeMichael.com ● TypeScript is a superset of JavaScript. It includes the entire JavaScript programming language together with additional capabilities. ● In general, nearly every code we can write in JavaScript can be included in code we write in TypeScript.
  9. 9. What is TypeScript? LifeMichael.com ● TypeScript's main added value is the ability to code with types. It allows us to define new classes and new interfaces. TypeScript allows us to specify the type of each and every variable and is even capable of interfering the type by itself. TypeScript allows us to use JavaScript as if it was a strictly type programming language.
  10. 10. What is TypeScript? LifeMichael.com class Rectangle { private width:number; private height:number; constructor( w:number, h:number) { this.setWidtht(w); this.setHeight(h); } setWidtht(num:number):void { if(num>0) { this.width = num; } } … }
  11. 11. What is Dart? LifeMichael.com ● Dart is an open source class based, object oriented, optionally typed programming language that allows us to develop browser based one page web applications. Dart can be used for the server side. ● Dart is developed by Google and the initial plan was to have a Dart VM installed on every web browser. http://www.dartlang.org
  12. 12. What is Dart? LifeMichael.com ● Using the Dart virtual machine we can execute the code written in Dart on the server side. ● We can execute the code either by using a web browser that supports Dart or by compiling the code into JavaScript.
  13. 13. What is Dart? LifeMichael.com class Rectangle { double _width; double _height; Rectangle(double w,double h) { width = w; height = h; } get width => _width; set width(size) => (size>0)?_width=size:_width=10.0; get height => _height; set height(size) => (size>0)?_height=size:_height=10.0; area() => width * height; perimeter() => 2*(width+height); }
  14. 14. What is Dart? LifeMichael.com main() { var ob = new Rectangle(3.2,4.4); ob.width = 20.2; ob.height = -4.1; var area = ob.area(); print("area is $area"); }
  15. 15. What is CoffeeScript? LifeMichael.com ● CoffeeScript is a relatively small programming language we can use for writing code and later transpile it into JavaScript. ● CoffeeScript evolvement was inspired by Python and Ruby. CoffeeScript provides developers with tools similar to those you can find in Python and Ruby. http://www.coffeescript.org
  16. 16. What is CoffeeScript? LifeMichael.com class Person constructor: (@firstName,@lastName,@id) -> printDetails: -> console.log "first name is #{@firstName}" console.log "last name is #{@lastName}" console.log "id is #{@id}" Person a = new Person("haim","michael",123123) Person b = new Person("danidin","jack",234234) a.printDetails() b.printDetails()
  17. 17. Detailed Comparison LifeMichael.com Strict Dynamic WhiteSpacesSensitivity Types Capabilities LowHigh Coffee Script Dart TypeScript JavaScript
  18. 18. Detailed Comparison LifeMichael.com Low High CapabilitiestoUse3rd PartyJSLibraries Object Oriented Capabilities LowHigh Coffee Script Dart TypeScript JavaScript
  19. 19. Detailed Comparison LifeMichael.com Not Available Available ReleaseofNewVersions Independent Virtual Machine RareFrequently Coffee Script Dart TypeScript JavaScript (1) https://www.techempower.com/benchmarks/ (1)
  20. 20. Detailed Comparison LifeMichael.com Simple Difficult SupportforGenerics Developing with Angular 2 NotAvailableAvailable Coffee Script Dart TypeScript JavaScript
  21. 21. Detailed Comparison LifeMichael.com Low SupportforMethodsOverloading Support for Use of Interfaces NotAvailableAvailable Coffee Script Dart TypeScript JavaScript High
  22. 22. Detailed Comparison LifeMichael.com Low SupportforMethodsOverloading Support for Access Modifiers NotAvailableAvailable Coffee Script Dart TypeScript JavaScript High
  23. 23. Detailed Comparison LifeMichael.com Not Available SupportforEnum Support for Abstract Classes NotAvailableAvailable Coffee Script Dart TypeScript JavaScript Available
  24. 24. Detailed Comparison LifeMichael.com Low IDESupport Popularity LowHigh Coffee Script Dart TypeScript JavaScript High
  25. 25. Detailed Comparison LifeMichael.com
  26. 26. Questions & Answers LifeMichael.com ● Courses I start to deliver in HIT this November (28 weekly meetings, 6800 shekels) include the following: Android 7 Java Applications Development Software Engineering in PHP Front End Development tinyurl.com/lifemichaelhitcourses ● If you enjoyed my lecture please leave me a comment at http://speakermix.com/life-michael. Thanks for your time!

×