Showing posts with label notes. Show all posts
Showing posts with label notes. Show all posts

Saturday, May 19, 2012

Notes on "Your Brain at Work"

I just finished reading Your Brain at Work by David Rock and it is really good. If you haven't read it I can highly recommend it. Since I think it is so full of good ideas, I decided I wanted to write down my understanding of it while it is fresh. I also recently finished reading Blah, Blah, Blah by Dan Roam and I'm going to use his Vivid style in this text.

The Prefrontal Cortex

Our consciousness is located in an area of the brain called the Prefrontal Cortex (PFC).

The Prefrontal Cortex main responsibilities are: recalling, memorizing, understanding, deciding, and inhibiting.

Recalling, getting information from long term memory into the PFC.

Memorizing, storing information from the PFC into long term memory.

Understanding, connecting new information to the information already stored inside our brain.

Deciding, comparing two or more different items and deciding which one is most suitable.

Inhibiting, preventing information from other parts of our brain and outside interferences from entering the PFC.

Attention is Limited

Paying attention consumes energy and the brain has limited resources available. The more ideas we try to hold in our head at once the less attention we can pay to each of them.

One especially energy consuming task is prioritizing, since it involves most of the ideas that the PFC has to do. In order to be able to prioritize well, we should do this when our minds are fresh. We need to prioritize prioritizing!

In the sixties George A. Milner, experimented with consciousness and came up with the idea that we are only able to hold 7±2 items in attention at once.

The problem with this is that he probably overestimated our abilities. It is more likely that the number is less than four, and the less the better.

Preserve Resources

The more information we can get our of our PFC, the better we will be able to focus on what is in it. Good ways to get things out of our PFC are: write them down or draw them. Visuals are especially good since our brain is very good at dealing with visual information and consumes less resources when dealing with visuals.

Another important task to do to preserve resources is to inhibit low prioritized thoughts. Write them down so that they don't consume your resources any more. Tasks that are not well-defined consume a lot more energy than they are worth.

When comparing items, the less items you need to compare the better. The optimal number of items to compare is two. And, it is important to get the ideas out of your head and onto paper, so that you don't have to try to remember the other things while you are debating the merits of one.

New ideas consume more energy than old, since old ideas are just references into long-term memory.

Two techniques for limiting the amount of information you hold in you PFC are chunking and simplification.

Chunking means grouping information into one chunk. It is easier to remember 1978 than to remember 1, 9, 7, 8.

Simplification is a way of ignoring the complexity of something by just labeling it.

Multi-Tasking

Armed with this information it is easy to see that multi-tasking is a very bad idea. Dual-task interference happens when we try to do two or more things simultaneously. When this happens we loose precision. If accuracy is important don't divide your attention.

If you do need to multi-task, here are some techniques that helps.

  • Order things and only work from the front of the queue.
  • Explicitly suspend-resume. Do one thing, stop, do another thing, stop, etc. It is a good idea to let others know that you are switching between tasks to let them know when you are paying attention or not.
  • Automate it! This means learn it well enough so that you can do it without thinking consciously. More about this in my blog, Rationality is Overrated

Distractions

The brain is easily distracted. It has survived thousands of years by reacting to "a rustle in the bushes".

In our modern world similar, external, distractions come in the form of mobile phones, email, twitter, colleagues, friends, family, etc.

Avoiding distractions, inhibition, consumes energy, so, it is best to not let the distractions distract you in the first place.

Along with external distractions we also have internal distractions, impulses. It is not as easy to turn off the internal distractions. To do this we need to practice self-control. But self-control is also a limited resource. When you have resisted one impulse, it gets harder to resist the next.

Internal distractions are often triggered when we are thinking of ourselves. We can reduce the likelihood of internal distractions by clearing our mind before we set out on a new task.

We can improve our mental breaking system by practicing, and re-enforce it by doing something physical along with the mental braking.

Getting Stuck

Getting stuck on a problem is called an impasse. To resolve an impasse, we need to let the brain idle. This gives the unconscious part of the brain a chance to solve the problem.

To have insights involves hearing subtle signals and making loose connections. This requires a quiet mind with minimal electrical activity.

Insights occur more frequently when you are relaxed and happy. Take a break, do something interesting. Focus on connections between information instead of details. Simplify problems into a very high-level description.

The Networks of the Brain

In the brain we have two main networks: the narrative network and the direct experience network.

The Narrative Network is the default network when nothing is happening. It keeps a conversation going in the mind. It makes assumptions and figures out plans from them. It is very sequential in the way it works. If I think of this, then this, then this, then this, etc., etc., etc. By just tuning in to this network, we make us very busy indeed. All the time. When we receive information through this network, it is filtered, and interpreted before we can do anything about it.

The Direct Experience Network is our other main network. It is triggered when we let the brain idle, and just "listen" to what our senses tells us. This is often called mindfulness. This network is not sequential like the narrative is. It is immediate and it makes use of the full processing power of the brain and not just the pre-frontal cortex. The sensory information that is received through direct experience include information about the self, about thoughts, feelings, emotions, and internal states.

When we need to get unstuck or unstressed, it is very wise to try to shift over to direct experience. This can be done by focusing on sensory information, such as how the chair feels on our buttocks, how the wind feels on our cheeks, or listening to the sound of birds singing or our own breath. This simple act will allow the brain to get unstuck of its previous ideas. The act is actually not that simple, it is not easy to focus on one thing for more than a few seconds.

Mindfulness

A part of working memory called the executive function "sits above" the other functions monitoring our thinking, choosing how to best allocate resources. Mindfulness is about living in the present and it gives us "the ability to pause before we react." When you are being mindful you are also noticing information about yourself.

When you notice that you are not doing what you should, you are being mindful. You are noticing information about how and what you are thinking. You are noticing inner signals.

"Mindfulness isn't hard, the hard part is to remember to be mindful." -- John Teasdale

Practice, you can be mindful anywhere and with anything.

"The unexamined life is not worth living" --Socrates

Danger and Rewards

The brain tries to minimize danger (away response), and maximize rewards (toward response).

The away response is stronger, faster and longer lasting than the toward response. The away response can reduce cognitive resources, making it harder to think about thinking, making you more defensive and mistakenly classify situations as threats. Trying to suppress an emotion often makes it worse and often makes other people feel uncomfortable.

Labeling an emotion, giving it a name, often reduces the emotion. The label needs to be symbolic, short and succinct.

Reappraisal

Reappraisal is a powerful method for managing increased arousal. It means that you evaluate a situation and see it from a different perspective than you first do. Four forms of reappraisal are: reinterpreting, normalizing, reordering, and repositioning.

Reinterpreting is something we do every day. When we are late for an airplane, we feel worried and hurry our steps, to avoid missing the plane. When we can see the gate and the people waiting for the plane, we automatically reinterpret the situation since we see that we have plenty of time. Nothing has changed, except our interpretation of the situation.

An example of normalization, is when we are at a new job, we may feel worried, since everything is new to us. It is easy to overreact to trivialities that otherwise wouldn't bother us. Normalization is when someone tells you, or you figure it out for yourself, that it is normal to feel worried at a new job. Everybody feels worried, it is normal! We immediately calm down. Nothing, again, has changed, except our interpretation of the situation

Reordering is a larger form of reappraisal. It involves changing the way we prioritize what is valuable to us. If we value two things, such as autonomy and responsibility, they may come in conflict. An example would be working as a member of a team where you are allowed to make independent decisions about how to do your work, allowing you to feel in control of the situation. When you are suddenly offered the job as team lead, you will lose control of the situation, since other people will be responsible for doing the work that you used to do. Your autonomy has decreased since you have to rely on other people to get the work done. You have to reappraise the situation, reorder your priorities, in order to be comfortable with this new situation.

The last form of reappraisal, repositioning, involves putting yourself in someone else's position. In order to understand why they are reacting the way they do. If someone thinks all your ideas are worthless, they obviously don't see the world the way you do. In order to understand why they feel the way they do, you have to try to put yourself in their shoes.

Perhaps they have tried the ideas, you are suggesting, and failed previously. The reason they don't want to you to try it may be in the best interest of everyone; they don't want the project to fail or, it may be simple jealousy; they don't want you to succeed with what they failed with before.

I does not matter what the reason is. By putting yourself in their position you will be in a better position to deal with the arguments when they come.

If you find it dishonest to change your view of the world, you must remember that:

"All the brain can know, it knows from inside itself." --Walter Freeman

If you recognize that all interpretations of the world are just that, interpretations your brain has made, then, having a choice about which interpretation to choose at any moment makes more sense.

People who reappraise more tend to live happier lives. One way to reappraise a situation is to think "It's not me, it's my brain!"

It is also worth noting that reappraisal uses a lot of energy and it is best done when the brain is fresh. But, reappraisal, like everything else, is something you can practice until it becomes habitual.

Expectations

Expectations are the brain paying attention to a possible reward or threat. Expectations alter the way you perceive the world. It is common to fit incoming data into expectations and to ignore data that don't fit.

Met expectations generates a small increase of dopamine. Exceeded expectations generate a large increase of dopamine. And dopamine makes you feel good.

Unmet expectations generates a large drop in dopamine level, and a strong threat response.

The dynamics of expectations can generate upward and downward spirals.

A general feeling of expecting good things generate healthy levels of dopamine and may be the neurochemical marker of feeling happy.

If your expectations are not met, try reappraising, remembering that it is your brain reacting to the dopamine levels.

Collaboration

Maslow's hierarchy of needs may have been wrong and other needs may be as important as the primary needs that he identified.

Social connections are a primary need, as vital as food and water. We know other people by experiencing their states ourselves. Safe connections with others are vital for health and for healthy collaboration. People are classified as friend or foe quickly. Foe is the default. You need to work hard at creating connections to create good collaboration. Connect to people on a human level, by sharing experiences, to create better collaboration.

In order to collaborate well with others it is a good idea to take into account the major areas that we care about socially. The can be summarized by the SCARF model, SCARF stands for Status, Certainty, Autonomy, Relatedness and Fairness.

Status, is a significant driver at work and across life experiences. Status changes affect our threat and reward circuits. People pay a lot of attention to building and protecting their status. When everyone is trying to achieve higher status, there is a decrease in relatedness. Playing against yourself increases your status without threatening others. You can decrease the status threat in others, by sharing your humanity or mistakes.

Certainty is when you feel sure about yourself, your environment, and the people around you.

Autonomy, the feeling of control, is another primary reward. Note that is the feeling of autonomy that is important, not the actual autonomy. The feeling of autonomy can be increased by letting people understand that they have choices.

Relatedness is the feeling of being part of something. The feeling of being part of a team or of a cause. The feeling to belong.

Fairness, can be a very strong drive indeed. People go to war in order to make a wrong right. Treating people fairly may increase several of the other primary social domains.

Problems and Solutions

Trying to solve problems is less effective than trying to find solutions. When solving problems we narrow in on a specific area rather than trying to creatively find a solution that we are really looking for.

When helping others to solve problems, it is often not helpful to suggest possible solutions. People don't want to be fed a solution that they are not buying into.

This can be explained in terms of the SCARF model in that it:

  • Threatens the status, since it implies that they are incompetent.
  • Threatens the autonomy, since they cannot come up with their own solution.
  • Threatens the relatedness, since it is harder to relate to someone else's solutions than to your own.

It is better to bring people to their own insights. To do this it can be helpful to ask questions that make them think about their own thinking or to think of the problem at a very high level. Some ways to do this is to ask questions about what strategies people have been thinking about for solving the problem or to ask them to summarize the problem in one sentence.

Creating Long-term Change

The brain constantly changes itself. This is called neuroplasticity. Focused attention changes the brain. Attention is lost very quickly if we feel threatened by something. To induce change try to move attention away from the perceived threat by posing good questions. Creating long-term change requires paying attention regularly to deepen the new circuits.

Don't try to influence people in a strong away state. Use elements of the SCARF model to shift people into a toward state. Practice using solution-focused questions that focus people's attention on the specific circuits you want to bring to life. Invent ways to have people pay repeated attention to new circuits.

Recommendation

Your Brain at Work is as you may tell from my notes not only about the brain at work. It is about the brain. It is a really good book and I highly recommend it to everyone!

Thursday, December 30, 2010

Review of Crafting Rails Applications, by José Valim

José Valim is one of the newest members of the Rails core team. Apart from this he has also developed some good gems, Devise, Responders, and SimpleForm, that I use for almost every project.

And now he has written a book, a really good book, about advanced Rails programming techniques, called Crafting Rails Applications.

The book is only 180 pages long, and contains 7 chapters. I wish more books was this thin. The books is written in a clear concise way. José's lightweight test-driven approach clearly introduces every problem it intends to solve, and then solves the problem by introducing a new concept in the Rails framework. Most of the solutions are only a few lines of code, showing the power of Rails and also showing the power of having intimate knowledge of the framework. By hooking into the framework at appropriate places, José is able to provide elegant solutions to a range of problems.

I highly recommend the book to anyone interested in Rails.

If this was an ordinary book, this review could have ended here, but since the book is full of things I really wanted to know but didn't take the time to learn I decided to internalize them by describing parts of the book in my own words.

Chapter 1, Creating our own renderer

In this chapter we learn how to add a new renderer Rails. We add a renderer that handles generating PDF files with Prawn, allowing us to write code that looks like this.

class HomeController < ApplicationController 
  def index
    respond_to do |format| 
      format.html
      # This is the new capability, pdf rendering.
      format.pdf { render :pdf => "contents" }
    end 
  end
end

To allow the following we first have to register pdf as a mime type. We can do this with:

require "action_controller"
# Register a new mime type
Mime::Type.register "application/pdf", :pdf

# Registering the type allows us to write
respond_to do |format|
  format.pdf
end

With that out of the way all we have to do is to register a renderer, that will handle the actual rendering of the registered mime type. This is done with:

require "prawn" 

# Adds a new renderer to ActionController.Renderers
ActionController::Renderers.add :pdf do |filename, options|
  pdf = Prawn::Document.new pdf.text render_to_string(options) 
  send_data(pdf.render, :filename => "#{filename}.pdf",
      :type => "application/pdf", :disposition => "attachment")
end

This is all that is needed to add a rendering of a new type to Rails. José also goes into details about other points of interest where the rendering stack can be customized.

Chapter 2, Easy models with Active Model

Active Model is a Rails module that abstracts common behavior needed by different kinds om models such as Active Record, Active Resource and third party modules like Mongoid. Apart from giving developers of new models utility functionality. Active Model also provides tests for being Active Model compliant. To be compliant means to play well with the Rails view and controllers.

José implements a model for creating sending mail. In doing so he introduces us to a bunch of Active Model modules that will do our work for us.

Here are the modules in alphabetical order:

ActiveModel::AttributeMethods

When you include ActiveModel::AttributeMethods in your model, you get access to helper methods that will help you define additional methods for dealing with the attributes of your model. An example

class Tapir
  include ActiveModel::AttributeMethods
   
  # Define the attributes 
  attr_accessor 'name', 'color'

  # We want to create clear methods for every attribute
  attribute_method_prefix 'clear_'

  # We also want to have query methods for every attribute
  attribute_method_suffix '?'

  # Define the attribute methods that will call the protected methods below
  define_attribute_methods ['name', 'color']

protected
  # The name of this method corresponds to the prefix above
  def clear_attribute(attribute)
    send("#{attribute}=", nil)
  end

  # The name of this method corresponds to the suffix above
  def attribute?(attribute)
    send(attribute).present?
  end
end

   t = Tapir.new
 => #<Tapir:0x00000102769b90> 
> t.name?
 => false 
> t.name= 'kalle'
 => "kalle" 
> t.name?
 => true 
> t.clear_name
 => nil 
> t.name?
 => false 
> t.name

This is the gist of attribute methods, there is also an affix method that will allow you to add both a suffix and a prefix to your attributes. It is also worth taking a look inside the implmentation of this module, since the methods are defined on first usage through method_missing.

ActiveModel::Callbacks

ActiveModel::Callbacks provides methods for creating before_, after_, and `around_' callbacks to your model methods. An example:

class Tapir
  extend ActiveModel::Callbacks

  define_model_callbacks :snort

  def snort
    _run_snort_callbacks do
      snort_snort_snort
    end
  end

end

Then in inheriting classes I can use the callbacks as such:

class MountainTapir < Tapir
  before_snort :do_before_snort

  def before_snort
    i_am_so_cold
  end
end

ActiveModel::Conversion

This module assists with converting to, and representing a specific model instance. It contains three methods.

  • to_model, used for converting to an active model compliant model, in the default case it just returns self.
  • to_param, used for representing a model in routing.
  • to_key, used for representing a model from in a dom page.

ActiveModel::Naming and ActiveModel::Translation

ActiveModel::Naming contains one method model_name, that returns a subclass of String, that handles pluralization, etc. It has methods such as plural, human.

ActiveModel::Translation deals with I18N by adding functionality to human that handles the name lookup by keys using the preferred I18n.backend.

ActiveModel::Validations

The last, but not least of the models, ActiveModel::Validations, deals with validations. José demostrates how naming convetions and Rails constant lookup allow us to add new validators to Rails with ease. An example:

module Validators
  class TapirKindValidator < ActiveModel::EachValidator 
    def validate_each(record, attribute, value)
      unless [:baird, :mountain, :malayan, :lowland].include? value
        record.errors.add(attribute, :invalid, options) 
      end
    end
  end
end


If I now include my new validator wherever I want to use it. I can write code like:

class Tapir
  include Validators
  
  attr_accessor :kind
  validates :kind, :tapir_kind => true
end

t = Tapir.new :kind => :mexican
t.valid? 
# => false
t.errors[:kind] 
# ["is invalid"]


This example is unnecessarily complicated, since the validation could be fixed with:

class Tapir
    attr_accessor :kind
    validates_inclusion_of :kind, :in =>  [:baird, :mountain, :malayan, :lowland]
end

append_view_path

There is one more interesting thing in this chapter, append_view_path. It can be used to add a directory inside a gem to the view lookup path. This is essential to be able to deliver custom Rails components, Railties, with default views.

Chapter 3, Building a template management system

In the third chapter of the book,José takes on view resolvers. A resolver is responsible for looking up the appropriate template for a given request. The traditional resolver looks up the templates by path in the file system, but José guides us through creating a resolver that looks up the template in a database. Perfect for the core of a CMS system. I'm going to alter José's resolver to do the lookup in MongoDB instead.

# Most of this code is borrowed directly from Jos&eacute; Valim
# Only the Mongoid Part is written by me :)
require 'mongoid'
require 'singleton'

class MongoTemplate
  include Mongoid::Document
  field :body
  field :path
  field :locale
  field :format
  field :handler
  field :partial, :type => Boolean
  field :updated_at, :type => Date
    
  validates :body, :path, :presence => true
  validates :format, :inclusion => Mime::SET.symbols.map(&:to_s) 
  validates :locale, :inclusion => I18n.available_locales.map(&:to_s) 
  validates :handler, :inclusion => 
    ActionView::Template::Handlers.extensions.map(&:to_s)

  class Resolver < ActionView::Resolver 
    include Singleton
  protected
    def find_templates(name, prefix, partial, details)
      conditions = {
        :path => normalize_path(name, prefix),
        :locale => normalize_array(details[:locale]).first, 
        :format => normalize_array(details[:formats]).first,
        :handler.in => normalize_array(details[:handlers]), 
        :partial => partial || false
      }
   
      MongoTemplate.where(conditions).map do |record| 
        initialize_template(record)
      end 
    end
    
    # Normalize name and prefix, so the tuple ["index", "users"] becomes 
    # "users/index" and the tuple ["template", nil] becomes "template". 
    def normalize_path(name, prefix)
      prefix.present? ? "#{prefix}/#{name}" : name
    end
   
    # Normalize arrays by converting all symbols to strings.
    def normalize_array(array)
      array.map(&:to_s)
    end

    # Initialize an ActionView::Template object based on the record found.
    def initialize_template(record) 
      source = record.body 
      identifier = "MongoTemplate - #{record.id} - #{record.path.inspect}" 
      handler = ActionView::Template.registered_template_handler(record.handler)
      details = { 
        :format => Mime[record.format], 
        :updated_at => record.updated_at, 
        :virtual_path => virtual_path(record.path, record.partial)
      }
      ActionView::Template.new(source, identifier, handler, details)
    end
    
    # Make paths as "users/user" become "users/_user" for partials.
    def virtual_path(path, partial) 
      return path unless partial 
      if index = path.rindex("/")
        path.insert(index + 1, "_")
      else
        "_#{path}"
      end 
    end
  end
end

A Resolver is implemented by extending ActionView::Resolver and implementing the method find_templates(name, prefix, partial, details) There are a lot of extra information in the book, about caching etc. Obviously Rails caches the templates since it would be too slow to create a template every time. That is why we have the template as a singleton and that is why we clear the cache in the after_save hook above. The hook in Mongoid works exactly the same as in Active Record. Thank you Active Model!

Chapter 4, Multipart Emails with Markdown and Erb

In this chapter José walks us through three topics. The template handler API, Rails generators and Railties. I'm going to skip over the last two in this chapter. Generators are a large topic and they deserve a blog post of their own. José does a great job desribing how they work. The same goes for Railties and Rails Engines, they are definitely worthy of a blog post of their own.


# 
# Again most of the code is stolen from Jos&eacute; :)
#
module ScrambleHandler
  
  # Lookup the ERb handler
  def self.erb_handler
    @@erb_handler ||= ActionView::Template.registered_template_handler(:erb)
  end

  def self.call(template)
    # Call the erb handler, then call the new scrambler method.
    source = erb_handler.call(template)
    if template.formats.include?(:html)
      "Scrambler.from_html(begin;#{source};end).to_s"
    else
      "Scrambler.from_text(begin;#{source};end).to_s"
    end
  end

end

# Register our new handler, it handles index.html.scramble, show.html.scramble, ...
ActionView::Template.register_template_handler :scramble, ScrambleHandler

# This module scrambles text.
# Scrambler.from_text('Once upon a time a beautiful tapir came.')
# -> Ocne upon a time a baeuuitfl tpiar came.
module Scrambler
  def self.from_html html
    doc = Nokogiri::HTML(html) 
    doc.xpath('//text()').each do |node|
      node.content = from_text(node.content)
    end
    doc.to_html
  end

  def self.from_text text
    tokenize(text).map{|token| scramble(token)}.join('') 
  end

  def self.tokenize text
    return nil unless text
    text.scan(/(\p{Word}+|\W+|)/um).flatten
  end

  def self.scramble word
    return word if word =~ /\W/
    return word if word.size < 4
    arr = word.split(//)
    arr[0] + arr[1...-1].shuffle.join('') + arr[-1]
  end
end

Chapter 5, Publishing and subscribing to your applications events

In this chapter José uses the Notifications API to store notifcations in a MongoDB. He also shows how to use Rack middleware to configure what request to log. In order to configure the middleware he uses a Rails Engine. I'm just going to show how the Notifications API works here, and I'll let you read the rest in the book.

# Subscribe to all events and print them to the console
ActiveSupport::Notifications.subscribe do |*args|
  p ActiveSupport::Notifications::Event.new(*args)
end

# Instrument the rendering of Foo
ActiveSupport::Notifications.instrument(:render, :extra => :information) do
  render :text => "Foo"
end


Chapter 6, DRY controllers with Responders

In this chapter José goes through the implementation of responders. This implementation allows you to DRY up your controllers by factoring out common behavior.

def index
  @users = User.all
  respond_to do |format| 
    format.html # index.html.erb 
    format.xml { render :xml => @users }
  end
end

# becomes

def index 
  @users = User.all 
  respond_with(@users)
end


# and
def create 
  @user = User.new(params[:user])
  respond_to do |format| 
  if @user.save
    format.html { redirect_to(@user, :notice => 'User was successfully created.') }
    format.xml { render :xml => @user, :status => :created, :location => @user }
  else
    format.html { render :action => "new" } 
    format.xml { render :xml => @user.errors, :status => :unprocessable_entity }
  end 
end

# becomes
def create 
  @user = User.new(params[:user]) 
  flash[:notice] = 'User was successfully created.' if @user.save 
  respond_with(@user)
end

In this chapter we also learn how to replace the default generators with our own customized generators.

Chapter 7, Translatable app with I18n and Redis

In the final chapter José shows us how the I18N backed system works. He does this by creating a backend the uses Redis instead of the default YAML files. He also developes a simple Sinatra application that he hooks into the Rails routing with the mount method.

# Mount the Sinatra Translator::App at the /translator path.
mount Translator::App, :at => "/translator"

Rack applications normally get the full path inside ENV['PATH_INFO'], but when Rails mounts an application it removes the prefix before it sends it on /translator/en/pt/ becomes /en/pt/. The additional path is sent on in ENV['SCRIPT_NAME'] = '/translator'.

We also get a brief overview of Devise, the state-of-the-art authentication solution written by José himself.

Conclusion

One last thing, the book I have reviewed is a beta book, but the quality of it is higher than most published books I have seen. Congratulations to José and to the pragmatic bookshelf! There is not much more to say, get the book.

Tuesday, November 10, 2009

Adrenaline Junkies and Template Zombies

Since I had plenty of time to read on my flights back and forth to OOPSLA, I managed to read through a few books. One of them was Adrenaline Junkies and Template Zombies by Tom DeMarco et al. Being the sceptic that I am, my attitude when starting to read this book was: "Yeah, I know a lot of people has praised this book and I know that Tom DeMarco has written Peopleware, but what the hell do these bozos know anyway!" ;)

I figured that the six of them could probably scrape together a few decent people patterns, but I am a bit fed up with the whole pattern template style, so my expectations were not as high as they should have been.

Anyway, the book is amazing, the pattern template is really lightweight, basically, a name, an image, a statement, and a story. And the stories, are good. The authors have a remarkable ability to observe human nature and also the ability to write about what they see.

Some Patterns

The book contains 86 patterns, most of them are negative since they are funnier, as one of the authors said on a podcast.

Dead Fish

A dead fish is a project, that every one knows is impossible to start out with, but nobody says anything since the culture in the company is that way. If you say something you may get responses like,

Prove it! Prove that it is not feasible that this project will succeed!

Or,

Are you a weenie or a layabout?

Projects like this are usually worked on until it is inevitable that they will be late, and then everybody acts surprised.

Nanny

A nanny is a project manager that is aware of the capabilities of her staff and nurtures them and lets them at their peek. The nanny is responsible for improving her staff and make responsible project citizen of them. A nanny enables workers to do their job.

Eye Contact

If your life depended on a project, would you want them working close together or in different corners of the world? Human communication goes way beyond words, and it is foolish to think that it is possible to work at full speed with people who don't know each other and live in different places.

Dashboards

A dashboard is a highly visible board, that enable the project members and others to get an instant view of the status of the project. It can be a web page or a board on the wall. What is significant with a dashboard is that it is updated as soon as anything important happens in the project. All project members care for the dashboard since that is the place where they can find out how they are doing. Dashboards contain just the right amount of data.

Film Critics

A film critic is a project member or someone related to the project who thinks that they can succeed even if the project is a failure. They may often have good points, but usually when it is too late to do something about it. It is no use to have a person like this on the team, since they are not really on the team if they don't go down with the ship.

Natural Authority

The word authority have several meanings. The meaning of an authority is a person who knows a great deal about something. Another meaning, in authority, is a person who is in charge. A person who is an authority and in authority is a natural authority. This is the healthy pattern.

The White Line

The white line is the line on a tennis court. The line is a clear signal if the ball is in or out. Occasional dispute may arise over a questionable judgment call, but the line is respected by everyone. Most projects don't have this line. Create a white line for your project so that you know what is inside the project scope and what is not.

Silence Gives Consent

If someone don't oppose an idea, it is, usually, taken as consent. Especially from people who come from different working areas, like management and programmers. Silent consent is not good for anyone, because nobody is sure what has been decided and what has not. A way to remedy this problem is to keep a list of commitments where it is written down who has promised who what. The Scrum sprint backlog is similar to such a list.

Time Removes Cards from Your Hand

The earlier a decision can be made, the better. If you know that a project will not make a deadline, the decision to change the scope should be made as early as possible, since that will allow the team to work on the most important features first. If a decision is delayed until it is too late, the decision is made implicitly by time.

Rhythm

Instead of being daunted by overwhelming tasks, projects with rhythm take small, regular steps thus establishing a regular beat that carries them toward their goal.

This journey of a thousand miles begins with a single step --Lao Tzu

False Quality Gates

False quality gates are quality checks that don't do anything to promote the quality of the project. It is a sign that more attention is concentrated on format, rather than content. It can be a glossary of terms with the wrong content or a word template where most of the sections are filled in with the words "This section must contain text to fulfill company guidelines".

Testing Before Testing

Testing before testing refers to the practice of thinking about how to test a feature at the same time you think about how to implement it. If it cannot be tested how can you know that it does what you say?

Cider House Rules

Cider house rules are rules written by someone unconnected to the project. Rules like this, that give no apparent value, are a burden to the project and therefore often ignored.

Nobody pays attention to them rules. Every year Olive writes them up and every year nobody pays any attention to them. -- John Irving, The Cider House Rules

Talk Then Write

The team makes decisions during conversation, and then immediately communicates the decisions in writing. This is a really important pattern that it is easy to forget!. A common place where this kind of decisions are written down is very helpful.

Practicing the End Game

A team that does not release often and regularly will often take a long time to make a release. The act of releasing a product should be practiced often so that is becomes a natural part of the project.

Data Quality

Data quality often sucks! A common solution is often to attack the problem with technology instead of putting in the manpower that is actually needed to improve the quality of the data. Company web-sites are the prime example of this. They are often full of completely useless information.

Undivided Attention

Complex work is hard and it requires undivided attention to be performed properly. Splitting people's attention over multiple project will severely hinder their performance.

By doing two things at once, you've cut your IQ in half, and believe me, those 40 points can really make a difference. -- Dale Dauden, The New York Times

Orphaned Deliverables

Orphaned deliverables are deliverables that no-one values enough to pay for. Always make sure that there is a sponsor for every artifact that you are developing.

Hidden Beauty

Hidden beauty inside a program, that little extra thing, that may seem unnecessary, is what shows that the creator cares about his work. It is not unnecessary! This caring is what separates a quality product from garbage.

I Don't Know

If you are afraid of saying the words, "I don't know!", you are probably working in an organization where saying it means that you will be taken for a fool. In a healthy organization, "I don't know!", means that you don't know, but you will in a while, if it is important enough.

Loud and Clear

Having a clear goal, that everyone agrees to, is vital to a project. Clear goals allows you to focus the project activity if it starts to move away from its purpose. A PAM statement, that contains the Purpose, Advantage, and Measurements of a project is very helpful.

Conclusion

The patterns described above are just my short summaries, and I don't do them justice, but hopefully I have awoken your interest in this wonderful book.

It made my top-ten list and I recommend it to everyone from programmer to president. I like that the authors don't always provide a solution, but instead just describe the way they see it, it is up to you to figure out a solution to the problem yourself.

Tuesday, October 27, 2009

Some thoughts from "A Theory of Fun"

I just finished reading the book A Theory of Fun by Raph Koster. It is funny how everything comes together once you start focusing and noticing certain patterns. It is a good book and worth reading even if you're not into game design.

I already learned from personal experience and from other books, that our conscious mind is terrible at multitasking. It is however very good at internalizing things, learning things so that the brain can perform them unconsciously, without conscious supervision. Raph calls this chunking.

The act of learning is about turning many steps into chunks that we don't need to think about as separate entities.

When we don't see something, we don't perceive it, but once we become aware of a certain pattern, we see it everywhere. Koster calls this noise.

Noise is any pattern that I don't understand.

A good game keeps us on the edge of our abilities constantly and once we learn something the game will become harder. This is a variant of flow. But since a game cannot continue for ever it is doomed to become boring once we have mastered it.

The destiny of games is to become boring, fun is the process and routine is its destination.

Koster also mentions some of his grandfathers carpentry practices.

  • Work Hard on Craft
  • Measure twice, cut once.
  • Feel the grain, work with it not aginst it.
  • Create something unexpected, but faithful to the source from which it sprang.

That is not bad advice for anything.

Saturday, October 03, 2009

Notes on Greg Young's on DDD

I watched Greg Young talk about DDD on InfoQ. Here are my notes on the talk.

  • Only use domain driven design on appropriate projects. Most projects are not suitable.
  • Use state transition event streams to communicate between different bounded contexts.
  • Bounded contexts are one of the very keys of domain driven design. The same word may have different meanings in different contexts, and this is OK.
  • Use OO, avoid setters. Objects have behaviors, not shapes.
  • If you always have valid objects, you avoid the problem of having to check if an object is valid all the time. IsValid is not the solution.
  • Always use the domain experts and end-users language.
  • Separating commands from queries gives the benefit of eventually consistent, queries may read from a different place than the commands.
  • Coupling is not a problem, if it's in the same layer.
  • Model the view, such as screens, as reports, with no transactional behavior.
  • Explicit state transitions remove the need for auditing. They are the audit.

Wednesday, August 12, 2009

What Eric Evans Would Have Changed in the DDD Book.

Here are my notes of Eric Evans talk What I've learned about DDD since the book

Essentials

Emphasize that the collaboration with the domain experts is essential. It is up to you to show the domain experts how valuable their collaboration is. If they cannot see the value of participating in the project, they will not to a good job, and they will try to avoid it.

Always produce at least three bad models. These models help to emphasize what is important.

The chapters "Distillation of the Core Domain" and "Context Mapping and Boundaries" should have been moved to the start of the big since these are the most essential areas.

Changes to Building Blocks

Domain Events

There is one new Building Block and it is the Event Object. The Event Object is an object the represents an Event that is significant to a domain expert. A benefit of domain events is that they give clearer, more expressive, models.

The events can be used for: - Representing the state (history) of entities. - Decouple systems with event streams (publish-subscribe) - Enable high-performance system.

Aggregates

Evans want to emphasize som things of aggregates. The boundaries of an aggregate need to contain transactions, distribution and concurrency.

When modelling the aggregates it is important to not over-specify on what part of the aggregate the properties and invariants are placed. Even though they are commonly placed on the aggregate root, this is not essential and it gives you a freedom if you not specify it too hard and too early.

Strategic Design

Large-Scale Structure does not come up very often and would probably have been left out of the book.

It is important to not spread modelling to thin, and to focus on the core domain and to create a clean bounded context.

Collaboration Patterns

There is two new collaboration pattern called Partners. This pattern differs from the other collaboration patterns in that it is cooperative and mutually dependent.

Another pattern is the Big Ball of Mud"_. This pattern is known as an anti-pattern since it implies that the code is just fixed as things go. This pattern is utterly pragmatic but the point Evans is making is that if there is a Big Ball of Mud in the system, it is important to define the boundaries of it, so that it doesn't spread to other systems that are more rigorously architected.

Context Mapping

  • What models do we know of?
  • Where does each apply? Define boundaries in words?
  • Where is the information exchanged?
  • The service interface may define a context boundary.

DDD and SOA

  • The service interface must be defined in some context.
  • Internals also, but often not the same one.
  • The service interface may define a context boundary.

Precisions Designs are Fragile

Sophisticated design techniques are wasted in a ball of mud. It must be isolated with an Anti-Corruption Layer.

Not all of a large system will be well designed. Figure out what part of the system is most critical and benefits most from a really nice design.

Monday, August 10, 2009

Notes on The User Illusion, part Two

This is part two of a summary of the fantastic book. The User Illusion

Our conscious mind consists of symbols that map into the rest of our mind. Every second more than 11 million bits are reduced to less than 50 bits of meaningful information at apparently no time at all.

Half a second before we try to do something consciously our brains has started its activity. Half a second!

Experiment
  • Sit down and hold one finger up.
  • Whenever you feel like it, bend your finger.

Half a second before your finger is bent, your brain has started its activity! It does not feel like half a second does it? There is no way! 0.1 second is more likely. But the data has been reproduced and it is undeniable.

The consciousness of wanting to do something appears almost half a second after the brain has initiated its activity.

Our actions are initiated unconsciously.

Benjamin Libet

Benjamin Libet performed some experiments, in the sixties, while a friend of his was performing brain surgery. Libet stimulated the brain with electrical impulses and found that if the brain was stimulated less the half a second, it was not noticed at all. If the brain was stimulated more than halv a second the patient felt it. It appeared to the patient as if a certain area of his body had been touched, since there are no normal sensors inside the brain.

Libet then performed some other experiments. He stimulated a part of the brain that related to the left hand and at the same time he stimulated the right hand and the patient was to say which hand was stimulated first.

The hand had to be stimulated half a second after the brain to give the appearance to the patient that they where stimulated simultaneously.

The conscious experience is projected back in time so that the conscious mind believes that they are almost simultaneous. The brain is fooling itself.

The conscious is delayed, but it does its best to hide it. For itself. It is very convenient since it gives the mind the time to perform the reduction of the sensory data to what is needed to get a full experience.

Everyone knows that it doesn't take half a second to remove a hand from a hot stove, but it takes half a second to get the conscious back-dated experience.

So does this mean that we don't have free will? Libet does not think so. He says that there is time for the conscious mind to veto the unconscious decision.

The conscious is not a top-level unit that gives orders to its underlying processes. It is a selecting mechanism that chooses between the different options that the unconscious provides.

As long as the unconscious action-proposals work in sync with the conscious thoughts and feelings, they are hardly noticed. They are merged together with the conscious motives that take all the credit! --Harald Høffding

The conscious veto is often associated with an uncomfortable feeling, we usually feel best when we are not making conscious decisions. Compare this with for example Flow

I and Me

Nørretranders defines I as the conscious mind and Me as the rest of us.

I have free will, but it is not my I that has it, it is my Me.

The conscious mind is allowed to use its veto in situations where the Me allows it to. In situations where speed is critical, for example when something is threatening us, the conscious mind is left out of the loop.

A comfortable state of mind is when the Me is allowed to do what it does automatically without interference of the I. This state is neither associated with nervousness nor shyness, but with comfort and carelessness.

The User Illusion

The user illusion is a term coined by Alan Kay of Smalltalk fame. He used it to describe the metaphor of the desktop that was invented by him and his colleagues at Xerox PARC. His great idea was that it does not matter what really happens inside the computer as long as the interface presented to the user is useful and consistant.

Nørretranders argues that our consciousness is our user illusion. Our consciousness is our map into ourselves and our possibilities to affect this world. I am the user illusion of Me.

The conscious mind may appear when the brains' simulation of the world has become complete enough to require a model of itself. --Richard Dawkins

Experiments with split-brain patient has shown that the mind doesn't think twice about making up a story that is consistent with something that does not have anything to do with reality. An example of this is:

  • A split brain patient is shown two images
    • The right eye was shown a snowy landscape
    • The left eye was shown a chicken's foot.
  • The patient pointed to two images.
    • The right hand a snow-shovel.
    • The left hand a chicken.
  • When the patient was asked why he pointed at the two images:
    • He said that he picked the chicken because it matched the chicken's foot
    • And that he picked the shovel because you need the shovel to clean out the chicken house.

The mind lied without hesitation to make the selection of images consistent.

Our consciousness is delayed to allow it to perform the required calculations. First we sense, then we simulate, then we experience. But we have no notion of the simulation. Consciousness is depth appearing as shallow.

Learning and Knowing

There are lots of things that we know how to do that we cannot explain. How do you ride a bike? How do you walk? How does your mother look? Its impossible to explain, but simple to know, once it has been learned.

The I's role in learning is to have the disciplin to learn by repetition, and the foresight that when I have learned this I will enjoy practicing it. The consciousness, usually, gets in the way while learning and, certainly, gets in the way when we practice what we have learned.

Science, usually, clarifies what we already know. It explains what we already know but cannot explain to each other.

Science is just refinement of everyday knowledge --Albert Einstein

The relationship between the conscious learning and the non-conscious ability is similar in both practical areas, such as ballet, and theoretical areas such as science; in both cases we must put in a lot of hard work for something we don't completely understand, but that we still can share with others.

The Rise of Consciousness and Religion

Nørretranders brings up another researcher, Julian Jaynes, who argues that the consciousness of man didn't exist 3000 years ago. He has various theories to prove this. Among other things he brings up the Oracles of Ancient Greece and the voices religious people hear as examples of people who are acting without a consciousness. A pre-conscious man is just a me, and a conscious man thinks he is just an I.

He also makes an interesting point about religion. The I has to recognize that there is something greater than itself. But it is not a god it is the me. God is the part of man that the I cannot explain. Religion is too important to be left to the religious. It is the struggle between the carefree me and the worrying I.

The Limits of Consciousness

Most of the processes that go on inside our bodies we know nothing about. We cannot feel the blood flowing in our legs or our immune system attacking viruses, until the problems become large enough for the body to raise the temperature to increase the effect. We cannot hold our breaths long enough to kill ourselves. The unconscious part of us wont let us

The Beginning of the Universe

In the Universe there is as much negative matter as positive matter. The sum of it all is Zero. According to the laws of quantum mechanics it is possible for Nothing to split into something for a very short while. The less it is the longer it is allowed to exist. So, it the sum of everything in the Universe is Nothing can exist forever.

Emergence

Emergence is the appearance of group characteristics when the number of elements increase. An example of this is Temperature. There is no temperature when there are only a few molecules but when the number of molecules increases the Temperature property emerges. In the book Gödel, Escher, Bach, Douglas Hofstadter talks about the emerging properties of the brain, the thoughts that cannot be described at a lower level.

Gödels proof suggests the possibility that an view from a higher level may have an explanation capacity that is totally missing at a lower level. --Douglas Hofstadter

A larger system consisting of simple rules can show characteristics that cannot be deduced from the rules.

It is impossible to know how yourself or another human will react, because it requires you to have access to all the information yourself or this other person has had and this is impossible since human being mostly function unconsciously.

The Liars Paradox, "I'm lying" is not a liars paradox. It is the truth about our consciousness. --Thor Nørretranders

Sunday, July 19, 2009

Notes on The User Illusion, Part One

The User Illusion, is a magnificent book. It is written by the danish author Thor Nørretranders. The Swedish title of the book, "Märk Världen", is a better title. "Märk Världen" means Notice the World it can also be a pun, "Märkvärdigt", means Astonishing.

The popular usage of the term information has been perverted from the original meaning of the word. The original meaning of the word is similar to the word data. It is something that can be transmitted, stored or transformed. It does not have anything to do with meaning. In popular usage the word information is often interpreted as something that has an actual meaning and not just raw data that may or may not mean anything to anyone.

Thor Nørretranders refers to information as data. It does not matter if a conversation over the phone is gossip or if it is an explanation of the theory of relativity. It is information nonetheless. He claims that random information commonly referred to as chaotic as containing more meaning than ordered information. To support this claim he gives a simple example.

A random sequence of coin-tosses (101010101111) cannot be reduced to anything but the same sequence of coin tosses, while a regular sequence (111111111111) can be reduced to the simple statment: 12 ones. Therefore the 12 ones contain less information than the coin-tosses.

Another interesting aspect of this is that it is impossible to know in advance if a sequence can be reduced or not until the actual reduction has been done. This is related both to Turing's halting-problem and to Gödel's incompleteness theorem.

Logical Depth

A conclusion's logical depth is a measurement of its meaning, its value. The harder it is for the sender to reach a conclusion, the larger is its logical depth. The more "calculation time" he has used the greater is its value, since the receiver of the conclusion is relieved from having to perform the same calculation.

Logical depth can informally be defined as the number of steps in a conclusion or causal chain that connects something with its probable origin. Logical depth describes complexity.

A table of moon phases can be calculated by a simple formula, but it takes time. A living organism can be specified by a few genes but it takes a long time to develop the complete organism.

Chaos and disorder cannot be reduced to something less. The shortest program is identical to it all. They have no logical depth.

It is difficult to make things look easy. Clarity demands depth.

Communication and Exformation

To communicate is to take information (a mental state) in the sender, reduce this state to a message that can be transferred over a channel to the receiver, the receiver then interprets this message as information (his own mental state).

The explicitly removed information, Nørretranders calls exformation. A statement has depth if it contains a lot of exformation. That is, information that existed in the sender, but was purged while composing the message, and is no longer present in the final result.

There is no possible way to calculate the exformation of a message from the contents of the message. This can only be found in the context of the message. The sender forms the message so that it refers to a common context allowing the receiver to re-create the meaning from this context. A good communicator not only thinks of himself, but also of what the receiver is thinking about.

Meaning is purged information, removed information, unneeded information, exformation.

Information is not needed to transfer exformation. An example is an agreement between a child and his parents that instead of calling every week, he will only call if he is in trouble. Every week exformation is communicated, all is well, by not sending any information at all.

To communicate well we must be able to take the information in our heads and create meaningful symbols of it. These symbols should represent a common understanding so that the recipient of the symbols can induce the same understanding that we have.

Meaning and Consciousness

What we consciously experience in any given moment, limits itself to a very miniscule part of the flood of information that flow through our senses. --Manfred Zimmermann

The bandwidth of our conscious is less than 50 bits/s. Our senses take in around 11 million bits/s with the vision at 10 million bits/s, touch - 1 million bits/s, hearing and smell - 100 000 bits/s, and taste - 100 bits/s.

Most of what we experience, we can never tell someone else. We experience millions of bits but can only verbally communicate decades.

But we are not limited to verbal communication. Just as our senses can recieve 10 millions of bits our bodies can also communicate. Our bodies send out 100 000 bits/s through body movements, voice modulations, facial expressions, etc. It is just not possible to recieve all this information consciously. This is why there is no substitute for face to face.

A good bedtime story is good since it induces feeling in the adult that the child is able to pick up and react to. The excitement, sadness, and happiness induced by great tales such as The Ugly Duckling, by H.C. Andersen is what makes them great. The tale creates a much wider communication channel than a tale that means nothing to the adult, since the emotions emitted from the adult induces the same feeling in the child at a much higher bandwidth than simple words can communicate.

The unconscious is not hidden from anyone, but the person, who for himself tries to hide the sides of himself that were disliked by the people who he loved while growing up.

Others know more about us than we do.

Most of the information that pass trough us is never experienced consciously, although this information has a noticable effect on our behavior.

The Unconscious

When we meet a new person, we usually make a really quick decision whether we like the person or not. We say, "You nerver get a second chance to make a first impression!" and "We don't have chemistry". These decisions are made so quickly that they cannot possible be made by the limited understanding of our conscious. This is indirect evidence of high-speed channels that operate unconsciously.

The conscious is a much smaller part of our life than we are conscious of, because we cannot be conscious of that which we are not conscious of.

Our conscious is like a flashlight and wherever it looks there is light. The obvious conclusion of the flashlight is that it is light everywhere. We are conscious less than we think, because we cannot be conscious of not being conscious.

I am sure that there are no words in my conscious when I am really thinking. --Jacques Hadamard

Real thinking is not a process that is performed consciously.

Thoughts die the moment that they are put into words. --Schopenhauer

When was the last time you ate fish? Yesterday? Last year? Never?

The moment you started thinking about this, your conscious mind let go. How did you come up with the answer you gave? Did you think through all the meals you have eaten in your life or did it just pop into your head?

Summary part one

The first part of the book sets the stage for the rest of the book. It introduces, and defines, the words: information, exformation, and logical depth. It also introduces the notion of meaning, consciousness and unconsciousness.

Our conscious can contain less than 50 bits per second. While our senses take in more than 11 million. Our brains process the 11 million bits of information and reduces them down to 50 meaningful bits, symbols that map into the rest of our brain and knowledge. But processing takes time even for something as able as our brains. But isn't our conscious perception immediate? No, it's not, but it appears to be! The second part of the book and the second part of this summary deals with this discrepancy.

Wednesday, July 15, 2009

Notes on The Secrets of Consulting

I finally found time to read The Secrets of Consulting by Gerald Weinberg. With all books with titles like, How to Win Friends and Influence People, I very reluctantly start to read them, because, they sound like books on learning how to be manipulative and I don't want to be like that. But when I finally start reading them, after many independent recommendations from people I trust, I find them to be very down-to-earth and not at all manipulative. They are more about how to become a sympathetic human being and because you are, to become successful in other areas too.

The book is full of good ideas and I am going to mention a few that I like from every chapter in the book.

Why consulting is so tough?

The quotes I like best in this chapter are

You'll never accomplish anything if you care who gets the credit.

This is very true. I've seen this many times. People who care about credit, usually, wants a little more than they deserve and this will piss of other people who also wants the credit. Meanwhile, the people who don't care about the credit, just keep on working, making things happen.

When an effective consultant is present, the client solves problems.

And the funny part is that it does not matter as long as I feel that I am doing a good job.

Cultivating a Paradoxical Frame of Mind

The answer to Get it done in the shortest time possible is

What are you willing to sacrifice?

This implies that everything is a tradeoff. The most common tradeoffs are Now versus Later and Risk versus Certainty. Another good reply when someone wants to get something done is

We can do I it - and this is how much it will cost.

This is a very good reply since it shows that you know what you are talking about and that you are not just saying something to get the contract.

Being effective when you don't know what you are doing.

The most important thing to remember is that:

It is always a people problem.

People always want to catch a consultant with a lie, so:

We ought to bend over backwards to understate our qualifictions, but    insecurity makes us all victims to occasional exaggeragtion.

Seeing what's there

If you use the same recipe, you get the same bread.

Learn from history. If you don't listen to the mistakes the client has made you are likely to make the same mistakes.

Study for understanding, not for criticism.

A client is not very likely to help you, if you criticise everything he has done. Look for what you like in the present situation and comment on that. Someone will always comment on what's bad.

We may run out of energy, or air, or water, or food, but we'll never run out of reasons.

People never run out of reasons. We can think of a million reasons to rationalize our behavior and none of them may be the true reason. We may not even know it ourselves.

The name of a thing is not the thing.

This is so very true. Naming is really, really important! But we should always be aware that a name is just a label and there is always more to it than that. If we think the name is the thing, we may miss important points.

When you point a finger at someone, notice where the other three fingers are pointing.

It is always easier to blame someone else.

Seeing what's not there

It is as important to see what's missing as it is to see what is there. Use laundry lists to remember what to look for.

If you can't think of three things that might go wrong with your plans, then there is something wrong with your thinking.

It is easy to become to narrow-minded when it comes to your own thinking.

Words are often useful, but it always pays to listen to the music, especially your own.

Be aware of congruent words and emotions.

Avoiding traps

What you don't know may not hurt you, but what you don't remember always does.

Set triggers to help you remember. Triggers may be anything from songs to one-liners, jokes and mental pictures.

It ain't what we know that gets us into trouble, it's what we know that ain't so.

Never be too sure of anything.

Amplifying your impact

Characteristics of a good consultant:

  • Your task is to influence people, but only at their request.
  • Your task is to make people less dependent on you, rather than more.
  • Try to Jiggle. The less you actually intervene, the better.
  • If your client wants help solving problems, you are able to say no.
  • If you say yes but fail, you can live with that. If you succeed, the least satisfying approach is when you solve the problem for them.
  • More satisfying is to help them solve the problem in such a way that they will be more likely to solve the next problem without help.
  • Most satisfying is to help them learn how to prevent the problems in the first place.
  • You can be satisfied with your accomplishments, even if the client don't give you credit.
  • Your ideal form of influence is first to help people see their world more clearly, and then to let them decide what to do next.
  • Your methods of working are always open for display and discussion with your clients.
  • Your primary tool is merely being the person you are, so you most powerful method of helping other people is to help yourself.

Gaining control of change

Feedback

Fords Fundamental Feedback Formula
1. People can take any amount of water from any stream to use for any purpose desired.
2. People must return an equal amount of water _upstream_ from the point from which they took it.

Believing in what you do

Would you place your own life in the hands of this system?

How to make changes safely

Nothing new ever works.

I have come to this conclusion myself and I heard Joel Spolsky mention a harsher version of this on the Stackoverflow Podcast. He said Nothing ever works! not just new things.

Trust everyone, but cut the cards.

Fundamental skepticism is necessary.

If you must have something new, take one, not two.

When trying out something new, try one thing at the time otherwise you will not now what fails when it fails.

It may look like a crisis, but it the end of an illusion.

When a crisis occurs it is a sure sign that something has not been right in the first place.

What to do when they resist

The first thing to do with resistance is to appreciate it. If you get no resistance something is clearly wrong. When facing resistance Get it out into the open. Name the resistance in a neutral way. * Locate the nature of the resistance.

You can make a buffalo go anywhere, just so long that they want to go there.

Clients tend to overestimate unspoken negative factors and to forget positive ones.

Good questions for defusing potential resistance are:

  • Is there anything you would like to change about this plan?
  • What do you like best about this plan?
  • What is the one thing that you want to be sure does not change?

    People who are realistic about risks don't become consultants.

  • Step away, if you feel the fight cannot be won.

Marketing your services

  1. A consultant can exits it two states, Idle or Busy.
  2. The best way to get clients it to have clients. It is best to look for new business when you have business.
  3. Spend at least one day a week getting exposure.
  4. Clients are more important to you than you can ever be to them.
  5. Never let a single client have more than one-fourth of your business.
  6. The best marketing tool is a satisfied client.
  7. Give away your best ideas.
  8. It tastes better when you add your own egg.
  9. Spend at least one-fourth of your time doing nothing.
  10. Market for quality, not quantity.

Putting a price on your head.

  1. Pricing has many functions, only one of which is the exchange of money.
  2. The more they pay you, the more they love you. The less they pay you, the less they respect you.
  3. The money is usually the smallest part of the price.
  4. Pricing is not a zero-sum game. My gains doesn't have to be their losses.
  5. If you need the money, don't take the job.
  6. If they don't like your work, don't take their money.
  7. Money is more than price. If the clients have paid in advance they are more likely to be prepared for the job.
  8. Price is not a thing; it's a negotiated relationship.
  9. Set the price so you won't regret it either way.
  10. All prices are ultimately based on on feelings, both yours and theirs.

How to be trusted

  1. Nobody but you cares about the reason you let another person down.
  2. Trust takes years to win, moments to lose.
  3. People don't tell you when they stop trusting you.
  4. The trick of earning trust is to avoid all tricks.
  5. People are never liars - in their own eyes.
  6. Always trust your client - and cut the cards.
  7. Never be dishonest, even if the client requests it.
  8. Never promise anything.
  9. Always keep your promise.
  10. Get it in writing, but depend on trust.

Lessons from the farm

  1. Never use cheap seeds.
  2. A prepared soil is the secret of gardening.
  3. Timing is critical.
  4. The plants that hold the firmest are the ones that develop their own roots.
  5. Excessive watering produces weakness, not strength.
  6. In spite of your best efforts, some plants will die.

All in all, this is book full of good advice that is worth reading for anyone, not only consultants. Worth noting is that the consultants in this book are very far from the resource-consultants that are the common case in Sweden. The consultants this book refers to closer resemble what we know as management consultants, although it is not an exact match.