Top Banner
35
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Functional Programming in an Imperitive World
Page 2: Functional Programming in an Imperitive World

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…

Page 3: Functional Programming in an Imperitive World

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

Page 4: Functional Programming in an Imperitive World
Page 5: Functional Programming in an Imperitive World

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

Page 6: Functional Programming in an Imperitive World

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

Page 7: Functional Programming in an Imperitive World

•Change is hard – and risky

•Need to convince:

•Management

•Your peers

Fear is the mind killer

Page 8: Functional Programming in an Imperitive World
Page 9: Functional Programming in an Imperitive World

[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

Page 10: Functional Programming in an Imperitive World

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

Page 11: Functional Programming in an Imperitive World

•Fix the badly broken

Dilute the risk

Page 12: Functional Programming in an Imperitive World

<?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>

Page 13: Functional Programming in an Imperitive World
Page 14: Functional Programming in an Imperitive World

•Fix the badly broken

•Pick an interoperable language

Dilute the risk

Page 15: Functional Programming in an Imperitive World
Page 16: Functional Programming in an Imperitive World
Page 17: Functional Programming in an Imperitive World
Page 18: Functional Programming in an Imperitive World
Page 19: Functional Programming in an Imperitive World
Page 20: Functional Programming in an Imperitive World

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

Page 21: Functional Programming in an Imperitive World

•What’s so risky it’s never been

done?

•Can a functional language help?

Do the impossible

Page 22: Functional Programming in an Imperitive World

“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

Page 23: Functional Programming in an Imperitive World

TypeProviders

Page 24: Functional Programming in an Imperitive World

PatternMatching

Page 25: Functional Programming in an Imperitive World

Concurrency

Page 26: Functional Programming in an Imperitive World

Currying

Page 27: Functional Programming in an Imperitive World

Metaprogramming

Page 28: Functional Programming in an Imperitive World

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

Page 29: Functional Programming in an Imperitive World

• 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

Page 30: Functional Programming in an Imperitive World

Actors

Page 31: Functional Programming in an Imperitive World

Property Based Testing

Page 32: Functional Programming in an Imperitive World
Page 33: Functional Programming in an Imperitive World

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

Page 34: Functional Programming in an Imperitive World

Teach

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

Page 35: Functional Programming in an Imperitive World

“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