Focus, SCNA 2011

Preview:

DESCRIPTION

This was a talk that I gave at SCNA 2011. It's a bit old but recently requested.

Citation preview

Mastery

Local Maximas

Focus

Masters can melt people with their minds

We spend most of our time here

Mihaly Csikszentmihalyi on flow

What is flow?

I’ll give you a hint...

?

Flow != meditation

The mental states are remarkably similar

The flow of a master is much more effective

Our nervous system can only process 110

bits of information per second

Effects

• Completely involved (no notion of self)

• A sense of ecstasy

• Inner Clarity

• Confidence in skills to solve the problem

• Serenity

• Timelessness

• Intrinsic motivation

Focus has an enemy

25

When you over caffeinate, your nervous system can’t funciton

properly

You can’t enter proper flow when in this state

BS!

We spend most of our time here

Achieving mastery requires proper focus

How do we get there?

Power

Power comes in multiple forms

Locality

Know when to apply what kind of power

Sometimes power > elegance

Work in tools that allow flexible

application of power and elgance

Simplicity

example: refactor apache

commons isBlank

���33

public class StringUtils { ! public static boolean isBlank(String str) { ! int strLen; ! if (str == null || (strLen = str.length()) == 0) { ! return true; ! } ! for (int i = 0; i < strLen; i++) { ! if ((Character.isWhitespace(str.charAt(i)) == false)) { ! return false; ! }! }! return true;! }!}

initial implementation

���34

public class StringUtils { ! public isBlank(str) { ! if (str == null || (strLen = str.length()) == 0) { ! return true; ! } ! for (i = 0; i < strLen; i++) { ! if ((Character.isWhitespace(str.charAt(i)) == false)) { ! return false; ! }! }! return true;! }!}

- type decls

���35

public isBlank(str) { ! if (str == null || (strLen = str.length()) == 0) { ! return true; ! } ! for (i = 0; i < strLen; i++) { ! if ((Character.isWhitespace(str.charAt(i)) == false)) { ! return false; ! }! }! return true;!}

- class

���36

public isBlank(str) { ! if (str == null || (strLen = str.length()) == 0) { ! return true; ! } ! every (ch in str) { ! Character.isWhitespace(ch);! }! return true;!}!

+ higher-order function

���37

public isBlank(str) { ! every (ch in str) { ! Character.isWhitespace(ch);! }!}

- corner cases

���38

(defn blank? [s] ! (every? #(Character/isWhitespace %) s))

lispify

���39

public class StringUtils { ! public static boolean isBlank(String str) { ! int strLen; ! if (str == null || (strLen = str.length()) == 0) { ! return true; ! } ! for (int i = 0; i < strLen; i++) { ! if ((Character.isWhitespace(str.charAt(i)) == false)) { ! return false; ! }! }! return true;! }!}

initial implementation

���40

Mutable state

Exit point

Exit point

Exit point

Condition

Condition

Loop

Ok, i’m confused, how does this apply to

mastery?

Focus and flow let us realize our potential

We learn by stretching beyond our limits

Entering flow helps us become more self

aware

We should be tactically moving hereAnd sometimes here

Effective focus helps you level up faster

You need to work with tools and languages that

allow proper focus

Choose sleep over caffiene

Thank You!

• aaron@clojure.com

• @abedra

• thinkrelevance.com