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

How to Make a Spaghetti

How to Make a Spaghetti

How to make your software simple.

さっちゃん

January 11, 2019
Tweet

More Decks by さっちゃん

Other Decks in Programming

Transcript

  1. Take dry spaghetti from refrigerator. Take salt from refrigerator. Take

    water from refrigerator. Put dry spaghetti into pot. Put salt into pot. Boil until good. Marco Verch "Ungekochte Spaghetti mit Bastschnur gebunden vor weißem Hintergrund" 2018-12-04 CC by 2.0 https://flic.kr/p/Rwmq6G Rebecca Siegel "Clothbound Cheddar - Cheese salt" 2010-07-11 CC by 2.0 https://flic.kr/p/8im1Cb
  2. cf. Rich Hickey "Simple Made Easy" 2011-09 https://github.com/matthiasn/talk-transcripts/blob/master/Hickey_Rich/SimpleMadeEasy.md エリック・エヴァンス "エリック・エヴァンスのドメイン駆動設計

    " https://www.amazon.co.jp/dp/4798121967 スコット W アンブラー, ピラモド・サダラージ "データベース・リファクタリング " https://www.amazon.co.jp/dp/4894715007 クリストファー・アレグザンダー "パタン・ランゲージ ―環境設計の手引 " https://www.amazon.co.jp/dp/4306041719 ジル・ドゥルーズ "襞:ライプニッツとバロック " https://www.amazon.co.jp/dp/4309247199
  3. Software source code often may be complicated. We want to

    our software be simple. What is simple ?
  4. simple → sim-plek sim : one (一つ) plek : to

    plate (編む) Online Etymology Dictionary https://www.etymonline.com/
  5. OK, we know “what is simple? (Simpleとは何か?)”. But we don’t

    know Is this simple ? / How to make it simple ? (何がsimpleか?)
  6. We can’t decide that an isolated thing is simple or

    not. We need a system that contains the thing.
  7. We can’t decide that an isolated thing is simple or

    not. We need a system that contains the thing.
  8. We can’t decide that an isolated thing is simple or

    not. We need a system that contains the thing.
  9. Human doesn't know the actual concept of the code. (Only

    computers know.) Don’t accumulate diff + diff + … Simple abstraction reduces diffs. diff (Function) Actual concept Human concept
  10. Spaghetti code comes from spaghetti data. Example : Data Complect

    Temporal field {:x 42 :tmp nil} x & tmp Multi purpose field {:for_a_or_for_b a} a & b Extensible tuple [a b nil] Order & meaning Extensible function arguments [a b nil] -> c Order & meaning
  11. Design simple data & compose them. (do-something {:x x :tmp

    tmp}) ↓ (with-tmp do-something tmp {:x x})
  12. Design simple data & compose them. (if (= “dev” env)

    (do-as-dev) (do-as-prod)) ↓ Use extensible effect.