I am Software Developer, currently interested in static type languages (TypeScript, Elm, ReScript) mostly in the frontend land, but working actively in Python also. I am available for mentoring.
Thank you for the article. I want to correct some mistakes. The first which I have spotted, and it is very common is:
Wrong information about OOP
TypesScript is an Object oriented programming language whereas JavaScript is a scripting language.
TS is multi-paradigm language in the same way JS is, JS has also OOP features and at this level TS is in any way more object oriented than JS itself. Statement that TS is OOP and JS is not, would never be correct, as objects exists in the language from beginning. But before ES6 there was no class keyword, and no classical class based OOP syntax, now it's history though.
That said below quote is also outdated information:
Typescript supports object-oriented programming and adds new features to improve upon Javascript’s OOP functionality. Typescript supports the use of classes by using the class keyword
Wrong information about void type
Another mistake is:
Void is a subtype of undefined
Lets check if this is true:
typeIsVoidSubTypeUndefined=voidextendsundefined?true:false;// above evaluates to false
It means void is not a subtype of undefined type. undefined is really a unit type in the same way void is, there is no relation between these types.
Mistake about instanceof
This operator can check for custom types not defined by Javascript. Below, we first write a custom type, make an instance of it, and check that it is indeed the right variable.
Its not valid, instanceof is valid JS operator, it works only with objects created by new. Its not any kind of TS feature, saying that it has something with
custom types not defined by Javascript
is incorrect.
Also I very dislike the whole Step 9 as it mixes JS operators which exists in the runtime with TS operators existing only at compilation. In Step 2 you describe some types in some random way, and surprisingly there is no info about Record and Union types which are the basic tool for every TS programmer.
In summary I want to thank you for the effort, but I am very sorry to say in my opinion some information's in the article could be double checked and verified.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Thank you for the article. I want to correct some mistakes. The first which I have spotted, and it is very common is:
Wrong information about OOP
TS is multi-paradigm language in the same way JS is, JS has also OOP features and at this level TS is in any way more object oriented than JS itself. Statement that TS is OOP and JS is not, would never be correct, as objects exists in the language from beginning. But before ES6 there was no
class
keyword, and no classical class based OOP syntax, now it's history though.That said below quote is also outdated information:
Wrong information about
void
typeAnother mistake is:
Lets check if this is true:
It means
void
is not a subtype ofundefined
type.undefined
is really a unit type in the same wayvoid
is, there is no relation between these types.Mistake about
instanceof
Its not valid,
instanceof
is valid JS operator, it works only with objects created bynew
. Its not any kind of TS feature, saying that it has something withis incorrect.
Also I very dislike the whole Step 9 as it mixes JS operators which exists in the runtime with TS operators existing only at compilation. In Step 2 you describe some types in some random way, and surprisingly there is no info about Record and Union types which are the basic tool for every TS programmer.
In summary I want to thank you for the effort, but I am very sorry to say in my opinion some information's in the article could be double checked and verified.