This week we talk through simplicity in controllers and models and time as a design consideration. Tip 40: Design Using Services Tip 41: Always Design for Concurrency Tip 42: Separate Views from Models Tip 43: Use Blackboards to Coordinate Workflow
A weekly podcast about programming, development, and design through the lens of amazing books, chapter-by-chapter.
The view is an interpretation of the model. It doesn't need to be graphical. The controller is more of a coordination mechanism, and doesn't have to be related to any sort of input device.
JP: Use blackboards to coordinate disparate facts and agents, while maintaining independence and isolation among participants
John: The blackboard style of programming removes the need for so many interfaces, making for a more elegant and consistent system.
John: "Feed" concept
Seriously... just look how cool this is.
defmodule MyList do
def flatten([ [sub_head | sub_tail] | tail]) do
flatten(sub_head) ++ flatten(sub_tail) ++ flatten(tail)
end
def flatten([ head | tail]) do
flatten(head) ++ flatten(tail)
end
def flatten([]), do: []
def flatten(head), do: [head]
end
IO.inspect MyList.flatten [ 1, [ 2, 3, [ 4 ] ], 5, [ [ [ [ 6 ] ] ] ] ]
# [1, 2, 3, 4, 5, 6]