Every Java Developer Should Learn TypeScript
steele.blue·422w
Preview
Report Post

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...