functional programming in an imperitive world

35

Upload: michael-newton

Post on 14-Aug-2015

350 views

Category:

Software


0 download

TRANSCRIPT

Once upon a time there was a small company

with a large codebase. That codebase had been

written in the well understood languages of

"VeeBeeDotNet" and "CeeSharp".

After a while, more people started working for the

small company, and while they all knew some

“CeeSharp” and “VeeBeeDotNet”, some of them

also spoke strange foreign languages like "Erlang"

and "EffSharp". They liked these languages, and

were unwilling to give up what they saw as their

powerful magical properties of purity. So they

hatched a plan…

etting thescene

"Alphabet-Golden-Bible-letter-S" by SVG Perhelion (Original unknown) - Own work; Shaw, Henry: “Alphabets & Numbers of the Middle Ages” (1845) FROM THE GOLDEN BIBLE, printed at Augsburg[1] http://www.archive.org/details/handbookofmediae00shawrich. Licensed under CC BY 3.0 via Wikimedia Commons -http://commons.wikimedia.org/wiki/File:Alphabet-Golden-Bible-letter-S.svg#/media/File:Alphabet-Golden-Bible-letter-S.svg

https://www.flickr.com/photos/donkeyhotey/16339664626 CC licensed - http://creativecommons.org/licenses/by-nc-sa/2.0/

ear is themind killer

"Alphabet-Golden-Bible-letter-F" by SVG Perhelion (Original unknown) - Own work; Shaw, Henry: “Alphabets & Numbers of the Middle Ages” (1845) FROM THE GOLDEN BIBLE, Printed at Augsburg[1] http://www.archive.org/details/handbookofmediae00shawrich. Licensed under CC BY 3.0 via Wikimedia Commons -http://commons.wikimedia.org/wiki/File:Alphabet-Golden-Bible-letter-F.svg#/media/File:Alphabet-Golden-Bible-letter-F.svg

•Change is hard – and risky

•Need to convince:

•Management

•Your peers

Fear is the mind killer

[Dan Luu’s] post “The Empirical

Evidence That Types Affect Productivity

and Correctness” summarizes a large

set of papers and goes through each

one in order to describe what it is

trying to measure and how well it does

it. In almost every paper, he has valid

critique of the experiment, methodology

and approach.

https://medium.com/@jlouis666/proglang-design-with-evidence-1444213f3902

ilute the risk

"Alphabet-Golden-Bible-letter-D" by SVG Perhelion (Original unknown) - Own work; Shaw, Henry: “Alphabets & Numbers of the Middle Ages” (1845) FROM THE GOLDEN BIBLE, Printed at Augsburg[1] http://www.archive.org/details/handbookofmediae00shawrich. Licensed under CC BY 3.0 via Wikimedia Commons -http://commons.wikimedia.org/wiki/File:Alphabet-Golden-Bible-letter-F.svg#/media/File:Alphabet-Golden-Bible-letter-D.svg

•Fix the badly broken

Dilute the risk

<?xml version="1.0" encoding="utf-8"?>

<Project ToolsVersion="12.0" DefaultTargets

<Import Project="$(MSBuildExtensionsPath

<PropertyGroup>

<Configuration Condition=" '$(Configuration)'

<Platform Condition=" '$(Platform)' == '' ">

<SchemaVersion>2.0</SchemaVersion

<ProjectGuid>023b9a33-3d12-4878-

<OutputType>Library</OutputType>

•Fix the badly broken

•Pick an interoperable language

Dilute the risk

o the impossible

"Alphabet-Golden-Bible-letter-D" by SVG Perhelion (Original unknown) - Own work; Shaw, Henry: “Alphabets & Numbers of the Middle Ages” (1845) FROM THE GOLDEN BIBLE, Printed at Augsburg[1] http://www.archive.org/details/handbookofmediae00shawrich. Licensed under CC BY 3.0 via Wikimedia Commons -http://commons.wikimedia.org/wiki/File:Alphabet-Golden-Bible-letter-F.svg#/media/File:Alphabet-Golden-Bible-letter-D.svg

•What’s so risky it’s never been

done?

•Can a functional language help?

Do the impossible

“Ripper 5” Storn Cook, http://www.enworld.org/forum/showthread.php?161795-Storn-s-art-for-swipin-!/page12CC licensed - http://creativecommons.org/licenses/by-nc-sa/2.5/

The Heroes

TypeProviders

PatternMatching

Concurrency

Currying

Metaprogramming

teal from the best

"Alphabet-Golden-Bible-letter-S" by SVG Perhelion (Original unknown) - Own work; Shaw, Henry: “Alphabets & Numbers of the Middle Ages” (1845) FROM THE GOLDEN BIBLE, printed at Augsburg[1] http://www.archive.org/details/handbookofmediae00shawrich. Licensed under CC BY 3.0 via Wikimedia Commons -http://commons.wikimedia.org/wiki/File:Alphabet-Golden-Bible-letter-S.svg#/media/File:Alphabet-Golden-Bible-letter-S.svg

• If you can’t go to the functional

language…

•…bring the functional concepts

to yours

•And then tell people where they

came from!

Steal from the best

Actors

Property Based Testing

inally

"Alphabet-Golden-Bible-letter-F" by SVG Perhelion (Original unknown) - Own work; Shaw, Henry: “Alphabets & Numbers of the Middle Ages” (1845) FROM THE GOLDEN BIBLE, Printed at Augsburg[1] http://www.archive.org/details/handbookofmediae00shawrich. Licensed under CC BY 3.0 via Wikimedia Commons -http://commons.wikimedia.org/wiki/File:Alphabet-Golden-Bible-letter-F.svg#/media/File:Alphabet-Golden-Bible-letter-F.svg

Teach

https://www.flickr.com/photos/vancouver-archives/6345489958CC licensed - http://creativecommons.org/licenses/by-nc-sa/2.0/

“Old Paper” background courtesy of http://www.pieceofeight.com/https://www.flickr.com/photos/67779350@N00/167159577/ Attribution 2.0 Generic (CC BY 2.0)

Questions?@mavnn

http://blog.mavnn.co.uk

@15below_techhttp://www.15below.com