Slide 1

Slide 1 text

VICTIMS OF COMPLEXITY BOZHIDAR BATSOV

Slide 2

Slide 2 text

HEY, THERE!

Slide 3

Slide 3 text

(ABOUT-BUG)  Bozhidar (Божидар) a.k.a. Bug  Devoted to Emacs  Author of CIDER, maintainer of nREPL, blah, blah, blah  @bbatsov  bozhidar on the Clojurians Slack (#cider/#nrepl)  @bozhidarb on Reddit (long story)  metaredux.com  emacsredux.com

Slide 4

Slide 4 text

2020

Slide 5

Slide 5 text

2021

Slide 6

Slide 6 text

NO CLOJURE CONFERENCES SINCE FEBRUARY 2020

Slide 7

Slide 7 text

THAT MAKES ME VERY SAD

Slide 8

Slide 8 text

ALWAYS LOOK ON THE BRIGHT SIDE OF LIFE

Slide 9

Slide 9 text

LOCAL TOURISM

Slide 10

Slide 10 text

WEDDING

Slide 11

Slide 11 text

I’VE BUILT A DESKTOP PC AND SWITCHED TO LINUX

Slide 12

Slide 12 text

AND THEN TO WINDOWS…

Slide 13

Slide 13 text

THIS PRESENTATION WAS CREATED IN POWERPOINT!

Slide 14

Slide 14 text

CLOJURED 2017 AND ONE EPIC POWERPOINT FIASCO

Slide 15

Slide 15 text

I LOVE WINDOWS!

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

No content

Slide 18

Slide 18 text

WHAT ABOUT CIDER?

Slide 19

Slide 19 text

CIDER 0.24 (FEBRUARY 2020, IN/CLOJURE)  Small improvements

Slide 20

Slide 20 text

CIDER 0.25 (JUNE 2020, CLOJURISTS TOGETHER)  Small improvements

Slide 21

Slide 21 text

CIDER 0.26 (AUGUST 2020, CLOJURISTS TOGETHER)  Support for nREPL 0.8  Code completion  Symbol lookup  First class support for Babashka  Basic support for sideloading (functionality added in nREPL 0.7)  Smarter handling of ClojureDocs data (no downloads the first time you try to use it or automatic data updates)  Auto-trimming of REPL buffers (disabled by default)  Small improvements

Slide 22

Slide 22 text

NREPL 0.7  Native EDN transport (an alternative to the default Bencode transport)  Added the ability to sideload Clojure libraries into a running nREPL server  Now clients can inject the libraries they need without the need for additional manual setup

Slide 23

Slide 23 text

NREPL 0.8  Built-in completion op  Built-in lookup up  Added the ability to load middleware dynamically

Slide 24

Slide 24 text

BETTER USER EXPERIENCE, LESS HASSLE

Slide 25

Slide 25 text

A FEW QUIET MONTHS

Slide 26

Slide 26 text

CIDER 1.0 (DECEMBER 2020)  Small improvements

Slide 27

Slide 27 text

CIDER 1.1 (APRIL 2021)  Small improvements

Slide 28

Slide 28 text

LESS IS MORE

Slide 29

Slide 29 text

VICTIMS OF COMPLEXITY BOZHIDAR BATSOV

Slide 30

Slide 30 text

SIMPLE MADE EASY

Slide 31

Slide 31 text

OUT OF THE TAR PIT

Slide 32

Slide 32 text

THE GROUNDHOG DAY DEVELOPMENT METHOD (GDDM)

Slide 33

Slide 33 text

No content

Slide 34

Slide 34 text

CONNECTION MANAGEMENT IN CIDER

Slide 35

Slide 35 text

No content

Slide 36

Slide 36 text

A SINGLE CONNECTION  Ultimate simplicity  No configuration  No ambiguity  No flexibility  You can’t work on multiple projects  You can’t work easily on a ClojureScript project (typically people use two connections for those)

Slide 37

Slide 37 text

MULTIPLE CONNECTIONS, STATIC DISPATCH  Very simple  No configuration  No ambiguity  Only one extra command to mark the “current” connection  Some flexibility  You can work on multiple projects  You get to decide which connection to use when

Slide 38

Slide 38 text

MULTIPLE CONNECTIONS, DYNAMIC DISPATCH  Quite complex  It’s not always clear which connection to use (e.g. you can have connections without project or two connections to the same project)  Grouping Clojure and ClojureScript connections together and deciding what to do about things like `cljc` files  Lots of flexibility  You can work on multiple projects  All sorts of workflows are supported out of the box

Slide 39

Slide 39 text

SESSIONS, TAKE ONE  Quite complex, but supposedly less complex than before  Operate on groups of related connections (sessions) instead of connections  Lots of flexibility  You can work on multiple projects  All sorts of workflows are supported out of the box

Slide 40

Slide 40 text

SESSIONS, TAKE TWO (SESMAN)  Quiet complex  Same as before, but now it’s a generic library for session management in Emacs  Session management becomes a third-party library  Less flexibility  You can work on multiple projects  Some workflows get broken, as we now have a more rigid session mapping mechanism

Slide 41

Slide 41 text

No content

Slide 42

Slide 42 text

LET’S SOLVE THIS PROBLEM WITH REGULAR EXPRESSIONS…

Slide 43

Slide 43 text

No content

Slide 44

Slide 44 text

WELL-DOCUMENTED COMPLEX CODE IS STILL COMPLEX

Slide 45

Slide 45 text

NO FEATURES, NO PROBLEMS

Slide 46

Slide 46 text

IS ALL COMPLEXITY THE SAME?

Slide 47

Slide 47 text

INHERENT/ESSENTIAL COMPLEXITY VS ACCIDENTAL COMPLEXITY

Slide 48

Slide 48 text

CORE COMPLEXITY VS PERIPHERAL COMPLEXITY

Slide 49

Slide 49 text

VERTICAL COMPLEXITY VS HORIZONTAL COMPLEXITY

Slide 50

Slide 50 text

CORE COMPLEXITY  Complexity that touches many parts of part of the codebase  Connection management in CIDER  The choice of a REPL server  Request processing API  Choice of data structures  It’s rarely the same as inherent complexity (which is often rooted in the business domain)  It’s the complexity that’s hardest/most expensive to undo

Slide 51

Slide 51 text

PERIPHERAL COMPLEXITY  Complexity that’s orthogonal to the core functionality  Configuration options  Things built on the top of the core APIs  Variations of core commands and APIs  The stuff that’s nice to have, but you didn’t really need  Easy to undo, as it’s typically not coupled with anything important

Slide 52

Slide 52 text

No content

Slide 53

Slide 53 text

No content

Slide 54

Slide 54 text

CORE COMPLEXITY == HARDER TO COMPREHEND/CHANGE

Slide 55

Slide 55 text

PERIPHERAL COMPLEXITY == HARDER TO LEARN

Slide 56

Slide 56 text

THE CORE COMPLEXITY IS THE SCARIER ONE, BUT YOU HAVE TO BE WARY OF BOTH

Slide 57

Slide 57 text

THE GROUNDHOG DAY DEVELOPMENT METHOD (GDDM)

Slide 58

Slide 58 text

INF-CLOJURE – A CASE STUDY OF SIMPLICITY  No external deps  Very basic functionality  All implemented in terms of evaluating Clojure code and processing the raw result  Few configuration options  Works everywhere

Slide 59

Slide 59 text

MONROE – BACK TO THE BASICS  Fork of CIDER predating the birth of cider-nrepl and the modern connection management  Dropped the notion of dedicated buffers for things like documentation, macroexpansion, results, etc  Not coupled with Clojure as strongly as CIDER  Convenience/flexibility vs simplicity

Slide 60

Slide 60 text

“PERFECTION IS ACHIEVED, NOT WHEN THERE IS NOTHING MORE TO ADD, BUT WHEN THERE IS NOTHING LEFT TO TAKE AWAY.” -- ANTOINE DE SAINT-EXUPERY

Slide 61

Slide 61 text

COMPLEXITY IS A CHOICE

Slide 62

Slide 62 text

SIMPLICITY IS A CHOICE

Slide 63

Slide 63 text

KEEP IT SIMPLE

Slide 64

Slide 64 text

THE CHECKLIST  How much complexity does feature X add?  What type of complexity is this?  How big of an (positive) impact it would make?  Do I want to develop it? Can I develop it (properly)?  Does anyone want to develop it?  Do I want to maintain this?  Can I maintain this?

Slide 65

Slide 65 text

Do I really need this feature? A problem that solves Itself! Yes! Have I thought this through? Not really.

Slide 66

Slide 66 text

No content

Slide 67

Slide 67 text

START WITH NO

Slide 68

Slide 68 text

THE FACT THAT SOMETHING SEEMS LIKE A GOOD IDEA DOESN’T NECESSARILY MAKE IT A GOOD IDEA

Slide 69

Slide 69 text

BIAS FOR ACTION

Slide 70

Slide 70 text

BIAS FOR INACTION

Slide 71

Slide 71 text

No content

Slide 72

Slide 72 text

THE END