Unearthing the Excellence in JavaScript Douglas Crockford

#JavaScript
⚡️ بیشتر زبانهای برنامهنویسی بخشهای خوب و بد خودشون رو دارن، ولی JavaScript سهم بیشتری از بخشهای بد رو نصیبش کرده. دلیلش هم اینه که این زبان با عجله توسعه داده و منتشر شد، قبل از اینکه فرصت کافی برای اصلاح و پالایش داشته باشه. این کتاب مرجع و تاثیرگذار، اون قسمتهای ضعیف و مشکلدار JavaScript رو کنار میزنه تا زیرمجموعهای از زبان رو بهت نشون بده که قابلاعتمادتر، خواناتر و قابلنگهداریتره؛ زیرمجموعهای که میتونی باهاش کدی واقعاً توسعهپذیر و بهینه بنویسی.
👨💻 خیلیها در جامعهی توسعهدهندهها، داگلاس کراکفورد رو متخصص اصلی JavaScript میدونن. اون داخل این کتاب، ایدههای فوقالعادهای که باعث شدن JavaScript به یک زبان Object-Oriented قدرتمند تبدیل بشه رو بررسی میکنه؛ ایدههایی مثل Functions، Loose Typing، Dynamic Objects و ساختار بیانپذیر Object Literal. اما متأسفانه این ویژگیهای خوب با ایدههای بد و حتی فاجعهبار ترکیب شدن؛ مثل مدل برنامهنویسیای که مبتنی بر Global Variableهاست.
🌐 وقتی Java Appletها شکست خوردن، JavaScript بهصورت پیشفرض تبدیل به زبان اصلی وب شد؛ در نتیجه محبوبیتش تقریباً مستقل از کیفیت واقعی خودش بهعنوان یک زبان برنامهنویسی رشد کرد. در کتاب JavaScript: The Good Parts، کراکفورد بالاخره بین این حجم از تصمیمهای اشتباه و نیتهای خوب جستجو میکنه تا بخشهای واقعاً ظریف و خوشساخت JavaScript رو جدا کنه؛ بخشهایی مثل:
⚙️ سینتکس (Syntax)
🧩 آبجکتها (Objects)
🛠️ توابع (Functions)
🧬 وراثت (Inheritance)
📦 آرایهها (Arrays)
🔍 عبارات باقاعده (Regular Expressions)
🧠 متدها (Methods)
🎨 استایل کدنویسی (Style)
✨ قابلیتهای زیبا و هوشمند زبان (Beautiful Features)
🚀 جذابترین بخش ماجرا اینجاست که وقتی با زیرمجموعهای از JavaScript که این کتاب معرفی میکنه جلو بری، دیگه لازم نیست بعداً کلی عادت بد رو فراموش کنی یا از نو یاد بگیری. البته اگر خواستی بخشهای بد JavaScript و روشهای اشتباه استفاده ازش رو یاد بگیری، تقریباً هر کتاب JavaScript دیگهای این کار رو انجام میده!
💡 با خوندن JavaScript: The Good Parts، زبانی زیبا، مینیمال، قدرتمند و فوقالعاده بیانپذیر رو کشف میکنی که بهت اجازه میده کدهای مؤثر و حرفهای بنویسی؛ فرقی نمیکنه داری کتابخانههای شیگرا مدیریت میکنی یا فقط میخوای Ajax سریعتر اجرا بشه. اگر توسعهدهندهی وب هستی و سایت یا اپلیکیشن تحت وب میسازی، این کتاب واقعاً جزو کتابهای ضروریه.
📑 فهرست مطالب
📝 از مقدمه کتاب
📘 این کتاب دربارهی زبان برنامهنویسی JavaScript هست. برای برنامهنویسهایی نوشته شده که یا بهصورت اتفاقی یا از روی کنجکاوی، برای اولین بار وارد دنیای JavaScript میشن. همچنین برای توسعهدهندههایی مناسبه که تا الان در سطح مبتدی با JavaScript کار کردن و حالا آمادهان رابطهی حرفهایتر و عمیقتری با این زبان داشته باشن. JavaScript برخلاف تصور خیلیها، زبان فوقالعاده قدرتمندیه. چالشهای خاص خودش رو داره، ولی چون زبان نسبتاً کوچکیه، تسلط پیدا کردن روی اون خیلی سخت نیست.
🧠 هدف من در این کتاب اینه که کمکت کنم به سبک JavaScript فکر کنی. بخشهای مختلف زبان رو بهت نشون میدم و کمکم وارد فرایند کشف روشهایی میشیم که این بخشها میتونن کنار هم قرار بگیرن. این کتاب، کتاب مرجع (Reference) نیست. قرار نیست تمام جزئیات زبان و رفتارهای عجیبش رو پوشش بده. همهی اون اطلاعات رو خیلی راحت میتونی آنلاین پیدا کنی. در عوض، این کتاب فقط روی چیزهایی تمرکز میکنه که واقعاً مهم هستن.
⚠️ این کتاب برای مبتدیهای مطلق نوشته نشده. شاید یک روز کتابی به اسم JavaScript: The First Parts بنویسم، ولی این کتاب اون نیست. همچنین این کتاب دربارهی Ajax یا برنامهنویسی وب هم نیست. تمرکز کتاب فقط روی JavaScript هست؛ زبانی که تنها یکی از مهارتهای ضروری توسعهدهندهی وب محسوب میشه.
👨🏫 درباره نویسنده
🌍 داگلاس کراکفورد معمار ارشد JavaScript در شرکت یاهو! بوده و بیشتر از همه بهخاطر معرفی و نگهداری فرمت JSON (JavaScript Object Notation) شناخته میشه. اون سخنران ثابت کنفرانسهای تخصصی JavaScript پیشرفتهست و عضو کمیتهی ECMAScript هم هست.
Most programming languages contain good and bad parts, but JavaScript has more than its share of the bad, having been developed and released in a hurry before it could be refined. This authoritative book scrapes away these bad features to reveal a subset of JavaScript that’s more reliable, readable, and maintainable than the language as a whole-a subset you can use to create truly extensible and efficient code.
Considered the JavaScript expert by many people in the development community, author Douglas Crockford identifies the abundance of good ideas that make JavaScript an outstanding object-oriented programming language-ideas such as functions, loose typing, dynamic objects, and an expressive object literal notation. Unfortunately, these good ideas are mixed in with bad and downright awful ideas, like a programming model based on global variables.
When Java applets failed, JavaScript became the language of the Web by default, making its popularity almost completely independent of its qualities as a programming language. In JavaScript: The Good Parts, Crockford finally digs through the steaming pile of good intentions and blunders to give you a detailed look at all the genuinely elegant parts of JavaScript, including:
• Syntax
• Objects
• Functions
• Inheritance
• Arrays
• Regular expressions
• Methods
• Style
• Beautiful features
The real beauty? As you move ahead with the subset of JavaScript that this book presents, you’ll also sidestep the need to unlearn all the bad parts. Of course, if you want to find out more about the bad parts and how to use them badly, simply consult any other JavaScript book.
With JavaScript: The Good Parts, you’ll discover a beautiful, elegant, lightweight and highly expressive language that lets you create effective code, whether you’re managing object libraries or just trying to get Ajax to run fast. If you develop sites or applications for the Web, this book is an absolute must.
Table of Contents
1. Good Parts
2. Grammar
3. Objects
4. Functions
5. Inheritance
6. Arrays
7. Regular Expressions
8. Methods
9. Style
10. Beautiful Features
This is a book about the JavaScript programming language. It is intended for programmers who, by happenstance or curiosity, are venturing into JavaScript for the first time. It is also intended for programmers who have been working with JavaScript at a novice level and are now ready for a more sophisticated relationship with the language. JavaScript is a surprisingly powerful language. Its presents some challenges, but being a small language, it is easily mastered.
My goal here is to help you to learn to think in JavaScript. I will show you the components of the language and start you on the process of discovering the ways those components can be put together. This is not a reference book. It is not exhaustive about the language and its quirks. It doesn't contain everything you'll ever need to know. That stuff you can easily find online. Instead, this book just contains the things that are really important.
This is not a book for beginners. Someday I hope to write a JavaScript: The First Parts book, but this is not that book. This is not a book about Ajax or web programming. The focus is exclusively on JavaScript, which is just one of the languages the web developer must master.
About the Author
Douglas Crockford is a Senior JavaScript Architect at Yahoo!, well known for introducing and maintaining the JSON (JavaScript Object Notation) format. He's a regular speaker at conferences on advanced JavaScript topics, and serves on the ECMAScript committee.









