Pragmatic, Balanced FP in JavaScript
Kyle Simpson
JavaScript#
Functional-Light JavaScript یک نگاه متعادل و عملگرایانه به برنامهنویسی تابعی (Functional Programming) در زبان JavaScript ارائه میدهد.
برنامهنویسی تابعی یکی از قدرتمندترین پارادایمهای ساختاری در توسعه نرمافزار است که به تولید کدهایی قابلاعتمادتر، قابلبررسیتر و خواناتر منجر میشود. اگر تا به حال سعی کردهاید این سبک را یاد بگیرید اما با واژگانی مانند "monad"، مفاهیم ریاضی مانند category theory یا نمادهایی مثل λ دچار سردرگمی شدهاید، بدانید که تنها نیستید.
کتاب Functional-Light Programming چکیدهای از مهمترین اصول برنامهنویسی تابعی را ارائه میدهد—از جمله خلوص توابع (pure functions)، تغییرناپذیری مقادیر (immutability)، ترکیبپذیری (composition) و موارد دیگر—و آنها را به الگوهایی قابلدرک در دنیای واقعی JavaScript تبدیل میکند. برخلاف نگاه تمامگرایانه و گاه سختگیرانهای که در FP مشاهده میشود، این کتاب به شما میآموزد که چگونه با بهبود تدریجی کد خود، قدمبهقدم به سبک تابعی نزدیک شوید.
هانس لوند، توسعهدهنده نرمافزار:
«با تمرکز کتاب روی اصول به جای اصطلاحات فنی، حالا درک عمیقتری از مبانی برنامهنویسی تابعی دارم و برای یادگیری بیشتر انگیزه گرفتهام.»
اسلام اطراش، مهندس جاوااسکریپت:
«کتاب FLJS واقعاً ذهنگشا بود! مفاهیمی که توضیح داده شده فوقالعاده بودند. این کتاب به من یاد داد بهجای تمرکز روی فریمورکها، مفاهیم پایهای برنامهنویسی را درک کنم.»
دمیتری وولف، توسعهدهنده فرانتاند در IBM:
«هیچکس JavaScript را به خوبی Kyle Simpson توضیح نمیدهد. او پیچیدهترین مفاهیم را با زبانی ساده و دقیق بیان میکند، بدون آنکه از جزئیات صرفنظر کند.»
توین هو، توسعهدهنده فولاستک:
«بعد از خواندن این کتاب، بالاخره دلیل استفاده از برنامهنویسی تابعی را فهمیدم. اگرچه پیشتر از توابع لیستی استفاده میکردم، فصل ۹ دید تازهای به من داد. این کتاب را به همکارانم هم پیشنهاد میکنم.»
Functional-Light JavaScript انتخابی عالی برای توسعهدهندگانی است که میخواهند اصول برنامهنویسی تابعی را بدون پیچیدگیهای تئوریک و با کاربردهای واقعی در JavaScript بیاموزند و در پروژههای روزمره خود پیادهسازی کنند.
Functional-Light JavaScript is a balanced, pragmatic exploration of Functional Programming in JavaScript.
Functional Programming (FP) is an incredibly powerful paradigm for structuring code that yields more robust, verifiable, and readable programs. If you've ever tried to learn FP but struggled with terms like "monad", mathematical concepts like category theory, or symbols like λ, you're not alone.
"By focusing on principles instead of terminology, I now feel much more confident in my understanding of foundations of functional programming. I'm motivated and excited to dive even deeper!" --Hannes Lund, Software Developer
"I can say for sure that the FLJS book is mind-blowing! I almost lost my mind with the concepts it explains! This book gave me the right way of programming by understanding concepts more than focusing on Frameworks!" --Islam Attrash, JS Engineer
"Nobody explains JavaScript as well as Kyle Simpson. He is as thorough as he is humble, explaining complex ideas in simple language. Kyle makes learning JavaScript easy without skipping the details." --Dmitri Wolf, Front End Developer, IBM
"After reading this book, I finally found the reason why I should use functional programming. Although I'm experienced in using list operators, chapter 9 gave me a new point of view to use them better. I would recommend this book to my coworkers." --Tuyen Ho, Full-Stack Developer, Grande JSC
Table of Contents
Chapter 1: Why Functional Programming?
Chapter 2: The Nature of Functions
Chapter 3: Managing Function Inputs
Chapter 4: Composing Functions
Chapter 5: Reducing Side Effects
Chapter 6: Value Immutability
Chapter 7: Closure vs. Object
Chapter 8: Recursion
Chapter 9: List Operations
Chapter 10: Functional Async
Chapter 11: Putting It All Together
Appendix A: Transducing
Appendix B: The Humble Monad
Appendix C: FP Libraries
About the Author
Kyle Simpson is a web-oriented software engineer, widely acclaimed for his "You Don't Know JS" book series and nearly 1M hours viewed of his online courses. Kyle's superpower is asking better questions, who deeply believes in maximally using the minimally-necessary tools for any task. As a "human-centric technologist", he's passionate about bringing humans and technology together, evolving engineering organizations towards solving the right problems, in simpler ways. Kyle will always fight for the people behind the pixels.