Javascript
&
CoffeeScript
TimNew
Brief History of Javascript
-
Netscape (Mozilla)
- DOM (DHTML)
- LiveScript (Navigator 2.0)
- Brendan Eich in 10 days
- Renamed to JavaScript (Marketing)
The Facts of Javascript
- Brendan Eich: A Lisp Guru
- Intension: Functional Language
- Requirement: Java-like Object Oriented Language
- Result: JavaScript
- Except the name, NOTHING related to Java
- Syntax inspired by C
- Philosophy borrowed from Scheme
- Object System learnt from SELF
- Prototype vs Class-Instance
- Regular Expression from Perl
- Prototype in 10 days -> Design Flaws
Facts
JavaScript is Functional, not Object Oriented
JavaScript is the binary of the web
- Gerard Braad
COFFEE SCRIPT
- Just JavaScript
- With Syntactic Sugar
-
Best Workaround to Javascript Flaws
- Class System
- == & ===
- for each
- this
- ...
CoffeeScript vs TypeScript
- CoffeeScript is prior than TypeScript
- Widely used vs rarely used
- Widely supported vs a few options
- Twisting PROTOTYPE back to Class-Instance
- Class -> Syntactic Sugar
- Type ? -> Static Check!
- Module?? -> Import
- Interface??? -> For what?
- Generic???? -> WTF!!!!
- Type ins't everything, definition for $()
- Feature lost after compiled
Why NOT Type Script
- Microsoft C# over Javascript Runtime
-
Visual Studio 2012
-
Windows
- Open sourced in Microsoft Way
-
Mess toolchain
-
tsc, typestring?
- gulp-tsc, gulp-typescript-compiler, gulp-typescript
Why NOT Type Script
-
Not Transparent
- Module (Not file equivalent)
- Hidden Polyfill
- this pointer
- bad interoperability
-
Write JavaScript as C#
- Syntax never matters, Design does!
- C# design in Javascript syntax
-
Sorry Anders, not this time, it goes too far
THANKS
TimNew
http://timnew.github.io
Javascript&coffeescript
By timnew
Javascript&coffeescript
- 70