Can anyone recommend a good introduction/book to TypeScript for people who already know some programming (e.g. Java, Python) but have no experience with JavaScript?

The only texts I’ve found so far assume prior JS knowledge (like The TypeScript Handbook https://www.typescriptlang.org/docs/handbook/intro.html) or seem rather unstructured to me (e.g. dropping a lot of different ways and shortcuts to do things without explaining concepts or making no clear distinction between basics/best practices and advanced use cases/edge cases).

Ideally it would explain core concepts (like functions, types, classes, …) first, with their most common use cases. Later chapter would do deep dives into different topics.

Edit: when I’m talking about TypeScript I’m talking about the whole language, not just the “modifications” it makes to JavaScript.

  • lemmyvore@feddit.nl
    link
    fedilink
    English
    arrow-up
    0
    ·
    edit-2
    1 year ago

    seem rather unstructured to me (e.g. dropping a lot of different ways and shortcuts to do things without explaining concepts

    That’s because there’s no way to explain TS concepts without the JS context, so any attempt to skirt around JS it’s going to feel like there’s a big part missing. You should think of TS like a way to write JS differently, it’s mostly a replacement for JSDoc/linting rolled into a nice package. It’s not a fully standalone different language.

    The closest comparison would be type hinting in Python – it’s useful but there’s no way you can use Python knowing just type hinting.

    • homoludens@feddit.deOP
      link
      fedilink
      arrow-up
      0
      ·
      1 year ago

      Like I said in my other replies: I am not attempting to skirt around JS. If TS is a superset of JS, it would obviously make no sense to try to avoid JS. What I’m looking for is a book/tutorial/… that is structured in a way that it teaches the most important parts the way they are used in TS (including JS) first.

      Example: when functions are taught it would explain the basics of JS functions along with the parameter type annotations of TS, because that’s the way functions are used in TS.