Why should we learn TypeScript

Business software

The Internet basically runs on the basis of JavaScript, HTML and CSS. Unfortunately, JavaScript is not suitable for developing large applications. This is where TypeScript comes into play: the coding language is compatible with JavaScript and also enables the development of very extensive applications.

We have summarized the essential facts about JavaScript and TypeScript and tell you where the differences are.

What is JavaScript?

JavaScript was born as a programming language for the time-honored Netscape Navigator. Brendan Eich created the prototype for the programming language in 1995 - in a period of ten days. As Eich revealed in an interview with US colleagues from Infoworld in 2008, JavaScript was initially called "Mocha", then "LiveScript" and was finally named JavaScript in December 1995 following a licensing agreement between Netscape and Sun Microsystems. The nomenclature similarities between Java and JavaScript have often led to misunderstandings and mix-ups in the past, although there are blatant differences between Java and JavaScript. JavaScript has developed considerably over the years and is now supported by all modern web browsers.

The introduction of JavaScript for the Netscape Navigator was followed relatively quickly by a variant for Netscape Enterprise Server and Microsoft IIS. Around 13 years later, Ryan Dahl finally presented Node.js, an open-source, cross-platform runtime environment for JavaScript that works independently of the browser or server variant.

Coding with JavaScript

JavaScript is a programming language with many paradigms: It uses curly brackets and semicolons - similar to the C language family. It has a weak, dynamic typing and is either interpreted or compiled just-in-time. In general, JavaScript is single-thread capable - but there is a Web Workers API that enables multithreading. There are also 'events', 'asynchronous function calls' and 'callbacks'.

JavaScript supports object-oriented software development with prototypes - in contrast to the 'class syntax' used in C ++, Java and C #. However, this has also been on board since 2015 with the release of JavaScript ES6. JavaScript also supports functional programming - including 'closures', 'recursion' and 'lambdas' (anonymous functions).

Before JavaScript ES6 there was no tail call optimization - now this is possible when activating the 'strict modes' ('use strict'). The implementation differs depending on the browser. The 'strict mode' changes the semantics of JavaScript and ensures that some 'silent errors' become 'throw errors'.

The JavaScript ecosystem

There are numerous JavaScript APIs - some are provided by browsers, others are third-party interfaces. There are different APIs for clients, servers, desktops and those that support several different environments. JavaScript's browser interfaces include:

Third-party APIs abound, from interfaces to complete applications like Google Maps. Others are utilities, for example to make software development easier with JavaScript, HTML5 and CSS (jQuery). Application frameworks are also available for special purposes: Express enables, for example, the development of web and mobile application servers in Node.js.

There are a number of other JavaScript modules - over 300,000 different ones in total. In order to be able to master the sheer number, the use of a 'package manager' like npm (standard for Node.js) is recommended. An alternative to this is, for example, the yarn developed by Facebook. Other tools in a similar style include Bower, Ender or jspm.

Webpack, on the other hand, bundles JavaScript modules into static browser assets, and Browserify allows software developers to write Node.js-style modules that are compiled for use in the browser. Grunt, on the other hand, is a file-oriented JavaScript 'task runner' - just like gulp (which is also a 'streaming build system').

To ensure that the JavaScript code runs reliably without compilation, 'linters' are used. This term is based on the Lint Tool of the C programming languages ​​- once a standard tool for Unix. The JavaScript 'liners' include:

These can be automated with the help of a 'task runner' or an IDE when changes are made to the program code.

'Transpilers' are used to translate other programming languages ​​such as CoffeeScript or TypeScript into JavaScript - or to simplify modern JavaScript code (e.g. ES2015) so that it runs in (almost) every browser. The most common transpiler for modern JavaScript is Babel.

  1. Product & project manager
    In general, developers don't particularly appreciate it when someone tries to explain to them how to do their job. But because product and project managers often lead development teams, that's exactly what happens. That can lead to discrepancies.

    David Fox from devRant also has an opinion on this: "Ultimately, in most cases, product and project managers are in some way the 'owners' of projects and processes without being involved to know the daily challenges and problems faced by software developers. "
  2. Bosses
    Just like product and project managers, development or engineering managers are responsible for leading teams of developers and ensuring that projects are completed on time and under budget.

    "In some companies, situations can arise where the boss is also a member of the development team. Especially if the boss was a developer himself and becomes boss after a promotion, there is potential for conflict," notes Fox .
  3. Recruiters
    Software developers don't have to actively look for a job themselves in order to be harassed by recruiters and headhunters - thanks to the shortage of skilled workers. It would be very difficult to find a developer who has not yet fallen into the clutches of recruiters.

    David Fox especially sees the persistence of the recruiters as a problem: "They call, email and they just won't leave you alone - even if you're not looking for a job. And even if If you are looking for a job, many recruiters tend to make irrelevant job offers or recommend positions whose profile does not fit at all - for example a job on the other side of the country, even though you are not ready to move.
  4. documentation
    If there is no documentation, the software developers complain. If it's too much, they complain, and if they have to do the documentation themselves, too. Even the developers are complaining about the way other people handle the documentation task.

    At this point, all developers finally agree, as Fox emphasizes: "Software developers want detailed, well-written and accurate documentation - but they don't want to do it themselves."
  5. Meetings
    Meetings are a problem not only for everyone else, but also for software developers. Especially when it comes to completely unnecessary, time-consuming and utterly boring get-togethers. As Fox explains, devotional items with the inscription 'I survived another meeting that should have been an email' are now also available.
  6. Coworking spaces
    With the rise of agility, flat hierarchies, collaboration and teamwork have become part of everyday life in companies - especially for software development teams. But it is precisely these people who usually find it difficult or impossible to cope with their work in an open-plan office - at least that's what the devRant figures say.

    David Fox explains: "There are just too many distractions: colleagues are chatting, meetings are missed, phone calls are missed. There are also a number of complaints about coffee in the office and other amenities - or that Opposite of that. "
  7. colleagues
    Self-explanatory: everyone has a colleague whom they particularly value. Not.

    In the case of software developers, the aversion to colleagues is usually based either on the poor quality of their work or an ego that is completely out of synch, reveals David Fox.
  8. Job interviews
    If a software developer is looking for a job and is invited to an interview, there is usually something to complain about afterwards:

    "The developers get just as angry as one with stupid questions or the solution of completely unpractical tasks in the job interview Interlocutor who doesn't even know what a developer is actually doing, "says Fox.
  9. Errors & bugs
    Software developers deal with errors and bugs day in and day out. That's why devRant founder Fox believes that developers think differently on this matter:

    "Most other problems don't get a positive resolution, but bugs and errors can be fixed and that feels good."
  10. Quality assurance
    Quality Assurance (QA) - or quality assurance - is a critical part of software development. Still, software developers often complain about the same things about QA experts as they do about product and project managers, according to Fox.

    "Quality assurance gets its hands on the product or project when the developers have completed it. This is why they often do not understand the hurdles and workarounds the developers had to overcome in the development process. Obviously, it also happens regularly that QA people are asking developers to revise areas that they could do themselves. "

What is TypeScript

TypeScript is a typed super-category of JavaScript that can be compiled into 'plain' JavaScript. The open source TypeScript compiler can be installed as a Node.js package. The following development environments support TypeScript:

  • Visual Studio 2017

  • Visual Studio 2019

  • Visual Studio Code

  • WebStorm

  • Sublime text

  • atom

  • Eclipse

  • Emacs

  • Vim

TypeScript adds optional types, classes and modules to JavaScript and supports tools for JavaScript applications with a large number of lines of code. Browser, host or operating system are irrelevant. By using 'types', software developers have the opportunity to use highly productive development tools and methods such as 'static checking' or 'code refactoring' when developing JavaScript applications. These 'types' are optional, but with a few comments they can make a big difference when it comes to 'static verification' of the program code. In addition, 'types' can also be used to define interfaces between software components and to gain insights into the behavior of existing JavaScript libraries.

In order to produce software components that are as robust as possible, TypeScript supports the latest JavaScript features.

Software development with TypeScript

TypeScript accepts JavaScript, but offers additional options: 'type annotations' and 'type checking' for compilation time, classes and modules. This is extremely useful if you want the software to run as reliably as possible. Simple JavaScript only generates errors during runtime - and only if an error-prone path is reached. The tutorial "TypeScript in 5 minutes