when code cries: listening to code

Post on 21-May-2015

52 Views

Category:

Technology

3 Downloads

Preview:

Click to see full reader

DESCRIPTION

What is the best way to learn a new programming language or improve coding skills with the language you already use? Cory Foy has developed a new method for learning—and teaching—new programming languages and improving programmer expertise on their current languages. His approach focuses on preparing the learner to listen to what the code is saying and, thereby, changing how we approach the language. To learn a natural language, we would not start by studying prepositions, nouns, and verbs. Instead we would apply real-world scenarios: ‘How do I say, “Where's the kitchen” in German?’ In the same way, we need a directed approach to study and absorb code examples to gain insight into what the programming language wants our code to say. With Cory’s “listening” approaches, you’ll help your code to come alive by naturally resolving the forces that are present in the problems you are working to solve.

TRANSCRIPT

 

BT10 Concurrent Session 11/14/2013 3:45 PM 

     

"When Code Cries: Listening to Code"

   

Presented by:

Cory Foy Cory Foy, LLC

        

Brought to you by:  

  

340 Corporate Way, Suite 300, Orange Park, FL 32073 888‐268‐8770 ∙ 904‐278‐0524 ∙ sqeinfo@sqe.com ∙ www.sqe.com

Cory Foy Cory Foy, LLC

A passionate technical executive, developer, blogger, and speaker, Cory Foy has more than sixteen years of software and technology experience, and ten years of agile and lean methods experience. His background includes work in the health care, financial, and technology sectors, serving as a Premier Field Engineer and Team System Ranger for Microsoft; consulting with DirecTV, Stratos Global, and Invensys as a senior consultant for Net Objectives; and architecting solutions for organizations such as MIT's College of Engineering while at 8th Light. Cory's blog coryfoy.com was ranked as one of the top 100 Agile blogs. You can find Cory on Twitter @cory_foy and on LinkedIn at linkedin.com/in/coryfoy.

When Code Cries

Cory Foy@cory_foy

foyc@coryfoy.comhttp://www.coryfoy.com

Bad Code

Is this quality code?

Is this quality code?

Is this quality code?

“Code that actually gets used”

Is this quality code?

“Code that actually gets used”

“Lots of merged in pull requests”

Is this quality code?

“Code that actually gets used”

“Lots of merged in pull requests”

“Quality code makes me say, "hmm," not

"ick."”

Is this quality code?

“Code that actually gets used”

“Lots of merged in pull requests”

“Quality code makes me say, "hmm," not

"ick."”

“If, when used, it pleases the user”

“The specific patterns out of which a building or 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”

Code Smells

Code Talks

Code Cries

Because No One Understands What It Is

Saying

Code Cries

So?

So?

So?

“...we have so far beset ourselves with rules, and concepts, and ideas of what must be done to make a

building or a town alive, that we have become afraid of what will happen naturally, and convinced that we must

work within a “system” and with “methods” since without them our surroundings will come tumbling

down in chaos.”Christopher Alexander - “The Timeless Way of Building”

Ten Thousand Hours

Ten Thousand Hours

Ten Thousand Hours

Functional ProgrammingImperative Programming

Logic ProgrammingStatic Typing

Dynamic Typing

Coding Standards Define Dialects

BICS

CALP

BICS

CALP

BICS

CALP

ContextReduced

ContextEmbedded

BICS

CALP

ContextReduced

ContextEmbedded

Cognitively Undemanding

Cognitively Demanding

- Copying from the board- Reading a Map- Face to Face Conversation- Selecting food in the lunchroom

BICS

CALP

ContextReduced

ContextEmbedded

Cognitively Undemanding

Cognitively Demanding

- Copying from the board- Reading a Map- Face to Face Conversation- Selecting food in the lunchroom

- Following a class schedule- Telephone Conversation- Oral Presentations- Getting an absence excuse

BICS

CALP

ContextReduced

ContextEmbedded

Cognitively Undemanding

Cognitively Demanding

- Copying from the board- Reading a Map- Face to Face Conversation- Selecting food in the lunchroom

- Following a class schedule- Telephone Conversation- Oral Presentations- Getting an absence excuse

- Demonstrations- Basic Math Computations- Science Experiements

BICS

CALP

ContextReduced

ContextEmbedded

Cognitively Undemanding

Cognitively Demanding

- Copying from the board- Reading a Map- Face to Face Conversation- Selecting food in the lunchroom

- Following a class schedule- Telephone Conversation- Oral Presentations- Getting an absence excuse

- Demonstrations- Basic Math Computations- Science Experiements

- Standardized Tests- Math Concepts and Applications- Listening to a Lecture

BICS

CALP

ContextReduced

ContextEmbedded

Cognitively Undemanding

Cognitively Demanding

BICS

CALP

ContextReduced

ContextEmbedded

Cognitively Undemanding

Cognitively Demanding

Foy-Z

BICS

CALP

ContextReduced

ContextEmbedded

Cognitively Undemanding

Cognitively Demanding

Katas

Foy-Z

BICS

CALP

ContextReduced

ContextEmbedded

Cognitively Undemanding

Cognitively Demanding

Katas Koans

Foy-Z

BICS

CALP

ContextReduced

ContextEmbedded

Cognitively Undemanding

Cognitively Demanding

Katas Koans

Adding a new Feature

Foy-Z

BICS

CALP

ContextReduced

ContextEmbedded

Cognitively Undemanding

Cognitively Demanding

Katas Koans

Adding a new Feature

Listening to Code

Foy-Z

Listening to Code

http://www.flickr.com/photos/jn2race/263149573

Listening to Code

Decide to listen

http://www.flickr.com/photos/jn2race/263149573

Listening to Code

Decide to listen Listen for the whole message

http://www.flickr.com/photos/jn2race/263149573

Listening to Code

Let go of your own personal

agenda

Decide to listen Listen for the whole message

http://www.flickr.com/photos/jn2race/263149573

Listening to Code

Let go of your own personal

agenda

Decide to listen Listen for the whole message

Be patient

http://www.flickr.com/photos/jn2race/263149573

Listening to Code

Let go of your own personal

agenda

Decide to listen

Be curious

Listen for the whole message

Be patient

http://www.flickr.com/photos/jn2race/263149573

Listening to Code

Let go of your own personal

agenda

Decide to listen

Be curious

Listen for the whole message

Be patient

Test for understanding

http://www.flickr.com/photos/jn2race/263149573

4 Rules of Simple Design

Does this code express all of the ideas we want to

express?

Are there concepts from our domain

that can be expressed?

Commonality/Variability Analysis

What is common? What varies?

Is it easy to swap the things that vary?

Is it easy to identify the things that are

common?

Fowler’s Perspectives (from UML Distilled)

Are we operating at the right level -

Conceptual, Specification or Implementation?

SOLID Principles

Do we have duplication

(implementation or conceptual)?

Single responsibilities?

LoD violations?

LSP violations?

To Listen, We Must Understand

To Listen, We Must Understand

To Understand, We Must Practice

To Listen, We Must Understand

To Understand, We Must Practice

To Practice, We Must Have Context

To Listen, We Must Understand

To Understand, We Must Practice

To Practice, We Must Have Context

To Listen, We Must Understand

To Understand, We Must Practice

To Practice, We Must Have Context

Cory Foy @cory_foy

foyc@coryfoy.comhttp://www.coryfoy.com

top related