Vilson Castilho
Photo taken from a TypeScript code.

Should I Use TypeScript?

Hello guys.

Today I'm going talk in a simple way about a tool that I recently introduced to my work, the TypeScript, and also what are the main advantages of using it.

But after all, what is TypeScript?

Although many scholars consider it to be a new programming language, TypeScript is actually not a completely new language, but a “superset” of an existing language, the JavaScript.

The TypeScript website defines it as a “superset” of JavaScript, adding functionality that is not natively available or that requires a great deal of effort from the developer to be elaborated. In other words, this tool adds static typing to JavaScript, which defaults to a dynamically typed language. In this way, with the use of the tool, variables and functions can assume specific types during runtime.

It's important to emphasize that the TypeScript code is only used in the development environment and is 100% converted to JavaScript in the production process.

And finally, what are the advantages of TypeScript?

Among others, the main advantage of using this tool is the possibility of discovering errors during the development process, as well as fostering the “IntelliSense” of the IDE.

In addition to helping TypeScript in the development process, it also makes it possible to use languages that are not natively available.

Moreover, another function that I can cite as important is the possibility of “transpiling” the code so that it can be read in the same way in all versions of browsers.

Finally, I'd like to leave some tips for other developers who are adding this tool to their work:

  • Use an IDE. VSCode (Visual Studio Code) for example, will help a lot in development, since it has an “IntelliSense” fully compatible with TypeScript;
  • Use the “ESLint” configuration in your projects, which consists of a “linting” tool that standardizes and validates JavaScript codes;
  • Use “Sucrese” in your work. It assumes that the project is being developed in a newer version of browser or Node.js. And it focuses on compiling non-standard languages like JSX, TypeScript and Flow, which greatly speeds up the development process.
  • Thank you and let's code!!! 👨‍💻