Typescript Programming Languages http://cs.newpaltz.edu/~nimmagap1/learn/simple/ Presented by: Panduranga Bhargav Prasad Nimmagadda
index History Paradigm/ Classification Data Types/Objects Program structure Compilers Encapsulation/Inheritance Sequence Control Applications
introduction Typescript is a free and open-source programming language developed and maintained by Microsoft. It is a strict superset of JavaScript. The Typescript compiler is itself written in Typescript, trans compiled to JavaScript and licensed under the Apache 2 License.
history Typescript is a relatively new language launched in October 2012, as the version 0.8 of the language. Typescript 0.9, released in October 2013, added support for generics. Type Script 1.0 was released in 2014, adding Visual Studio 2013 providing built-in support for Typescript. Recently on Feb 22, 2017, Version 2.2 is released, adding many features and many advancements.
WhY TYPESCRIPt ? Typescript is a superset of JavaScript which primarily provides optional static typing, classes and interfaces. We can enable IDEs for Typescript to provide a richer environment for spotting common errors as you type the code. An integrated development environment (IDE) is a software application that provides comprehensive facilities to computer programmers for software development. An IDE normally consists of a source code editor, build automation tools and a debugger.
WhY TYPESCRIPt ? Visual Studio Code & WebStorm are the best present IDEs for Typescript which runs on most of platforms Windows, Mac and Linux. Provide an optional type system for JavaScript. Typescript provides compile time type safety for your JavaScript code.
Paradigm Programming paradigms are a way to classify programming languages based on their features. Languages can be classified into many paradigms. Typescript is a multi-paradigm programming language. This helps the programmers most suitable language.
Classification Typescript is the super set of JavaScript. Typescript includes scripting, OOP, structured, imperative, functional and generic.
Data types/ objects Data type Keyword Description Number number It can be used to represent both, integers and fractions. String string Represents a sequence of Unicode characters Boolean Represents logical values, true and false Void void Used on function return types to represent non-returning functions Null null Represents an intentional absence of an object value. Undefined undefined Denotes value given to all uninitialized variables
Data types/ objects Number: let decimal: number = 6; let octal: number = 0o744; String: let color: string = "blue"; color = 'red';
Data types/ objects Boolean: let isDone: boolean = false; Void: function warnUser(): void { alert("This is my warning message"); Null and Undefined: The null and the undefined data types are often a source of confusion. The null and undefined cannot be used to reference the data type of a variable. They can only be assigned as values to a variable.
Data types/ objects Null and Undefined: The null and the undefined data types are often a source of confusion. The null and undefined cannot be used to reference the data type of a variable. They can only be assigned as values to a variable.
Program structure class Greeter { constructor(public greeting: string) { } greet() { return "<h1>" + this.greeting + "</h1>"; } }; var greeter = new Greeter("Hello, world!"); document.body.innerHTML = greeter.greet();
compiler Typescript compiler (tsc) is also written in Typescript that can be compiled into regular JavaScript. We can work and execute Typescript code online from the official website https://www.typescriptlang.org/play/index.html We can also work and compile the Typescript code in a local system by downloading from the website http://www.microsoft.com/en-us/download/details.aspx?id=48593
ENCAPSULATION Encapsulation is the ability of an object to be a container (or capsule) for its member properties, including variables and methods. As a fundamental principle of object oriented programming. Typescript support encapsulation of classes, interfaces, functions and variables into containers
Inheritance In Typescript, we can use common object-oriented patterns. Of course, one of the most fundamental patterns in class-based programming is being able to extend existing classes to create new ones using inheritance.
Sequence control Typescript provides different types of loops to handle looping requirements.
Sequence control Given here is the general form of a loop statement in most of the programming languages They include if, if-else, while, do..while loops.
APPLICATIONS As Typescript the typed superset of JavaScript designed for building large- scale applications. Typescript helps in developing Large-Scale Applications Today such as: i. Technology Decoupling ii. Type Safety