SlideShare a Scribd company logo
The many faces
of modularity
Eric Torreborre
The many faces of modularity
The many faces of modularity
The many faces of modularity
The many faces of modularity
Why do we care?
Reduce complexity!
Isolation
Understanding
Understanding
“Any organization that
designs a system will
produce a design whose
structure is a copy of the
organization's
communication structure.”
Conway’s law
The many faces of modularity
Reuse
Open-source
Foster creativity
Believe me?
The many faces of modularity
The many faces of modularity
Why is it so hard?
Denial
Functional programming?
The many faces of modularity
Not an island
Not all parameters are equal
}
dependencies!
There are modules anyway!
The many faces of modularity
Dependencies
High cohesion, low coupling
The butterfly effect
utils
What’s a dependency anyway?
car.engine.throttle.accelerate
vs
car.speedUp
The law of Demeter
Not a silver bullet
Lack of specifications
How modular is data?
Data is infectious
A better calendar
Extending is hard
Extending is hard
Mutable state, still
The other “assembly” language
A modularity language
A modularity language
A modularity language
A modularity language
A modularity language
Build tools
The many faces of modularity
Planned obsolescence
SOAP
The many faces of modularity
The many faces of modularity
Assumptions will break
Why is it so hard?
Denial
The butterfly effect Lack of specifications
A modularity language
Extending is hard
We keep changing the techno!
Mutable state, still
Data is infectious
Assumptions will break!
Where’s hope?
A short historyA short, incomplete historyA short, incomplete and imprecise history
1958
Lisp
1967
Simula
1960
ALGOL
1978
ADA
1983
C++
1977
Modula
1995
Java/Python/Ruby
1984
SML
1998
Haskell
Procedures 1960
Class Glyph;
Virtual: Procedure print Is Procedure print;;
Begin
End;
Glyph Class Char (c);
Character c;
Begin
Procedure print;
OutChar(c);
End;
Glyph Class Line (elements);
Ref (Glyph) Array elements;
Begin
Procedure print;
Begin
Integer i;
For i:= 1 Step 1 Until UpperBound (elements, 1)
Do elements (i).print;
OutImage;
End;
End;
End;
1967
Objects
1977
Modules
User data types 1978
1984
SML modules
The dark ages
Multiple inheritance
Single inheritance
Aspects
Enterprise Java Beans
Annotations
Monkey patching
Renaissance
The many faces of modularity
Control the dependencies, Luke!
Interface / implementation
Decomposition criteria
Think about domains!
Visualize dependencies
Have a librarian attitude
The many faces of modularity
Monad transformers, effects,
final tagless, ReaderT,
how different?
Monad transformers 1995
Inflexible stack!
2008
Algebraic effects
Types-heavy,
indirection,
Hard to rewire!
2009
“Tagless final”
“Tagless final”, really?
2009
“Tagless final”
Hierarchy of
instances!
2017
ReaderT pattern
ReaderT = low-level only
2017
ReaderT pattern
Low-level
dependencies only!
= it’s complicated
ReaderT
1. recursive expressions
2. dependencies = graph
3. call context
AsyncNon-det.Bracket
Recursive expressions
Encapsulation
Typeclasses
Effects
Wiring
Traits
Static / Dynamic
Manual
Macros
Implicits
Functions all
the way down!
My take on wiring
https://skillsmatter.com/skillscasts/12299-wire-once-rewire-twice
}
dependencies!
Separate building from use
Separate building from use
No tagless final
No MTL
No effects
No DI
Easy!Easy, buy it now!Not so fast :-)
Not so fast :-)
Reader pattern
where necessary
Wiring library
A good IO
type
Interfaces
My recommendation
The many faces of modularity
Use FP, Luke!
Imperative = non-modular
Functional = modular
With ACID transactions!
2018
Use the types, Luke!
Generics
Parametric polymorphism
Typeclasses
MimeUnrender MimeRender
Higher-kinded data
A look at the future
522 .c files
260000 LOC
811 conf. options
Variational typing
Modules research
Modules research
Weak vs Strong modularity
Small vs Large modularity
The many faces of modularity
Thank you!
The many faces
of modularity
Eric Torreborre

More Related Content

PPTX
Objects in the Cloud - Edition 2014
PDF
Type Safety in an Unsafe World With Kotlin
PDF
Beam me up, scotty (PUG Roma)
PDF
Let it crash! The Erlang Approach to Building Reliable Services
PPTX
DDD loves Actor Model and Actor Model loves Elixir
PPTX
S.O.L.I.D: Principles of OOP and Agile design
PDF
Fluent C: Principles, Practices, and Patterns 1st Edition Christopher Preschern
PDF
wire-all-the-things-lambda-days-2023.pdf
Objects in the Cloud - Edition 2014
Type Safety in an Unsafe World With Kotlin
Beam me up, scotty (PUG Roma)
Let it crash! The Erlang Approach to Building Reliable Services
DDD loves Actor Model and Actor Model loves Elixir
S.O.L.I.D: Principles of OOP and Agile design
Fluent C: Principles, Practices, and Patterns 1st Edition Christopher Preschern
wire-all-the-things-lambda-days-2023.pdf

Similar to The many faces of modularity (20)

KEY
LISP: How I Learned To Stop Worrying And Love Parantheses
PPTX
Object Oriented Technologies
PDF
L03 Software Design
PPTX
Object Oriented Programming
PPTX
Core idea driving and defining OO: using dynamic polymorphism to invert key a...
PDF
Download Complete The Rust Programming Language 2nd Edition Steve Klabnik PDF...
PPTX
07 java api and inheritance
PPT
PDF
JavaScript Design Patterns
PPT
Modern Compiler Design
PDF
DEF CON 27 - workshop - EIGENTOURIST - hacking with monads
PDF
What's My Modularity
PPT
designpatterns_blair_upe.ppt
PPTX
OOP, API Design and MVP
PDF
The Rust Programming Language Steve Klabnik
PPTX
Software Architecture Taxonomies - modularity
PPTX
The disaster of mutable state
PPT
Functional OOP, Clojure style
PDF
The Rust Programming Language 2nd Edition Steve Klabnik
PDF
Interview questions_mod.pdf
LISP: How I Learned To Stop Worrying And Love Parantheses
Object Oriented Technologies
L03 Software Design
Object Oriented Programming
Core idea driving and defining OO: using dynamic polymorphism to invert key a...
Download Complete The Rust Programming Language 2nd Edition Steve Klabnik PDF...
07 java api and inheritance
JavaScript Design Patterns
Modern Compiler Design
DEF CON 27 - workshop - EIGENTOURIST - hacking with monads
What's My Modularity
designpatterns_blair_upe.ppt
OOP, API Design and MVP
The Rust Programming Language Steve Klabnik
Software Architecture Taxonomies - modularity
The disaster of mutable state
Functional OOP, Clojure style
The Rust Programming Language 2nd Edition Steve Klabnik
Interview questions_mod.pdf
Ad

More from Eric Torreborre (20)

PDF
Shoehorning dependency injection into a FP language
PDF
Shoehorning dependency injection into a FP language, what does it take?
PDF
Boost your command line applications with potions!
PDF
What haskell taught us when we were not looking
PDF
Wire once, rewire twice! (Haskell exchange-2018)
PDF
Pratical eff-functional-conf
PDF
Specs2, from starters to dessert and... a look in the kitchen
PDF
Streaming, effects and beautiful folds: a winning trilogy
PPTX
Pratical eff-scalaitaly-2017
PDF
Pratical eff monad at Scaladays Chicago
PDF
Pratical eff
PPT
The Eff monad, one monad to rule them all
PPT
Easy di-slideshare
PPT
Data generation, the hard parts
PPT
Origami, a monadic fold library for Scala
PPT
Datatypes for the real world
PPT
Specs2 3.4
PPTX
DSLs with fold algebras
PPT
Specs2 whirlwind tour at Scaladays 2014
PPT
Epic success \/ failure, refactoring to *real* FP
Shoehorning dependency injection into a FP language
Shoehorning dependency injection into a FP language, what does it take?
Boost your command line applications with potions!
What haskell taught us when we were not looking
Wire once, rewire twice! (Haskell exchange-2018)
Pratical eff-functional-conf
Specs2, from starters to dessert and... a look in the kitchen
Streaming, effects and beautiful folds: a winning trilogy
Pratical eff-scalaitaly-2017
Pratical eff monad at Scaladays Chicago
Pratical eff
The Eff monad, one monad to rule them all
Easy di-slideshare
Data generation, the hard parts
Origami, a monadic fold library for Scala
Datatypes for the real world
Specs2 3.4
DSLs with fold algebras
Specs2 whirlwind tour at Scaladays 2014
Epic success \/ failure, refactoring to *real* FP
Ad

Recently uploaded (20)

PDF
August Patch Tuesday
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
cloud_computing_Infrastucture_as_cloud_p
PDF
Accuracy of neural networks in brain wave diagnosis of schizophrenia
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Encapsulation theory and applications.pdf
PDF
A comparative study of natural language inference in Swahili using monolingua...
PPT
Teaching material agriculture food technology
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
OMC Textile Division Presentation 2021.pptx
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Heart disease approach using modified random forest and particle swarm optimi...
PPTX
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
Tartificialntelligence_presentation.pptx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
August Patch Tuesday
Group 1 Presentation -Planning and Decision Making .pptx
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
cloud_computing_Infrastucture_as_cloud_p
Accuracy of neural networks in brain wave diagnosis of schizophrenia
Advanced methodologies resolving dimensionality complications for autism neur...
Encapsulation theory and applications.pdf
A comparative study of natural language inference in Swahili using monolingua...
Teaching material agriculture food technology
NewMind AI Weekly Chronicles - August'25-Week II
Digital-Transformation-Roadmap-for-Companies.pptx
OMC Textile Division Presentation 2021.pptx
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
Heart disease approach using modified random forest and particle swarm optimi...
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
Network Security Unit 5.pdf for BCA BBA.
Tartificialntelligence_presentation.pptx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Reach Out and Touch Someone: Haptics and Empathic Computing

The many faces of modularity