typescriptのススメ ~javaエンジニアのためのjava(like)script

Post on 28-May-2015

1.269 Views

Category:

Technology

2 Downloads

Preview:

Click to see full reader

DESCRIPTION

AdvancedTechNight No.6 LightningTalk #2

TRANSCRIPT

TypeScriptのススメ~ JavaエンジニアのためのJava(like)Script

2013/03/15Acroquest Technology株式会社

谷本 心 ( @cero_t )

今夜のテーマ:JavaScript

var Counter = (function() { var count = 0;

function Counter() {}

Counter.prototype.get = function() { return count; };

Counter.prototype.increment = function() { count ++; };

return Counter;})();

var Counter = (function() { var count = 0;

function Counter() {}

Counter.prototype.get = function() { return count; };

Counter.prototype.increment = function() { count ++; };

return Counter;})();

クラスを定義したいのにfunctionって何事!?

prototypeって何!?

このへんの括弧がよく分からない!

なんで毎回クラス名を書かなきゃいけないの!?

JavaScriptってJavaのScriptじゃなかったの!?

”JavaとJavaScriptはインドとインドネシアぐらい違う”

”JavaとJavaScriptはインドとインドネシアぐらい違う”

インドネシア

インド

それでも僕はJava風にJavaScriptを書きたい。

GWT

Javaで書いたコードからHTML/JavaScriptを生成するツールキット

Google Waveで採用されて急成長!

Google Waveと共に...

CoffeeScript

大規模開発を視野に入れたJavaScriptに

コンパイルできる独自言語

var Counter = (function() { var count = 0;

function Counter() {}

Counter.prototype.get = function() { return count; };

Counter.prototype.increment = function() { count ++; };

return Counter;})();

class Counter count = 0

get: () -> count

increment: () -> count += 1 return

コレジャナイ

Rubyライク、PythonライクであってJavaライクではない

TypeScript

大規模開発を視野に入れたJavaScriptにコンp(略

var Counter = (function() { var count = 0;

function Counter() {}

Counter.prototype.get = function() { return count; };

Counter.prototype.increment = function() { count ++; };

return Counter;})();

class Counter { private count: number = 0;

public get() { return this.count; }

public increment() { this.count ++; }}

class Counter { private count: number = 0;

public get() { return this.count; }

public increment() { this.count ++; }}

キタコレ!

TypeScriptに興味が出てきましたよね?

じゃぁ、いつやるか?

たった3つの手順で始められるTypeScript

①Node.jsをインストールするhttp://nodejs.org/

②TypeScriptをインストールする

npm install -g typescript

③TypeScriptを書いてコンパイルする

tsc now.ts

以上!

開発環境はWebStorm6やIntelliJ IDEAが

対応済み

静的型付けクラス、継承インタフェース

アロー関数(ラムダ)デバッガ

ぜひ「今」からTypeScriptを始めましょう!

top related