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

Dysfunctional Programming (phpnw13)

Dysfunctional Programming (phpnw13)

Igor Wiedler

October 05, 2013

More Decks by Igor Wiedler

Other Decks in Programming


  1. Immuteability: The property of functional programmers that prevents them from

    shutting up about pure functional programming. – Reg Braithwaite @raganwald
  2. $numberCollection = new NumberCollection(); $numberParser = new SimpleNumberStringParser(); $firstParsedNumber =

    $numberParser->parse('1'); $firstNumber = new SimpleNumber($firstParsedNumber); $firstNumberProxy = new CollectionItemNumberProxy($firstNumber); $numberCollection->add($firstNumberProxy); $secondParsedNumber = $numberParser->parse('1'); $secondNumber = new SimpleNumber($secondParsedNumber); $secondNumberProxy = new CollectionItemNumberProxy($secondNumber); $numberCollection->add($secondNumberProxy); $addition = new AdditionOperator('SimplePHPEasyPlus\Number\SimpleNumber'); $operation = new ArithmeticOperation($addition); $engine = new Engine($operation); $calcul = new Calcul($engine, $numberCollection); $runner = new CalculRunner(); $runner->run($calcul); $result = $calcul->getResult(); $numericResult = $result->getValue();
  3. Inversion of control is really just a pretentious way of

    saying “Taking an argument”. – Rúnar Óli @runarorama
  4. Number 42 String "Hello, cruel world." Map {:foo "bar", :baz

    "qux"} List [:a :b :c] Set #{"Arthur Dent" "Ford Prefect"}
  5. Git

  6. A foo foo foo foo B foo foo C foo

    foo D foo foo E foo foo
  7. References • The Paradigms of Programming by Robert W. Floyd

    • Execution in the Kingdom of Nouns by Steve Yegge • The Value of Values by Rich Hickey • Are we there yet? by Rich Hickey