Prezi

Present Remotely

Send the link below via email or IM

Copy

Present to your audience

Start remote presentation

  • Invited audience members will follow you as you navigate and present
  • People invited to a presentation do not need a Prezi account
  • This link expires 10 minutes after you close the presentation
  • A maximum of 30 users can follow your presentation
  • Learn more about this feature in the manual

Do you really want to delete this prezi?

Neither you, nor the coeditors you shared it with will be able to recover it again.

DeleteCancel

Make your likes visible on Facebook?

Connect your Facebook account to Prezi and let your likes appear on your timeline.
You can change this under Settings & Account at any time.

No, thanks

CoffeeScript vs. TypeScript

The pros and cons of using CoffeeScript or TypeScript in a .NET shop.
by Paul Oliver on 18 August 2013

Comments (0)

Please log in to add your comment.

Report abuse

Transcript of CoffeeScript vs. TypeScript

CoffeeScript
Created in 2009 by Jeremy Ashkenas
Open Source and hosted on Github
11th most popular language on Github
How did CoffeeScript Get its name?
'The original idea was for CoffeeScript to be "unfancy JavaScript"--JavaScript boiled down to its regular essence without the language quirks you usually have to watch out for. Java is a fancy word for coffee, so unfancy JavaScript is CoffeeScript.'
--Jeremy Ashkenas, CoffeeScript creator
Transcompiles to JavaScript (ES3)
CoffeeScript Features that are
NOT
in TypeScript
Fixes comparison operators (
===
,
!==
)
Correctly hoists variable declarations
Loop comprehensions (
for food in foods where...
)
Fat arrows (
=>
) to pass in context to a function
Better default parameter handling (
null
AND
undefined
)
Great support for arrays (
elements = arr[3..6]
)
Does not require all the "ceremony" of static typing.
Wraps the compiled JavaScript in a safety wrapper to protect against global variable contamination
String interpolation:
"Hello
#{ name }
"
Many more...
TypeScript
Created in October 2012 (still in Preview) by Microsoft. Anders Hejlsberg designed much of TypeScript.
Open Source and hosted on CodePlex
Not in the Top 90 languages on Github (yet)
Transcompiles to JavaScript (ES3
and
ES6)
TypeScript features that are
NOT
in CoffeeScript
Intellisense
!
Static type checking
JavaScript-like syntax
Interfaces
You can use
==
if you want: (WHY?)
Supports some of the EcmaScript 6 standards (still
b
eing solidified) like
module
and
let
.
Can't We All Just
Get Along?
TypeScript and CoffeeScript have different strengths
CoffeeScript vs. TypeScript
Pros and Cons
My Setup
+
=
Visual Studio 2012
Web Essentials 2012 Extension
TypeScript Support in Visual Studio
I also needed to install TypeScript from http://typescript.codeplex.com
There are some issues getting it installed, See http://bit.ly/QGb6q5
Are you a fast typer?
Douglas Crockford
Creator of JSLint
Brendan Eich
Creator of JavaScript
Scott Hanselman
Microsoft Evangelist
"Microsoft's TypeScript may be the best of the many JavaScript front ends.

It seems to generate the most attractive code
...Anders has shown that these can be provided nicely by a preprocessor, so there is no need to change the underlying language.

"I think that JavaScript's loose typing is one of its best features and that type checking is way overrated.
TypeScript adds sweetness, but at a price. It is not a price I am willing to pay."

http://bit.ly/SnJzw5
“I think CoffeeScript is clearly good stuff. CoffeeScript is elegant it sort of takes the good parts, removes all of the stupid awful syntax that were inherited from the wrong languages, replaces it with something that is small and elegant and expressive...And CoffeeScript is having a big influence on the ECMA Script committee...

"
Coffeescript is what JavaScript should have been at a time when the market is receptive to its [innovative] syntax.
"

http://b.qr.ae/KB8QhZ
"
CoffeeScript 'uplevels' JavaScript to make it more expressive and more idiomatic
. You know when you're explaining something and you can't think of a word? Or perhaps you don't know the right word? CoffeeScript adds those new words to JavaScript and you find yourself going, YES! That's what I meant to say!

"Remember how jQuery made you feel empowered? Released from tedious DOM code?
Well, CoffeeScript does that for tedious JavaScript code
."

http://bit.ly/nAuZMu
What I like about TypeScript - so far - is that
TypeScript’s static typing could enable better tooling with warning squiggles, easy statement completion, plus smart refactoring
. You also get easy navigation around code, as well as find references, rename, and more. You don’t currently get that in CoffeeScript.

...In fact, it's a little like getting some of tomorrow's ECMAScript 6 early in a way that's compatible with today's JavaScript. ES6 won't be out for at least a year but we can play with some of those features today."

http://bit.ly/SkZN9k
"
TypeScript is quite a good piece of work for Visual Studio users, and smartly aligned with ES6.
"

CoffeeScript is pure JS runtime semantics, just syntactic sugar. And much of that sugar is going into ES6 (some was based on ES4, as a matter of fact): destructuring, comprehensions, => functions, classes.

http://bit.ly/YxzmvR
“It helps to have things like CoffeeScript out there it isn’t overriding, it doesn’t tell us what we must do but its suggestive, and if we want to pave that cow path we can, and I’m in favor.

"
I advocated strongly for standardising prototypal inheritance a la CoffeeScript’s class, super, and @ syntactic sugar
."

http://bit.ly/MYJGfv
CoffeeScript required
35% less
lines of code than TypeScript
I think there's a place for both.
ASP.NET and
Web Tools 2012.2
+
Time to Demo!
See the full transcript