What is the best alternative to JavaScript?

Typescript-JavaScript that scales.

JavaScript is a… Special language with a few ‘ peculiar ‘ properties but that is an answer to itself.

JavaScript is a dynamic language and does not make it difficult at all:

(Running in the Chrome console)

In a large application This blood, blood link and you get the most crazy problems with it.

Typescript solves this by introducing types.

Try this in typescript and you will get this:

(Executed in the typescript Playground)

But how does typescript work?

First, it is not a new language that is converted to JavaScript. It is a SuperSet that is on top of JavaScript. So you can write fine ‘ normal ‘ JavaScript in typescript. Here, the Typescript compiler has no difficulty with it if you want to.

If you set the Typescript compiler at its STRICST it won’t be any number of crazy things that you can easily extract from vanilla JavaScript to an absolute minimum.

But this is far from everything.In typescript You also get:

  • Real classes
  • Inheritance as you are familiar with Java, C#, C++, etc.
  • Abstract classes
  • Abstract methods
  • Interfaces
  • Generic
  • Etc

And now it comes beautiful.Your Type of Script code will be converted into a JavaScript version that you can specify yourself. Want to ES3? Then you get ES3.

Because typescript can be compiled ‘ down ‘, the Type of script team can add functionality to typescript that is still miserable for long to meet by EMCA International.It also makes it easier to be compatible with older browsers.

PS > You can actually stop 10 in a ‘ object ‘ in typescript, you just have to create it and type it:

Obj is type both.

Both can be a press (interface indicating the shape of an object) and number.Weird, size can’t:)

There are a number of languages that compile to JavaScript.So there was CoffeeScript, Dart, etc. All this was not such a success, the time was not good for those languages. They were created for the emergence of NodeJS, at a time when front-end development mostly appeared in a text editor and under the ease of “F5”. Nowadays, the beautiful looks different. We have more complex environments and a lot of extra tools. It has become the norm to work with a NodeJS Web server that dynamically compiles and builds one and the other.

The alternative, which I see a lot nowadays, is a Type of Script.A small pile of syntactically sugar that improves the rules of the game anyway. The tool around typescript is relatively good and it integrates well into a modern development environment.

That depends a bit on the problem you want to solve.

CSS has a lot of possibilities to manipulate layout, but business logic is very tricky to implement.

Client side business logic quickly asks for a cross-browser solution.Other languages (of which Dart may still make a chance) are not always supported by all browsers.

You can, of course, solve a number of things on the server, but that knows its own challenges again.

So… What do you want to accomplish?

Leave a Reply