Always bet on
Java TypeScript
Heitor Ramon
HTML "Developer"
*.IE6{_content:"Hacker";}
Table time survivor
Ex Advertising Worker
UX
Frontend Developer
On the Hype Train
Agenda
An era without any rules or types
Developing JavaScript without the use of an IDE or a code editor with a full object inspector was a tedious and lengthy process that took hours.
JavaScript, as we know, was at its birth with backbone, angular, and knockout starting, and people started to look at jQuery as a simple framework.
But the main problem still remains, developers were losing hours in debugging because of simple mistakes with missing properties and wrong variable types.
Why
Types are
Fundamental
But why TypeScript
The battle between the two main typed systems is intense, but in the end, TypeScript helps the crown of the champion.
// @flow
function square(n: number): number {
return n * n;
}
square(2);
Flow a basic comment on the first line of a .js file can be straightforward in the beginning.
type GetReturnValue<T> =
T extends (...args: any[]) =>
infer R ? R : T;
type getIDReturn =
GetReturnValue<typeof getID>
TypeScript is a new superset, with a new file type and a unique code structure and interfaces.
Are people really changing?
Are people really changing?
Angular 2+ was the Kickstarter of TypeScript in the frontend community.
Some of the big frontend frameworks now are written entirely in TypeScript or being converted to TypeScript.
Vue, for example, was written in Flow, and now for the V3 release will be 100% TypeScript.
Ember is now slowly transformed into TypeScript.
Pros and Cons of using it
Do I need to say anything more?
Pros
- Maintainability
- Refactor
- Easy reading and understanding
- @types and .d.ts
Cons
- It's not truly typed
- Adds a new layer of complexibility on JavaScript
How I can start?
How I can start?
To understand more about the Language itself, you can go to the official documentation and an unofficial book that could help you.
- https://www.typescriptlang.org/docs/home.html
- https://basarat.gitbooks.io/typescript/content/docs/getting-started.html
Some great projects helps you to start a new TypeScript component or library
TypeScritp to *
TypeScritp to *
The most significant advantage of TypeScript is that it can be used for many applications, but some really blows my mind.
AssemblyScript (TypeScript to WebAssembly)
https://github.com/AssemblyScript/assemblyscript
TypeScriptToLua (TypeScript traspiler to LUA)
https://github.com/TypeScriptToLua/TypeScriptToLua
Deno
https://github.com/denoland/deno
My Old World
- Hours of programming bugs;
- Countless hours trying to find it was a typed error bug;
- Develop, Browser, Refresh, Develop...
- JSDocs unmaintainable
- Freedom to do whatever I want
My New World
- Hours of programming;
- No more typed bugs;
- 80% of the time developing, the rest 20% Refresh, Develop...
- Automatically generated documentation
- A more bureaucratic developing process
A whole new world.....
Thank You
Always bet on J̶a̶v̶a̶TypeScript
By Heitor Ramon Ribeiro
Always bet on J̶a̶v̶a̶TypeScript
JavaScript has been around for more than 20 years, I think it's time for a little change on the process of developing a real one code multiple platforms. Video - https://www.youtube.com/watch?v=4d0c4odkApE
- 338