Come to the TypeScript

Similar documents
TypeScript coding JavaScript without the pain

Redis Ma as, greitas, galingas. Specialiai VilniusPHP

Introduction to TypeScript

Nick Senger & Jesse van den Kieboom

IN4MATX 133: User Interface Software

JAVA pagrindai Lek. Liudas Drejeris

Angular 2 and TypeScript Web Application Development

El. pašto konfigūravimas

One language to rule them all: TypeScript. Gil Fink CEO and Senior Consultant, sparxys

Trumpai-ilga istorija

C programavimo kalba. 3 paskaita (Sąlygos ir ciklo operatoriai, funkcija scanf() )

TypeScript. TypeScript. RxJS

CV Nr. 4698a2f0. Occupation area: IT areas. Category: Education. Job experience

Naujos galimybės su Lotus Notes 8.5.1: naudotojams ir programuotojams

Elektroninis.lt šakninių sertifikatų diegimas

MySQL InnoDB Cluster. New Feature in MySQL >= Sergej Kurakin

ios Uždara operacinė sistema skirta tik Apple įrenginiams: iphone ipad ipod touch Apple TV

Arjen de Blok. Senior Technical Consultant bij ICT Groep ( sinds 1995 Programmeren sinds 1990 Technologiën. Links

How does PyCharm match up against competing tools?

An Introduction to TypeScript. Personal Info

C++ Developer Survey "Lite": C++ and Cloud

RequireJS Javascript Modules for the Browser. By Ben Keith Quoin, Inc.

Building Your own Widget with ArcGIS API for JavaScript

Java language. Part 1. Java fundamentals. Yevhen Berkunskyi, NUoS

Web Development for Dinosaurs An Introduction to Modern Web Development

Web technologijos. Hostingas JavaScript PHP

INF5750. Introduction to JavaScript and Node.js

Lesson: Web Programming(4) Omid Jafarinezhad Sharif University of Technology

Enterprise Web Development

A Lithuanian Verbalization Template for ORM conceptual models and rules

JavaScript: Introduction, Types

Introduction. Introduction to OOP with Java. Lecture 01: Introduction to OOP with Java - AKF Sep AbuKhleiF -

Introduction to OOP with Java. Instructor: AbuKhleif, Mohammad Noor Sep 2017

WebStorm, intelligent IDE for JavaScript development

Redis. In-memory data structure store. Sergej Kurakin

Angular 2 and TypeScript Web Application Development

Building OSM based web app from scratch

Parengė ITMM Artūras Šakalys 1

Advanced React JS + Redux Development

Q1 Where do you use C++? (select all that apply)

Web UI. Survey of Front End Technologies. Web Challenges and Constraints. Desktop and mobile devices. Highly variable runtime environment

Introduction to Python. Didzis Gosko

Angular 2 and Hexo. Static Meets Dynamic For the Best of Both Worlds! Copyright 2016 Code Career Academy

Decoupled Drupal with Angular

Informacijos apsaugos standartai serija

Full Stack boot camp

JavaScript: the language of browser interactions. Claudia Hauff TI1506: Web and Database Technology

A Comparison of Mining Incomplete and Inconsistent Data

JavaScript CS 4640 Programming Languages for Web Applications

LEARN WITH INTRODUCTION TO TYPESCRIPT

Polimorfizmas. Lekt. dr. Pijus Kasparaitis m. m. pavasario semestras.

React(.js) the Domino Way High-Performance Client for Domino. Knut Herrmann

Modern frontend workflows in Liferay Portal and Liferay DXP. Iván Zaera Avellon, Liferay Chema Balsas, Liferay Pier Paolo Ramon, SMC

TypeScript. Language Specification. Version 1.8

THE NEW ERA OF WEB DEVELOPMENT. qooxdoo. Andreas Ecker, Derrell Lipman

GAVIN KING RED HAT CEYLON SWARM

JavaScript. History. Adding JavaScript to a page. CS144: Web Applications


JAVA MOCK TEST JAVA MOCK TEST II

Javascript Validator Xml Schema Eclipse Plugin

TypeScript. Jonathan Kula 12/3/2018

Kas yra masyvas? Skaičių masyvo A reikšmės: Elementų indeksai (numeriai): Užrašymas Turbo Paskaliu: A[1] A[2] A[3] A[4] A[5]

The Hack programming language:

JavaScript Lecture 1

welcome to BOILERCAMP HOW TO WEB DEV

Networking & The Web. HCID 520 User Interface Software & Technology

IntelliJ IDEA, the most intelligent Java IDE

Tautvydas Dagys Microsoft Lietuva

JavaScript. History. Adding JavaScript to a page. CS144: Web Applications

Tamarin and ECMAScript 4. John Resig (ejohn.org) Mozilla Corporation

Topic 9: Type Checking

Topic 9: Type Checking

Deep Dive on How ArcGIS API for JavaScript Widgets Were Built

Cross-Platform Data Models and API Using grpc

Boldface numbers indicate illustrations, code listings, and tables.

Unveiling Zend Studio 8.0

Java classes cannot extend multiple superclasses (unlike Python) but classes can implement multiple interfaces.

THE COMPARISON OF STANDARD PASCAL AND TURBO PASCAL 7.0

TYPESCRIPT. Presented by Clarke Bowers

RubyMine, the most advanced Ruby and Rails IDE

Introduction. Primitive Data Types: Integer. Primitive Data Types. ICOM 4036 Programming Languages

A polyglot day: learning from language paradigms. Benson Joeris Kathleen Dollard

ICOM 4015-Advanced Programming. Spring Instructor: Dr. Amir H. Chinaei. TAs: Hector Franqui, Jose Garcia, and Antonio Tapia. Reference: Big Java

Code review guide. Notice: Read about the language that you will test its code, if you don t have an idea about the language this will be difficult.

Objectives. Problem Solving. Introduction. An overview of object-oriented concepts. Programming and programming languages An introduction to Java

CSEN 102 Introduction to Computer Science

Paveikslėliai. Lekt. dr. Pijus Kasparaitis m. m. pavasario semestras.

2017 m. pagrindinės sesijos informacinių technologijų valstybinio brandos egzamino programavimo užduoties galimi sprendimai

C++ programavimo kalba. Konstruktorius, destruktorius, klasių metodų modifikatoriai, objektų masyvai (4 paskaita)

C#: framework overview and in-the-small features

Auto-Generating Documentation & Source Code

CSE 431S Type Checking. Washington University Spring 2013

MY GOOD FRIEND RUST. Matthias Endler trivago

Binghamton University. CS-140 Fall Problem Solving. Creating a class from scratch

Paskirstytos atminties lygiagretusis programavimas Įvadas į MPI

Advance Mobile& Web Application development using Angular and Native Script

PHP PROGRAMOS EIGOS VYKDYMO VALDYMAS

Apletai (įskiepiai) Lekt. dr. Pijus Kasparaitis m. m. pavasario semestras.

Part 1: jquery & History of DOM Scripting

Hands on Angular Framework

Transcription:

Come to the TypeScript we have type hinting! Sergej Kurakin

Sergej Kurakin Amžius: 36 Dirbu: NFQ Technologies Pareigos: Programuotojas Programuoti pradėjau mokytis 1996 metais. Programuotoju dirbu nuo 2001 metų. Pagrindinė programavimo kalba: PHP JavaScript, Python, Java, Ruby, Bash

Koks užsispyręs tu bebūtum

backend edis

PHP programuotojas

buvo, yra arba bus ta diena

kai teks susidurti su JavaScript

Mano pirmas kartas Buvo senai, dar prieš jquery erą Tai buvo vanilla JavaScript jquery ir Mootools Namų sąlygomis kurtos bibliotekos Pagalba kuriant karkasus

Mano antras kartas NodeJS + WebSockets ECMAScript 2015 ir ECMAScript 2016 Darbas didesnėje komandoje Bendras kodo stilius Kokybės reikalavimai

Kai daugiau programuoji PHP nei JavaScript Trūksta Type Hinting Trūksta Interface Iki ECMAScript 2015 truko Class Su ECMAScript 2015 ir Promise dar labiau pradėjo trukti Type Hinting JSDoc atrodo ne toks patogus ar paprastas kaip PHPDoc IDE ir Code Completion ne tai kad nepadeda...

O jei kartais pas jus apsilanko JAR JAR BINKS Image from http://starwars.wikia.com/wiki/jar_jar_binks

/** * Assign the project to an employee. * @param {Object} employee - The... * @param {string} employee.name - The... * @param {string} employee.department - The... */ Project.prototype.assign = function(employee) { // };

/** * Assign the project to an employee. * @param {Object} employee - The... * @param {string} employee.name - The... * @param {string} employee.department - The... */ Project.prototype.assign = function(employee, role) { // };

/** * Assign the project to an employee. * @param {Object} employee - The... * @param {string} employee.name - The... * @param {string} employee.department - The... * @param {Object} acl */ Project.prototype.assign = function(employee, role) { // };

/** * Assign the project to an employee. * @param {Object} employee - The... * @param {string} employee.name - The... * @param {string} employee.email - The... */ Box.prototype.assign = function(employee) { // };

Tas pats gali būti ir esant... Image from http://thescruffynerfherder.com/wp-content/uploads/2014/06/han-and-chewie.jpg

Hotfix situacijoms!

Galų gale

kaip tu besistengtum

ar betestuotum

kur nors prašoks koks nors objektas arba duomenų tipas kurio nesitiki.

Image from https://www.buzzfeed.com/isaacfitzgerald/darth-jar-jar

O esant didesniam projektui

Image from http://starwars.wikia.com/wiki/death_star

atsiranda...

Image from http://starwars.wikia.com/wiki/thermal_exhaust_port

Ir tada kolega pasiūlė išbandyti TypeScript

Į TypeScript aš gan ilgai žiūrėjau skeptiškai.

O pasirodo veltui.

TypeScript Strict superset of JavaScript Optional static typing Class-based object-oriented Transcompiles to JavaScript npm install -g typescript

Istoriniai faktai Vienas iš kūrėjų: Anders Hejlsberg (C#, Delphi, Turbo Pascal) Pradėtas kurti 2012 2014 išleistas TypeScript 1.0 2016 išleistas TypeScript 2.0 Sukurtas ir palaikomas Microsoft

Tipai Boolean Number String Array Tuple Enum Any Void Null, Undefined Never

let isdone: boolean = false; let decimal: number = 6; let color: string = "blue";

Interface Duck typing / structural subtyping Optional properties Readonly properties Function types Indexable types Class types Interfaces extending Classes

function printlabel( labelledobj: { label: string } ) { console.log(labelledobj.label); } let myobj = { size: 10, label: "Size 10 Object" }; printlabel(myobj);

interface LabelledValue { label: string; } function printlabel( labelledobj: LabelledValue ) { console.log(labelledobj.label); }

Class Class Inheritance Public, private, protected Accessors (get, set) Abstract Classes

Functions Function Types Optional and Default Parameters

interface SearchFunc { (source: string, substring: string): boolean; } let mysearch: SearchFunc; mysearch = function(source: string, substring: string) { let result = source.search(substring); return result > -1; }

Generics function identity<t>(arg: T): T { return arg; }

O dar yra: Iterators Generators Symbols ir dar daugiau...

Modules Node.js (CommonJS) require.js (AMD) isomorphic (UMD) SystemJS ECMAScript 2015 native modules (ES6)

Kaip naudoti esamas/senas bibliotekas? Declaration (definition) files:.d.ts.d.ts failai jau sukurti populiarioms bibliotekoms Paprastai instaliuojami su: npm install --save-dev @types/<name> https://github.com/definitelytyped/definitelytyped

Kas dėl IDE? Visual Studio PhpStorm, WebStorm and IntelliJ IDEA NetBeans IDE plugin Eclipse IDE plugin Sublime Text plugin Emacs Vim

O kas dėl stiliaus? TSLint - https://palantir.github.io/tslint/ Turi daug taisyklių, kurios konfiguruojamos per JSON failą. Galima integruoti į skirtingus įrankius: checkstyle, pmd, JSON, verbose ir kt.

Atrodo kaip puikus įrankis kurti! Image from https://www.wired.com/2015/12/nasa-death-star-asteroid/

Much to learn, you still have. Image from http://starwars.wikia.com/wiki/yoda

Mokymo medžiaga https://www.typescriptlang.org/ Pluralsight: TypeScript In-depth by Brice Wilson Advanced TypeScript by Brice Wilson

Sėkmės istorijos TypeScript at Slack Migrating a 10,000-line legacy JavaScript codebase to TypeScript How we migrated a 200K+ LOC project to TypeScript and survived to tell the story Why Asana is switching to TypeScript

O kas iš to? 1. 2. 3. 4. 5. Image from http://www.mirror.co.uk/tv/tv-news/force-you-take-biggest-star-6985607 Turime Interface ir Type hinting. Kintamųjų ir parametrų tipai yra dalis kodo. Dalis klaidų aptinkama kompiliacijos metu. Šiuolaikiniai IDE geriau palaiko TypeScript projektus palyginus su JavaScript. Kodas yra geriau skaitomas.

May the 4th be with you! Sergej Kurakin Work @mail: sergej.kurakin@nfq.lt Personal @mail: sergej@kurakin.info https://www.linkedin.com/in/sergejkurakin