惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

G
Google Developers Blog
S
Schneier on Security
The Hacker News
The Hacker News
P
Proofpoint News Feed
Spread Privacy
Spread Privacy
L
LINUX DO - 热门话题
L
Lohrmann on Cybersecurity
I
Intezer
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Schneier on Security
Schneier on Security
Security Latest
Security Latest
AWS News Blog
AWS News Blog
B
Blog RSS Feed
Microsoft Security Blog
Microsoft Security Blog
有赞技术团队
有赞技术团队
博客园 - 叶小钗
The Last Watchdog
The Last Watchdog
O
OpenAI News
月光博客
月光博客
Hacker News: Ask HN
Hacker News: Ask HN
阮一峰的网络日志
阮一峰的网络日志
S
Security @ Cisco Blogs
Google Online Security Blog
Google Online Security Blog
云风的 BLOG
云风的 BLOG
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Latest news
Latest news
P
Palo Alto Networks Blog
Last Week in AI
Last Week in AI
M
MIT News - Artificial intelligence
Google DeepMind News
Google DeepMind News
P
Proofpoint News Feed
C
CERT Recently Published Vulnerability Notes
Apple Machine Learning Research
Apple Machine Learning Research
U
Unit 42
PCI Perspectives
PCI Perspectives
博客园 - 聂微东
SecWiki News
SecWiki News
宝玉的分享
宝玉的分享
Forbes - Security
Forbes - Security
H
Heimdal Security Blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Hugging Face - Blog
Hugging Face - Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
T
Troy Hunt's Blog
博客园 - 三生石上(FineUI控件)
Application and Cybersecurity Blog
Application and Cybersecurity Blog
罗磊的独立博客
WordPress大学
WordPress大学
D
Darknet – Hacking Tools, Hacker News & Cyber Security

oida.dev | TypeScript, Rust

TypeScript's `erasableSyntaxOnly` Flag Unsafe for work Tokio: Macros Tokio: Channels Tokio: Getting Started Network Applications on the Tokio Stack Remake, Remodel, Reduce. The `never` type and error handling in TypeScript 5 Inconvenient Truths about TypeScript Refactoring in Rust: Introducing Traits Refactoring in Rust: Abstraction with the Newtype Pattern Announcing the TypeScript Cookbook TypeScript: Iterating over objects The road to universal JavaScript 10 years of oida.dev Rust: Tiny little traits The TypeScript converging point How not to learn TypeScript Getting started with Rust Introducing Slides and Coverage TypeScript: The humble function overload TypeScript + React: Children types are broken TypeScript: In defense of any Rust: Enums to wrap multiple errors Dissecting Deno Error handling in Rust TypeScript: Unexpected intersections Upgrading Node.js dependencies after a yarn audit TypeScript: Array.includes on narrow types TypeScript + React: Typing Generic forwardRefs shared, util, core: Schroedinger's module names Learning Rust and Go TypeScript: Narrow types in catch clauses TypeScript: Low maintenance types Tidy TypeScript: Name your generics Tidy TypeScript: Avoid traditional OOP patterns Tidy TypeScript: Prefer type aliases over interfaces Tidy TypeScript: Prefer union types over enums Go Preact! ❤️ this in JavaScript and TypeScript TypeScript and ECMAScript Modules TypeScript + React: Why I don't use React.FC TypeScript + React: Component patterns TypeScript: Augmenting global and lib.dom.d.ts Vite with Preact and TypeScript TypeScript: Union to intersection type 11ty: Generate Twitter cards automatically Are large node module dependencies an issue? TypeScript: Variadic Tuple Types Preview TypeScript: Improving Object.keys Remake, Remodel. Part 4. TypeScript + React: Typing custom hooks with tuple types TypeScript: Assertion signatures and Object.defineProperty TypeScript: Check for object properties and narrow down type Boolean in JavaScript and TypeScript void in JavaScript and TypeScript Symbols in JavaScript and TypeScript Why I use TypeScript TypeScript + React: Extending JSX Elements TypeScript: Validate mapped types and const context TypeScript: Match the exact object shape TypeScript: The constructor interface pattern Streaming your Meetup - Part 4: Directing and Streaming with OBS Streaming your Meetup - Part 3: Speaker audio Streaming your Meetup - Part 2: Speaker video Streaming your Meetup - Part 1: Basics and Projector TypeScript and React Guide: Added a new styles chapter TypeScript and React Guide: Added a new render props chapter TypeScript and React: Styles and CSS TypeScript and React TypeScript and React Guide: Added a new prop types chapter TypeScript without TypeScript -- JSDoc superpowers TypeScript: Mapped types for type maps JAMStack vs serverless web apps The Unsung Benefits of JAMStack Sites TypeScript: Ambient modules for Webpack loaders My most favourite talks in 2018 TypeScript and React Guide: Added a new context chapter TypeScript: Built-in generic types TypeScript: Type predicates JSX is syntactic sugar TypeScript and React Guide: Added a new hooks chapter Getting your CfP application right FAQ on our Angular Connect Talk: Automating UI development TypeScript and Substitutability Debugging Node.js apps in TypeScript with Visual Studio Code From Medium: Deconfusing Pre- and Post-processing From Medium: PostCSS misconceptions Saving and scraping a website with Puppeteer Cutting the mustard - 2018 edition Wordpress as CMS for your JAMStack sites My most favourite podcast episodes in 2017 My most favourite talks in 2017 My most favourite books in 2017 The Best Request Is No Request, Revisited Not so hidden figures - Organizing ScriptConf My podcast journey to ScriptCast Grid layout, grid layout everywhere! #scriptconf and #devone Object streams in Node.js
My new book: TypeScript in 50 Lessons
2020-10-12 · via oida.dev | TypeScript, Rust

I’ve written a new book! On October 6, the pre-release of TypeScript in 50 Lessons started. It’s 450 pages, published by the wonderful people at Smashing Magazine, and available to read right now! The printed version is being produced as I write, and will be shipping in mid-November.

It’s what it says on the cover: TypeScript. 50 Lessons. All you need to know to become an expert in TypeScript. TypeScript in 50 Lessons has been written with longevity in mind. We focus on the type system and give you a mental model so you are prepared for all future TypeScript releases. And this is how it came to be…

The book: TypeScript in 50 Lessons

The itch… #

TypeScript in 50 Lessons started all the way back in 2019. My TypeScript + React guide gained some popularity, just enough to bring acquisition editors of several publishing houses into my mailbox, wanting me to write about TypeScript. There were renowned publishers among them, and also some infamous companies that shoot for quantity, rather than quality.

People reaching out to you to write a book is not uncommon. Especially not if you have material published already, like on a blog, or on Slideshare. This also happened when I wrote my first book Front-End Tooling, which was largely based on a workshop I’ve given in 2014 and 2015.

Compared to Front-End Tooling, the number of publishers reaching out was significantly higher. A handful, but still: I got an e-Mail every week from a different person. All publishers had one thing in common: They were in a hurry. They wanted me to write about TypeScript, yes. But either they had an outline ready and wanted me to contribute a couple of chapters. Or they had a title ready and wanted me to fill it with content in the next couple of months.

A beautiful interior

I guess this isn’t so uncommon either. You all know how fast web technologies move. How quickly new things appear and tried and trusted things go into oblivion. Tech book publishers must be frightened of how soon books might become outdated. I know from experience! Front-End Tooling was written within 9 months, but it took another year until it was published. I wrote The announcement post in August 2015, the print version appeared at my doorstep in January 2017. Front-End Tooling was yesterday’s news when it was finally published.

I love Front-End Tooling, and I think its concepts and ideas are valid to this day – the chapters on objects streams and promises haven’t aged a bit! But it sobered my view on publishing books. It was a tremendous effort from many people to bring this piece to paper – was it worth it?

That’s why I respectfully declined all offers to write a TypeScript book. But one thing happened: I was stung by the idea of writing a TypeScript book. Oh, and it was itching … a lot!

The pitch! #

By the beginning of 2019, I spent so much time with TypeScript and its type system that I developed a mental model. A map to navigate the type space! Something that would make good learning material. Slides, blog posts. Or maybe something bigger? The mails I got from the acquisition editors were the last push I needed to develop this idea into an outline. And finally to pitch it to a publisher.

I said to myself to write another book only under two conditions:

  1. The book has to have a certain longevity. TypeScript is a hot topic, no doubt. But I don’t want to write about the most recent version or explain each feature that ever existed. I want to write a book that isn’t outdated even if the TypeScript team releases four versions a year, which they do!
  2. It has to have a certain visual appeal. Beautiful typography. Wonderful artworks. A unique experience! I realized over the years that I find it increasingly difficult to focus on text if fonts don’t play well with another, and if line lengths are too wide or to narrow. I had to ditch some undoubtedly good books just because my eyes weren’t able to grasp the looks of a typeface or the way they publishers work with their typeface. Also, I had some ideas on how a TypeScript book can be a unique experience for readers. Something that transcends from a piece of paper into a developer’s everyday work environment: The code editor.

Lots of code samples

Condition number two lead me to a publisher I love since basically forever: Smashing Magazine. I have every release on my bookshelf, even if I’m not the targeted audience. Their books are a joy to read, both visually and content-wise. And they care so much about every little detail to make every book and outstanding experience.

When I wrote Vitaly, then-editor-in-chief of Smashing Magazine, and a frequent collaborator, and pitched my idea, we quickly found that we both take condition one very seriously. Smashing books stand the test of time. I just recently ordered a book from 2014, and its contents still hold up to this day.

So if Smashing decides on publishing a book on a programming language, it has to guarantee certain longevity!

Sounds like a match made in heaven!

The book … #

Some say “a well-planned book writes itself”. That is kind of true for TypeScript in 50 Lessons. I spent a lot of time in planning. Gathering examples, bringing all bits and pieces in shape, and finding the right narrative that leads readers from their very first TypeScript example up to the advanced concepts.

Frequent calls with Smashing have been a tremendous help, as they assured me that there is no rush, gave invaluable feedback on the content, and helped to play around with different concepts. We quickly found a few key features we want the book to have.

A Smashing experience

  1. It has to be practical. Examples and real-world use cases help a lot in understanding fundamental concepts. No foo, bar, baz, but stuff from actual applications. Finding good examples is one thing, but reworking them so you build up knowledge with every step you take is a quite challenging task.
  2. It has to be gentle and easily digestible. TypeScript and type systems are very technical topics. And they can be very demanding if you don’t allow room to breathe. That’s why we split up each chapter in seven lessons, so you can stop whenever you like. Non-technical interludes between chapters give you better insights into TypeScript culture and give you time to reflect on what you just learned.
  3. Reduce the contents to the essentials. To guarantee longevity, we intentionally leave out some things from TypeScript’s long history. I see little reason in learning about the old style module and namespace system if there are now things available that are more aligned with JavaScript. Nor do I think we should learn about OOP concepts that have been carried over from other programming languages and come from a time where classes didn’t exist in JavaScript. Instead, the focus on the type system as an extension to JavaScript will give you enough knowledge to be up to speed with each new TypeScript release.
  4. Take more time explaining complex concepts. We spend a whole chapter on generics and another chapter on conditional types. Were other books touch upon them briefly in a couple of pages, we look at these concepts by working out some real-world examples. Plus, we get some insights into how to design good types!
A screenshot of the EPUB version on Apple Books
If your eBook software is capable of displaying colors, you get beautiful syntax highlighting, with red-highlighted text areas when TypeScript throws an error

This is what makes TypeScript in 50 Lessons. It is very opinionated, but also the guide you need to reduce the noise of so many different approaches. Among my most favorite chapters is chapter 1, where we see TypeScript from a tooling perspective. And chapter 4, the watershed chapter that takes you from a beginner to an expert. This is also the part were seasoned TypeScript developers will gain a lot of new insights.

You can check out all the examples and a free sample chapter (chapter 4) on the book’s official website

The look! #

So far about the content, but what about the second condition. The looks? The people at Smashing outdid themselves!

  1. The book’s artwork is done by Rob Draper. Rob worked with us on ScriptConf and TSConf:EU, and I’m so happy that he agreed to illustrate my book as well. Talking to him about what we want to achieve with the book has had a tremendous influence on the overall direction. He coined the phrase of having a “human approach towards a very technical topic”, which was the motto for the entire book. His artwork is playful, fun, and fitting!
  2. The interior is filled with great looking code examples. The printed version has red squigglies wherever they are necessary, bringing an immersive code editor feel to the book. The eBook versions can’t feature red squiggly lines, so they highlight erroneous code with red underlines and red text. The content has been tailored for each medium, and you have the best reading experience, no matter what you choose!
  3. The printed book’s finishing includes metallic ink, carefully selected colors, and nice additions on each page to make the whole book a unique experience. The typography is well selected and legible. Code samples are colored so you can focus on the important parts. Illustrations add value, not distracting from what’s happening around. The result is stunning!
A photo of my Kindle, with my book on it
Black and white eBook readers, like the Kindle, work with contrasts and underlines to highlight important areas

Working with Smashing has been nothing but amazing. The team really cares about the result, and everybody puts so much effort into making each book unique. In the end, every page has been crafted, polished, and a team effort through and through.

Get it now!

The book is available right now. The printed copies are at the printer and will be shipped in November. If you buy the printed book, you can read the eBook versions right away.

I hope you enjoy reading it as much as I enjoyed writing it!

Related Articles