TypeScript: You Can Read It

TypeScript is billed as JavaScript with types, which is great and high tech and useful and all, but I really like that you can just write code that describes a class rather than writing code that meticulously constructs a class-like contraption.

With JavaScript, I’d say:

  • There are many ways to do things.
  • Some ways are obviously bad.
  • Some ways are subtly bad.
  • The good way isn’t obvious.

This is a class with some methods in a module in JavaScript:

This is the same in TypeScript:

Notice the words, such as “class” and “static”. These words can be written, then later read and understood by humans. I think this words-with-meanings concept is going to be a big hit.

This entry was posted in Uncategorized. Bookmark the permalink.