83 Specific Ways to Improve Your TypeScript
Dan Vanderkam

#TypeScript
#Effective
#C++
📜 تایپاسکریپت یک «ابَرمجموعهی تایپدار» (typed superset) از جاوااسکریپته که این پتانسیل رو داره تا خیلی از دردسرهایی که جاوااسکریپت به خاطرشون معروفه رو حل کنه.
😅 اما تایپاسکریپت هم قلقهای خاص خودشو داره و فهمیدن اینکه چطور باید به طور مؤثر ازش استفاده کرد، زمان و تمرین میخواد.
📚 این کتاب کاربردی، با استفاده از فرمتی که توسط کتابهای معروف Effective C++ و Effective Java (هر دو از انتشارات Addison-Wesley) محبوب شد، شامل ۸۳ آیتم میشه که توصیههای مشخصی در مورد بایدها و نبایدها و اینکه چطور باید به این زبان فکر کنید، ارائه میده.
👨🏫 نویسنده، دن وندرکام (Dan Vanderkam)، به شما نشون میده که چطور توصیهی هر آیتم رو با مثالهای عینی و کاربردی پیادهسازی کنید.
🚀 این کتاب به شما کمک میکنه تا از یک کاربر مبتدی یا متوسط که با اصول اولیه تایپاسکریپت آشناست، به یک متخصص تبدیل بشید که میدونه چطور از این زبان به بهترین شکل استفاده کنه.
🆕 این ویرایش دوم که برای تایپاسکریپت ۵ بهروز شده، شامل دو فصل جدید در مورد «برنامهنویسی در سطح تایپ» (type-level programming) و «دستورپختهای تایپاسکریپت» (TypeScript recipes) است.
✅ در این کتاب یاد میگیرید:
🔩 زیر و بم و فوت و فن سیستم تایپ تایپاسکریپت رو یاد بگیرید.
🔍 از «استنتاج نوع» (type inference) استفاده کنید تا با کمترین میزان حاشیهنویسی تایپ (type annotations)، به امنیت کامل برسید.
🛡️ تایپها رو طوری طراحی کنید که کد شما امنتر و قابل فهمتر بشه.
🧩 APIهای پیچیده رو با استفاده از انواع جنریک (generic types) و برنامهنویسی در سطح تایپ مدلسازی کنید.
🤝 بفهمید که وابستگیها (dependencies) و فایلهای تعریف تایپ (type declaration files) در تایپاسکریپت چطور کار میکنند.
🚚 پایگاه کد جاوااسکریپت خودتون رو با موفقیت به تایپاسکریپت مهاجرت بدید.
فصل ۱: آشنایی با تایپاسکریپت
فصل ۲: سیستم تایپ تایپاسکریپت
فصل ۳: استنتاج نوع و تحلیل جریان کنترل
فصل ۴: طراحی تایپ
فصل ۵: عدم استحکام (Unsoundness) و تایپ any
فصل ۶: جنریکها و برنامهنویسی در سطح تایپ
فصل ۷: دستورپختهای تایپاسکریپت
فصل ۸: تعریف تایپها (Type Declarations) و @types
فصل ۹: نوشتن و اجرای کد شما
فصل ۱۰: مدرنسازی و مهاجرت
پیوست: نگاشت آیتمها بین نسخهها
دن وندرکام یک توسعهدهنده نرمافزار مستقل است که قبلاً در گوگل و Sidewalk Labs کار میکرده. او نویسنده کتابخانههای متنباز متعدد جاوااسکریپت/تایپاسکریپت، از جمله کتابخانه رسم نمودار dygraphs، و ابزارهای source-map-explorer، literate-ts، pg-to-ts و crosswalk است. او نویسنده کتاب Effective TypeScript: 62 Ways to Improve Your TypeScript (O’Reilly 2019) است و در کنفرانسهای متعدد تایپاسکریپت سخنرانی کرده است. او در وبلاگ effectivetypescript.com مینویسد.
TypeScript is a typed superset of JavaScript with the potential to solve many of the headaches for which JavaScript is famous. But TypeScript has a learning curve of its own, and understanding how to use it effectively takes time and practice. Using the format popularized by Effective C++ and Effective Java (both Addison-Wesley), this practical book features 83 items that give specific advice on what to do and what not to do, and how to think about the language.
Author Dan Vanderkam shows you how to apply each item's advice through concrete examples. This book will help you advance from a beginning or intermediate user familiar with TypeScript basics to an expert who knows how to use the language well.
Updated for TypeScript 5, this second edition includes two new chapters on type-level programming and TypeScript recipes.
Table of Contents
Chapter 1. Getting to Know Typescript
Chapter 2. TypeScript's Type System
Chapter 3. Type Inference and Control Flow Analysis
Chapter 4. Type Design
Chapter 5. Unsoundness and the any Type
Chapter 6. Generics and Type-Level Programming
Chapter 7. TypeScript Recipes
Chapter 8. Type Declarations and @types
Chapter 9. Writing and Running Your Code
Chapter 10. Modernization and Migration
Appendix. Item Mapping Between
Dan Vanderkam is an independent software developer, formerly at Google and Sidewalk Labs. He is the author of numerous open source JavaScript/TypeScript libraries, including the dygraphs charting library, source-map-explorer, literate-ts, pg-to-ts and crosswalk. He is the author of Effective TypeScript: 62 Ways to Improve Your TypeScript (O'Reilly 2019) and has spoken at numerous TS conferences. He blogs at effectivetypescript.com.









