Leanpub Header

Skip to main content

Composing Software

An Exploration of Functional Programming and Object Composition in JavaScript

Bu kitap % 100 tamamlandıBu kitabın son güncelleme zamanı 2024-08-11.

All software design is composition: the act of breaking complex problems down into smaller problems and composing those solutions. Most developers have a limited understanding of compositional techniques. It's time for that to change.

En düşük fiyat

$34.00

$34.00

Ödeyeceğiniz Miktar

Yazarın kazandığı

$

Also available for 2 book credits with a Reader Membership

PDF
EPUB
WEB
APP
238
Sayfa
Hakkında

Hakkında

Kitap Hakkında

All software design is composition: the act of breaking complex problems down into smaller problems and composing those solutions. Most developers have a limited understanding of compositional techniques. It's time for that to change.

In "Composing Software", Eric Elliott shares the fundamentals of composition, including both function composition and object composition, and explores them in the context of JavaScript. The book covers the foundations of both functional programming and object oriented programming to help the reader better understand how to build and structure complex applications using simple building blocks.

You'll learn:

  • Functional programming
  • Object composition
  • How to work with composite data structures
  • Closures
  • Higher order functions
  • Functors (e.g., array.map)
  • Monads (e.g., promises)
  • Transducers
  • Lenses

All of this in the context of JavaScript, the most used programming language in the world. But the learning doesn't stop at JavaScript. You'll be able to apply these lessons to any language. This book is about the timeless principles of software composition and its lessons will outlast the hot languages and frameworks of today. Unlike most programming books, this one may still be relevant 20 years from now.

This book began life as a popular blog post series that attracted hundreds of thousands of readers and influenced the way software is built at many high growth tech startups and fortune 500 companies.

Yazar

Yazar Hakkında

Eric Elliott

Eric Elliott is a Webby-nominated software engineering expert, author, and creator of SudoLang, an AI programming language. With over 10 years of experience deploying AI models at scale to millions of users, he built and trained production AI models, and was an early pioneer of prompt engineering and AI Driven Development (AIDD). He has served as an engineering manager working on Generative AI for Adobe Firefly, tech lead on a social video AI app spun out of Stanford Research Institute, and a JavaScript expert and consultant on software development productivity and AIDD.

The Leanpub Podcast

Episode 301

An Interview with Eric Elliott

İçerik

İçindekiler

Thank You

Composing Software: An Introduction

  1. You Compose Software Every Day
  2. Conclusion

The Dao of Immutability (The Way of the Functional Programmer)

  1. Forward

The Rise and Fall and Rise of Functional Programming (Composable Software)

  1. The Rise of Functional Programming
  2. The Fall of Functional Programming
  3. The Rise of Functional Programming
  4. Functional Programming Has Always Been Alive and Well

Why Learn Functional Programming in JavaScript?

Pure Functions

  1. What is a Function?
  2. Mapping
  3. Pure Functions
  4. The Trouble with Shared State
  5. Same Input, Same Output
  6. No Side Effects
  7. Conclusion

What is Functional Programming?

  1. Pure Functions
  2. Function Composition
  3. Shared State
  4. Immutability
  5. Side Effects
  6. Reusability Through Higher Order Functions
  7. Containers, Functors, Lists, and Streams
  8. Declarative vs Imperative
  9. Conclusion

A Functional Programmer’s Introduction to JavaScript

  1. Expressions and Values
  2. Types
  3. Destructuring
  4. Comparisons and Ternaries
  5. Functions
  6. Currying
  7. Function Composition
  8. Arrays
  9. Method Chaining
  10. Conclusion

Higher Order Functions

Curry and Function Composition

  1. What is a curried function?
  2. What is a partial application?
  3. What’s the Difference?
  4. What is point-free style?
  5. Why do we curry?
  6. Trace
  7. Curry and Function Composition, Together
  8. Conclusion

Abstraction & Composition

  1. Abstraction is simplification.
  2. Abstraction in Software
  3. Abstraction through composition
  4. How to Do More with Less Code
  5. Conclusion
  6. Reduce
  7. Reduce is Versatile
  8. Conclusion

Abstract Data Types and the Software Crisis

  1. Common ADT Examples
  2. Why ADTs?
  3. History of ADTs
  4. Specifications for ADTs
  5. Stack ADT Example
  6. Concrete Implementations
  7. Conclusion
  8. Glossary

Functors & Categories

  1. Why Functors?
  2. Functor Laws
  3. Category Theory
  4. Build Your Own Functor
  5. Curried Map
  6. Conclusion

Monads

  1. You’re probably already using monads.
  2. What Monads are Made of
  3. Building a Kleisli Composition Function
  4. The Monad Laws
  5. Conclusion

The Forgotten History of OOP

  1. The Big Idea
  2. The Essence of OOP
  3. What OOP Doesn’t Mean
  4. What is an object?
  5. We’ve lost the plot.

Object Composition

  1. What is Object Composition?
  2. Three Different Forms of Object Composition
  3. Notes on Code Examples
  4. Aggregation
  5. Concatenation
  6. Delegation
  7. Conclusion

Factory Functions

  1. Literals for One, Factories for Many
  2. Returning Objects
  3. Destructuring
  4. Computed Property Keys
  5. Default Parameters
  6. Type Inference
  7. Factory Functions for Mixin Composition
  8. Conclusion

Functional Mixins

  1. Motivation
  2. What are mixins?
  3. What is functional inheritance?
  4. What is a functional mixin?
  5. Composing Functional Mixins
  6. When to Use Functional Mixins
  7. Caveats
  8. Conclusion

Why Composition is Harder with Classes

  1. The Delegate Prototype
  2. The .constructor Property
  3. Class to Factory is a Breaking Change

Composable Custom Data Types

  1. You can do this with any data type
  2. Composable Currency

Lenses

  1. Why Lenses?
  2. Background
  3. Lens Laws
  4. Composing Lenses

Transducers

  1. Why Transducers?
  2. Background and Etymology
  3. A Musical Analogy for Transducers
  4. Transducers compose top-to-bottom.
  5. Transducer Rules
  6. Transducing
  7. The Transducer Protocol
  8. Conclusion

Elements of JavaScript Style

  1. 1. Make the function the unit of composition. One job for each function.
  2. 2. Omit needless code.
  3. 3. Use active voice.
  4. 4. Avoid a succession of loose statements.
  5. 5. Keep related code together.
  6. 6. Put statements and expressions in positive form.
  7. 7. Use parallel code for parallel concepts.
  8. Conclusion: Code should be simple, not simplistic.

Mocking is a Code Smell

  1. TDD should lead to better design.
  2. What is a code smell?
  3. What is a mock?
  4. What is a unit test?
  5. What is test coverage?
  6. What is tight coupling?
  7. What causes tight coupling?
  8. What does composition have to do with mocking?
  9. How do we remove coupling?
  10. “Code smells” are warning signs, not laws. Mocks are not evil.

Leanpub Önkoşulsuz, Risksiz, %100 Mutluluk Garantilidir

Leanpub'tan yaptığınız alışverişlerde, 60 günlük sürede %100 iade garantisi mevcut, bunun için sadece iki tıklama yeterli. Detaylar için (ingilizce) kullanım sözleşmesini okuyunuz.

10$ değerinde bir satıştan 8$, 20$ değerinde bir satıştan 16$ kazanın

7,99$ veya üzeri satışlarda %80 telif, 0,99$ ile 7,98$ arasındaki satışlarda 50 sent sabit ücret düşülerek %80 telif ödüyoruz. 10$'lık bir satıştan 8$, 20$'lık bir satıştan 16$ kazanıyorsunuz. Yani, kitabınızın iade edilmemiş 5000 kopyasını 20$'dan satarsak, 80.000$ kazanacaksınız.

(Evet, bazı yazarlar Leanpub'da bundan çok daha fazlasını kazandılar.)

Gerçekte, yazarlar Leanpub'da yazarak, yayınlayarak ve satarak 14 milyon dolardan fazla kazandılar.

Leanpub'da yazmak hakkında daha fazla bilgi edinin

Ücretsiz Güncellemeler. DRM İçermez.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers), EPUB (for phones and tablets) and MOBI (for Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Leanpub'ın e-kitap formatları ve bunları nerede okuyabileceğiniz hakkında daha fazla bilgi edinin

Leanpub üzerinde Yazın ve Yayımlayın

Authors and publishers use Leanpub to publish amazing in-progress and completed ebooks, just like this one. You can use Leanpub to write, publish and sell your book as well! Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks. Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. It really is that easy.

Leanpub üzerinde nasıl yazabileceğinizi öğrenin