Typescript vs Javascript

Please talk about this if you have used at least one of them proficently or you have some decent knowledge in them.

IIRC, TypeScript was Microsoft fixing the issues with JavaScript that arose from the lack of strict types. Basically, TypeScript adds strict data types/structures to JavaScript to make it more readable and easy to debug.

4 Likes

so, which do you prefer?

1 Like

I don’t know or use TypeScript so I can’t really choose, this is just some context I remember reading in an article somewhere

2 Likes

I hate JS, but I have and use it. Typescript is supposed to be a more formally correct and cleaned alternatives with quite some resemblance to JS.
But this said, I would still pick JS and learn typescript basics only in case angular is of interest.

1 Like

Typescript is Microsoft JavaScript and I hate it.

JS gang for life my boys.

lol, I’m going over to the typescript gang.

That is normally the angular gang as well …

I don’t even understand Typescript. Half of the things I can do in JS isn’t even possible in Typescript.

Well, than you might be doing things in a unproper way :slight_smile:

2 Likes

Just to clarify, TypeScript isn’t exactly a language on it’s own (it is a language, but there’s more to it). TypeScript is actually just transpiled into JavaScript, hence the resemblance between the two makes a lot of sense. My understanding is TypeScript essentially just adds complaints about types to JavaScript, but also potentially only at ‘compile’ time (which is misnamed as it is really ‘transpile time’) rather than also at run time, although I’m not an expert and going from memory from reading about it.

1 Like

You are basically right. IT kind of came to be as a way to try and help/force JS programmers to write cleaner code … not sure it truly worked as it is basically used only in few frameworks (where it gets converted into JS) and never went truly native.

2 Likes