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

Victims of Complexity

Bozhidar Batsov
June 08, 2021
250

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 Slide

  2. HEY, THERE!

    View Slide

  3. (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 Slide

  4. 2020

    View Slide

  5. 2021

    View Slide

  6. NO CLOJURE CONFERENCES SINCE
    FEBRUARY 2020

    View Slide

  7. THAT MAKES ME
    VERY SAD

    View Slide

  8. ALWAYS LOOK ON THE BRIGHT SIDE OF LIFE

    View Slide

  9. LOCAL TOURISM

    View Slide

  10. WEDDING

    View Slide

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

    View Slide

  12. AND THEN TO WINDOWS…

    View Slide

  13. THIS PRESENTATION WAS CREATED IN POWERPOINT!

    View Slide

  14. CLOJURED 2017 AND ONE EPIC POWERPOINT FIASCO

    View Slide

  15. I LOVE WINDOWS!

    View Slide

  16. View Slide

  17. View Slide

  18. WHAT ABOUT CIDER?

    View Slide

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

    View Slide

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

    View Slide

  21. 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 Slide

  22. 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 Slide

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

    View Slide

  24. BETTER USER EXPERIENCE,
    LESS HASSLE

    View Slide

  25. A FEW QUIET
    MONTHS

    View Slide

  26. CIDER 1.0 (DECEMBER 2020)
     Small improvements

    View Slide

  27. CIDER 1.1 (APRIL 2021)
     Small improvements

    View Slide

  28. LESS IS MORE

    View Slide

  29. VICTIMS OF COMPLEXITY
    BOZHIDAR BATSOV

    View Slide

  30. SIMPLE MADE EASY

    View Slide

  31. OUT OF THE TAR PIT

    View Slide

  32. THE
    GROUNDHOG
    DAY
    DEVELOPMENT
    METHOD
    (GDDM)

    View Slide

  33. View Slide

  34. CONNECTION
    MANAGEMENT IN
    CIDER

    View Slide

  35. View Slide

  36. 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 Slide

  37. 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 Slide

  38. 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 Slide

  39. 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 Slide

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

  41. View Slide

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

    View Slide

  43. View Slide

  44. WELL-DOCUMENTED
    COMPLEX CODE IS STILL
    COMPLEX

    View Slide

  45. NO FEATURES, NO PROBLEMS

    View Slide

  46. IS ALL COMPLEXITY THE SAME?

    View Slide

  47. INHERENT/ESSENTIAL COMPLEXITY
    VS
    ACCIDENTAL COMPLEXITY

    View Slide

  48. CORE COMPLEXITY
    VS
    PERIPHERAL COMPLEXITY

    View Slide

  49. VERTICAL COMPLEXITY
    VS
    HORIZONTAL COMPLEXITY

    View Slide

  50. 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 Slide

  51. 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 Slide

  52. View Slide

  53. View Slide

  54. CORE COMPLEXITY
    ==
    HARDER TO COMPREHEND/CHANGE

    View Slide

  55. PERIPHERAL COMPLEXITY
    ==
    HARDER TO LEARN

    View Slide

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

    View Slide

  57. THE
    GROUNDHOG
    DAY
    DEVELOPMENT
    METHOD
    (GDDM)

    View Slide

  58. 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 Slide

  59. 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 Slide

  60. “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 Slide

  61. COMPLEXITY IS A CHOICE

    View Slide

  62. SIMPLICITY IS A CHOICE

    View Slide

  63. KEEP IT SIMPLE

    View Slide

  64. 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 Slide

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

    View Slide

  66. View Slide

  67. START WITH NO

    View Slide

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

    View Slide

  69. BIAS FOR ACTION

    View Slide

  70. BIAS FOR INACTION

    View Slide

  71. View Slide

  72. THE END

    View Slide