Dr. Axel Rauschmayer - Tackling TypeScript
Here you can read online Dr. Axel Rauschmayer - Tackling TypeScript full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. year: 2020, genre: Computer. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:
Romance novel
Science fiction
Adventure
Detective
Science
History
Home and family
Prose
Art
Politics
Computer
Non-fiction
Religion
Business
Children
Humor
Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.
- Book:Tackling TypeScript
- Author:
- Genre:
- Year:2020
- Rating:3 / 5
- Favourites:Add to favourites
- Your mark:
- 60
- 1
- 2
- 3
- 4
- 5
Tackling TypeScript: summary, description and annotation
We offer to read an annotation, description, summary or preface (depends on what the author of the book "Tackling TypeScript" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.
Tackling TypeScript — read online for free the complete book (whole text) full work
Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "Tackling TypeScript" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.
Font size:
Interval:
Bookmark:
Dr. Axel Rauschmayer
2020
- 1.1
- 1.2
- 1.3
- 1.4
- 1.5
- 1.6
- 1.7
The homepage of Tackling TypeScript is exploringjs.com/tackling-ts/
This book consists of two parts:
- Part 1 is a quick start for TypeScript that teaches you the essentials quickly.
- Part 2 digs deeper into the language and covers many important topics in detail.
This book is not a reference, it is meant to complement the official TypeScript handbook.
Required knowledge: You must know JavaScript. If you want to refresh your knowledge: My book JavaScript for impatient programmers is free to read online.
If you buy this book, you get:
- The current content in four DRM-free versions:
- PDF file
- ZIP archive with ad-free HTML
- EPUB file
- MOBI file
- Any future content that is added to this edition. How much I can add depends on the sales of this book.
On the homepage of this book, there are extensive previews for all versions of this book.
- The HTML version of this book has a link to comments at the end of each chapter.
- They jump to GitHub issues, which you can also access directly.
Reading instructions
Explains how to best read the content (in which order, what to omit, etc.).
External content
Points to additional, external, content.
Git repository
Mentions a relevant Git repository.
Tip
Gives a tip.
Question
Asks and answers a question (think FAQ).
Warning
Warns about a pitfall, etc.
Details
Provides additional details, similar to a footnote.
People who contributed to this book are acknowledged in the chapters.
- 2.1
- 2.1.1
- 2.1.2
- 2.1.3
- 2.1.4
- 2.1.5
- 2.1.6
- 2.2
- 2.3
- 2.3.1
- 2.3.2
You can skip this chapter if you are already sure that you will learn and use TypeScript.
If you are still unsure this chapter is my sales pitch.
While you are editing TypeScript code in an integrated development environment, you get warnings if you mistype names, call functions incorrectly, etc.
Consider the following two lines of code:
funcc() ;
For the second line, we get this warning:
Cannot find name 'funcc'. Did you mean 'func'?
Another example:
const result = a + b ;
This time, the error message for the last line is:
Operator '+' cannot be applied to types 'number' and 'boolean'.
Documenting parameters of functions and methods is something that many people do, anyway:
}
Specifying the types via {number}
and {string}
is not required, but the descriptions in English mention them, too.
If we use TypeScripts notation to document types, we get the added benefit of this information being checked for consistency:
}
Whenever I migrate JavaScript code to TypeScript, Im noticing an interesting phenomenon: In order to find the appropriate types for parameters for a function or method, I have to check where it is invoked. That means that static types give me information locally that I otherwise have to look up elsewhere.
And I do indeed find it easier to understand TypeScript code bases than JavaScript code bases: TypeScript provides an additional layer of documentation.
This additional documentation also helps when working in teams because it is clearer how code is to be used and TypeScript often warns us if we are doing something wrong.
If there are type definitions for JavaScript code, then editors can use them to improve auto-completion.
An alternative to using TypeScripts syntax, is to provide all type information via JSDoc comments like we did at the beginning of this chapter. In that case, TypeScript can also check code for consistency and generate type definitions. For more information, see chapter Type Checking JavaScript Files in the TypeScript handbook.
Refactorings are automated code transformations that many integrated development environments offer.
Renaming methods is an example of a refactoring. Doing so in plain JavaScript can be tricky because the same name might refer to different methods. TypeScript has more information on how methods and types are connected, which makes renaming methods safer there.
TypeScript tends to quickly support ECMAScript stage 4 features (such features are scheduled to be included in the next ECMAScript version). When we compile to JavaScript, the compiler option --target
lets us specify the ECMAScript version that the output is compatible with. Then any incompatible feature (that was introduced later) will be compiled to equivalent, compatible code.
Note that this kind of support for older ECMAScript versions does not require TypeScript or static typing: The JavaScript compiler Babel does it too, but it compiles JavaScript to JavaScript.
- It is an added layer on top of JavaScript: more complexity, more things to learn, etc.
- It introduces a compilation step when writing code.
- npm packages can only be used if they have static type definitions.
- These days, many packages either come with type definitions or there are type definitions available for them on DefinitelyTyped. However, especially the latter can occasionally be slightly wrong, which leads to issues that you dont have without static typing.
- Getting static types right is occasionally difficult. My recommendation here is to keep things as simple as possible for example: Dont overdo generics and type variables.
Font size:
Interval:
Bookmark:
Similar books «Tackling TypeScript»
Look at similar books to Tackling TypeScript. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.
Discussion, reviews of the book Tackling TypeScript and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.