Pattern Language for Rubyists (Rev.2)

What is the difference between experts and beginners? How can we describe our important knowledge? This presentation introduces the pattern language and its relation to software development, then shows an example activity.

And each law of pattern is itself a pattern of relationships among still other laws, which are themselves just patterns of relationships again. –Christopher Alexander, “The Timeless Way of Building”

–Christopher Alexander, “A City is not a Tree”

From a mathematical point of view, the simplest kind of language is a system which contains two sets: 1. A set of elements, or symbols. 2. A set of rules for combining these symbols. –Christopher Alexander, “The Timeless Way of Building”

Each pattern is a rule which describes what you have to do to generate the entity which it defines. –Christopher Alexander, “The Timeless Way of Building”

Picture by Liz Castro

The specific patterns out of which a building a town is made may be alive or dead. To the extent they are alive, they let our inner forces loose, and set us free; but when they are dead they keep us locked in inner conflict. –Christopher Alexander, “The Timeless Way of Building”

You can use it to design a house for yourself, with your family; or to work with other people to design an office or a workshop or a public building like a school. –Christopher Alexander et al, “A Pattern Language”

A Small Pattern Language for GUI 1. Window Per Task 2. Few Panes Per Window 3. Standard Panes 4. Short Menus 5. Nouns and Verbs

“We presented these patterns to a team of application specialists writing a specification for a special purpose programming environment. Without detailed understanding of any of Smalltalk's interface mechanisms (MVC for example) they were able to specify very reasonable interfaces after one day of practice.” –Kent Beck, Ward Cunningham, “Using Pattern Languages for Object-Oriented Programs”

Do you have a pattern language in your mind?

We have written this book as a first step in the society-wide process by which people will gradually become conscious of their own pattern languages, and work to improve them. –Christopher Alexander et al, “A Pattern Language”

How we found Rails dev. patterns 1. Kick off meeting 2. Discuss development knacks (pristine “patlets”) 3. Group patlets in KJ-method 4. Rewrite the groups in pattern form 5. Find sequence of patterns (WIP) 6. Refine the patterns (WIP)

Rails Development Patterns 18 patlets / 6 patterns in form Reviewed at AsianPLoP 2015 Work in progress on GitHub (rails-patterns/rails_dev_patterns)

“公式情報” (Official Information) Context: You are going to use a new or unfamiliar feature of Rails. Problem: You may copy and paste misinformation from the web. Solution: Refer the official Rails guide or the API reference.

“公然のSQL” (Not-so-Secret SQL) Context: You are going to use an ActiveRecord to make a database query. Problem: You may make ineffective, wasteful queries. Solution: Confirm what SQL the ActiveRecord generates.

Do you have a pattern language in your mind?

We have written this book as a first step in the society-wide process by which people will gradually become conscious of their own pattern languages, and work to improve them. –Christopher Alexander et al, “A Pattern Language”