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

The Timeless Way of Building (MWRC)

The Timeless Way of Building (MWRC)

Mountain West Ruby Conference (March 2014) presentation

John Athayde

March 21, 2014
Tweet

More Decks by John Athayde

Other Decks in Programming

Transcript

  1. A design pattern systematically names, motivates, and explains a general

    design that addresses a recurring design problem in object-oriented systems. ! It describes the problem, the solution, when to apply the solution, and its consequences. ! It also gives implementation hints and examples. ! The solution is a general arrangement of objects and classes that solve the problem. The solution is customized and implemented to solve the problem in a particular context.
  2. “Design patterns help you identify less-obvious abstractions and the objects

    than can capture them. For example, objects that represent a process or algorithm don’t occur in nature, yet they are a crucial part of flexible designs.”
  3. “How can you distribute responsibility for design through all levels

    of a large hierarchy, while still maintaining consistency and harmony of overall design?” — M. J. Dominus 2002 ALEXANDER’S QUEST:
  4. DRY

  5. “Engineers frequently have to make decisions of great practical consequence

    in the face of incomplete and uncertain knowledge.” — Walter Vincenti ON ENGINEERS:
  6. D

  7. 2

  8. D

  9. class Customer < ActiveRecord::Base has_one :address has_one :account ! ...

    ! def state address.state end ! ... ! end ! @account.customer.state 2
  10. class RemoteProcess < ActiveRecord::Base scope :running, where(:state => ‘Running’) scope

    :system, where(:owner => [‘root’, ‘mysql’]) scope :sorted, order(“percent_cpy desc”) scope :top, lamda {|1| limit(1)} end ! RemoteProcess.running.sorted.top(10) RemoteProcess.running.system.sorted.top(5) sample from Rails Antipatterns pp 37 2
  11. “ design patterns are suggested approaches seen in the wild.

    - B R I A N H O G A N ” T H I S B E A R S R E P E A T I N G :
  12. “The best way to learn to write simple code is

    to write simple code! Patterns, like all forms of complexity, should be avoided until they are absolutely necessary. That’s the first thing beginners need to learn. Not the last thing. ” — Jeff Atwood c. 2005
  13. “ You cannot say that you are correctly applying a

    design pattern unless you are confronting the problem that the pattern is supposed to solve – R U S S O L S E N ”
  14. “...mediocre developers never even ask why. They just arrive at

    the first solution that works and keep plowing ahead.” — Jeff Atwood, c.2005
  15. “To many software-patterns folk the quality without a name doesn’t

    apply to things like software anyhow. I agree that most software —at least the software I see—doesn’t have such a quality, but does that mean it couldn’t? I find it odd, though, to take so much inspiration from the simple, mechanical parts of a person’s work—the form of the pattern language and terms like forces—but to ignore the heart of it. I’m not so sure the quality without a name is irrelevant.” — Richard P. Gabriel Patterns of Software, pp 71
  16. “Indeed this ageless character has nothing, in the end, to

    do with languages. The language, and the processes which stem from it, merely release the fundamental order which is native to us.” — The Timeless Way of Building, Chapter 27
  17. “They do not teach us, they only remind us of

    what we know already, and of what we shall discover time and time again, when we give up our opinions, and do exactly what emerges from ourselves.” — The Timeless Way of Building, Chapter 27
  18. “To make a building egoless, the builder must let go

    of all his willful images, and start with 
 a void. You are able to do this only when you no longer fear that nothing will happen, and you can therefore afford to let go of your images. At this stage, the building’s life will come directly from your language.” — The Timeless Way of Building, Chapter 27
  19. “Yet , at the very moment when you first relax,

    and let the language generate the buildings in your mind, you will begin to see how limited your language is. One place can have good patterns in it and be dead. Another place can be without the patterns which apply to it, and yet still be alive. ” — The Timeless Way of Building, Chapter 27
  20. “The pattern ALCOVE–which first functioned as an intellectual crutch–is no

    longer necessary to you. You see reality directly, like an animal. You make the alcove as an animal might make an alcove–not because of the concept– but directly, simply because it is appropriate.” — The Timeless Way of Building, Chapter 27