Nov 1, 2017

I gave a talk to the Omaha Java Users Group about TypeScript:

I think there’s a lot of things TypeScript has to offer Java developers, namely:

Static Typing - This one’s obvious; if you’re used to a compiler providing thousands of tiny continuously-running unit tests, you’re going to miss that on the front-end.

But what’s even cooler is TypeScript’s features of incremental and inferred typing. You can achieve full type safety in this code:

class MathFns {
static for(val) {
return {
square() {
return val * val;
},
};
}
}

const fns = MathFns.for(5);
console.log(fns.square());

By adding a single type token:

class MathFns {
static for(val: number) {
return {
square() {
return val * val;
},
};
}
}

const fns = MathFns...

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help