Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Victims of Complexity

Bozhidar Batsov
June 08, 2021
260

Victims of Complexity

Originally presented on June 5th 2021, at ClojureD.

Bozhidar Batsov

June 08, 2021
Tweet

Transcript

  1. VICTIMS OF COMPLEXITY
    BOZHIDAR BATSOV

    View full-size slide

  2. (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

    View full-size slide

  3. NO CLOJURE CONFERENCES SINCE
    FEBRUARY 2020

    View full-size slide

  4. THAT MAKES ME
    VERY SAD

    View full-size slide

  5. ALWAYS LOOK ON THE BRIGHT SIDE OF LIFE

    View full-size slide

  6. LOCAL TOURISM

    View full-size slide

  7. I’VE BUILT A DESKTOP PC AND SWITCHED TO LINUX

    View full-size slide

  8. AND THEN TO WINDOWS…

    View full-size slide

  9. THIS PRESENTATION WAS CREATED IN POWERPOINT!

    View full-size slide

  10. CLOJURED 2017 AND ONE EPIC POWERPOINT FIASCO

    View full-size slide

  11. I LOVE WINDOWS!

    View full-size slide

  12. WHAT ABOUT CIDER?

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  15. 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

    View full-size slide

  16. 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

    View full-size slide

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

    View full-size slide

  18. BETTER USER EXPERIENCE,
    LESS HASSLE

    View full-size slide

  19. A FEW QUIET
    MONTHS

    View full-size slide

  20. CIDER 1.0 (DECEMBER 2020)
     Small improvements

    View full-size slide

  21. CIDER 1.1 (APRIL 2021)
     Small improvements

    View full-size slide

  22. LESS IS MORE

    View full-size slide

  23. VICTIMS OF COMPLEXITY
    BOZHIDAR BATSOV

    View full-size slide

  24. SIMPLE MADE EASY

    View full-size slide

  25. OUT OF THE TAR PIT

    View full-size slide

  26. THE
    GROUNDHOG
    DAY
    DEVELOPMENT
    METHOD
    (GDDM)

    View full-size slide

  27. CONNECTION
    MANAGEMENT IN
    CIDER

    View full-size slide

  28. 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)

    View full-size slide

  29. 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

    View full-size slide

  30. 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

    View full-size slide

  31. 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

    View full-size slide

  32. 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

    View full-size slide

  33. LET’S SOLVE
    THIS PROBLEM
    WITH REGULAR
    EXPRESSIONS…

    View full-size slide

  34. WELL-DOCUMENTED
    COMPLEX CODE IS STILL
    COMPLEX

    View full-size slide

  35. NO FEATURES, NO PROBLEMS

    View full-size slide

  36. IS ALL COMPLEXITY THE SAME?

    View full-size slide

  37. INHERENT/ESSENTIAL COMPLEXITY
    VS
    ACCIDENTAL COMPLEXITY

    View full-size slide

  38. CORE COMPLEXITY
    VS
    PERIPHERAL COMPLEXITY

    View full-size slide

  39. VERTICAL COMPLEXITY
    VS
    HORIZONTAL COMPLEXITY

    View full-size slide

  40. 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

    View full-size slide

  41. 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

    View full-size slide

  42. CORE COMPLEXITY
    ==
    HARDER TO COMPREHEND/CHANGE

    View full-size slide

  43. PERIPHERAL COMPLEXITY
    ==
    HARDER TO LEARN

    View full-size slide

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

    View full-size slide

  45. THE
    GROUNDHOG
    DAY
    DEVELOPMENT
    METHOD
    (GDDM)

    View full-size slide

  46. 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

    View full-size slide

  47. 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

    View full-size slide

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

    View full-size slide

  49. COMPLEXITY IS A CHOICE

    View full-size slide

  50. SIMPLICITY IS A CHOICE

    View full-size slide

  51. KEEP IT SIMPLE

    View full-size slide

  52. 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?

    View full-size slide

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

    View full-size slide

  54. START WITH NO

    View full-size slide

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

    View full-size slide

  56. BIAS FOR ACTION

    View full-size slide

  57. BIAS FOR INACTION

    View full-size slide