filmov
tv
Typescript Tutorial for Beginners in Hindi #1: What is Typescript | Introduction to Typescript Hindi

Показать описание
Welcome all, we will see What is Typescript in Hindi. Introduction to Typescript in Hindi. Typescript tutorial for beginners in Hindi. What is TypeScript? TypeScript is a typed superset of JavaScript that compiles to plain JavaScript.
First of all, TypeScript is typed. That doesn’t mean that you write TypeScript using a keyboard, it means that unlike JavaScript, TypeScript considers the types of variables, parameters, and functions. Many of us learned to code in a typed language, such as Java or C#. In statically typed languages such as these, the compiler checks our code at compile-time for type errors.
Secondly, TypeScript is a superset of JavaScript. In other words, the TypeScript language specification includes everything that is in JavaScript, with some additional syntax added. You could decide to use TypeScript and then just write everything in ‘plain’ JavaScript in your TypeScript file if you really wanted to. The TypeScript compiler would understand everything you had written, and just write the same script into a JavaScript file.
typescript tutorial in hindi
Working with TypeScript
In order to use TypeScript, we need the TypeScript compiler, and we need to write our script in files with a “.ts” extension. If you are coding using Visual Studio 2013 or 2015, then you are ready to go, as these environments include the TypeScript compiler. For other environments, you may need to download and install the TypeScript compiler. Details are on the website.
typescript tutorial in Hindi
The Benefits of Using TypeScript
The advantages of using TypeScript can be broadly divided into two categories.
Firstly, it offers type checking. This allows us to identify errors earlier, and potentially save hours of debugging our JavaScript code. As discussed in Crockford’s JavaScript: The Good Parts, JavaScript’s best features are also it's most dangerous. Dynamic typing offers flexibility, but it can also be conducive to bugs. With TypeScript, you could say we get the best of both worlds. If you want to take advantage of JavaScript’s dynamic typing, then just write plain JavaScript in your TypeScript file, but under most circumstances, we don’t need dynamic typing, and so we can make use of TypeScript’s type annotations.
Secondly, TypeScript allows and encourages us to write object-oriented code. The fundamental principles of object-oriented programming are often referred to as abstraction, encapsulation, inheritance, and polymorphism. TypeScript makes it easier for us to follow principles such as these. Class definition syntax helps us to abstract. Public and private access modifiers help with encapsulation, and TypeScript has inheritance syntax built-in. In short, if you believe in object-oriented programming, and you need to write JavaScript, then TypeScript may be for you. Even if you don’t understand the benefits of object-oriented programming, if that approach is all you know, then TypeScript will help you to write better JavaScript.
Aside from these technical advantages, the fact that TypeScript is a superset of JavaScript means that you can make the transition to using TypeScript gradually. Start writing plain JavaScript in TypeScript files, and gradually introduce more of TypeScript’s features as and when you learn and decide to use them.
The Disadvantages of Using TypeScript
I see very few if any disadvantages of using TypeScript. Some have complained that the compiler is slow, which may be the case for very large code bases
Another possible disadvantage is the problem of integrating with third-party libraries. How do you assign a variable to a “type” which is defined in a library? There are workarounds for this. One is to create a declaration file for the library.
Guys, Please support my channel by SUBSCRIBE to my channel and share my videos in your Social Network TimeLines.
Don't Forget to Follow me on all Social Network,
First of all, TypeScript is typed. That doesn’t mean that you write TypeScript using a keyboard, it means that unlike JavaScript, TypeScript considers the types of variables, parameters, and functions. Many of us learned to code in a typed language, such as Java or C#. In statically typed languages such as these, the compiler checks our code at compile-time for type errors.
Secondly, TypeScript is a superset of JavaScript. In other words, the TypeScript language specification includes everything that is in JavaScript, with some additional syntax added. You could decide to use TypeScript and then just write everything in ‘plain’ JavaScript in your TypeScript file if you really wanted to. The TypeScript compiler would understand everything you had written, and just write the same script into a JavaScript file.
typescript tutorial in hindi
Working with TypeScript
In order to use TypeScript, we need the TypeScript compiler, and we need to write our script in files with a “.ts” extension. If you are coding using Visual Studio 2013 or 2015, then you are ready to go, as these environments include the TypeScript compiler. For other environments, you may need to download and install the TypeScript compiler. Details are on the website.
typescript tutorial in Hindi
The Benefits of Using TypeScript
The advantages of using TypeScript can be broadly divided into two categories.
Firstly, it offers type checking. This allows us to identify errors earlier, and potentially save hours of debugging our JavaScript code. As discussed in Crockford’s JavaScript: The Good Parts, JavaScript’s best features are also it's most dangerous. Dynamic typing offers flexibility, but it can also be conducive to bugs. With TypeScript, you could say we get the best of both worlds. If you want to take advantage of JavaScript’s dynamic typing, then just write plain JavaScript in your TypeScript file, but under most circumstances, we don’t need dynamic typing, and so we can make use of TypeScript’s type annotations.
Secondly, TypeScript allows and encourages us to write object-oriented code. The fundamental principles of object-oriented programming are often referred to as abstraction, encapsulation, inheritance, and polymorphism. TypeScript makes it easier for us to follow principles such as these. Class definition syntax helps us to abstract. Public and private access modifiers help with encapsulation, and TypeScript has inheritance syntax built-in. In short, if you believe in object-oriented programming, and you need to write JavaScript, then TypeScript may be for you. Even if you don’t understand the benefits of object-oriented programming, if that approach is all you know, then TypeScript will help you to write better JavaScript.
Aside from these technical advantages, the fact that TypeScript is a superset of JavaScript means that you can make the transition to using TypeScript gradually. Start writing plain JavaScript in TypeScript files, and gradually introduce more of TypeScript’s features as and when you learn and decide to use them.
The Disadvantages of Using TypeScript
I see very few if any disadvantages of using TypeScript. Some have complained that the compiler is slow, which may be the case for very large code bases
Another possible disadvantage is the problem of integrating with third-party libraries. How do you assign a variable to a “type” which is defined in a library? There are workarounds for this. One is to create a declaration file for the library.
Guys, Please support my channel by SUBSCRIBE to my channel and share my videos in your Social Network TimeLines.
Don't Forget to Follow me on all Social Network,
Комментарии