45 f#antastic minutes!

33
Alex Casquete acasquete 45 F#antastic minutes!

Upload: alex-casquete

Post on 10-May-2015

129 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: 45 F#antastic minutes!

Getting Started with F#

Alex Casqueteacasquete

45 F#antastic minutes!

Page 2: 45 F#antastic minutes!

Alex Casqueteacasquete

Page 3: 45 F#antastic minutes!

Functional Programming

is not newbut is ignored

until now

Page 4: 45 F#antastic minutes!

Process large datasetsScale to processors & computers

Easily testingDeclarative logic

The Challenges

Page 5: 45 F#antastic minutes!

“Take the next ticket from a list. If theticket is not printed, send to print. If

there are more tickets in the list, go tothe begining.”

Page 6: 45 F#antastic minutes!

“Run the first command for everycustomer for which the second

command returns true.”

Page 7: 45 F#antastic minutes!

“Send to print every ticket that is not printed.”

Page 8: 45 F#antastic minutes!

“Take the next ticket from a list. If theticket is not printed, send to print. If

there are more tickets in the list, go tothe begining.”

“Send to print every ticket that is not printed.”

Page 9: 45 F#antastic minutes!

Thinking difɘrɘntlySay “what” rather than “how”

Page 10: 45 F#antastic minutes!

foreach (Ticket t in Tickets){

if (!t.IsPrinted){

Print(t);}

}

Tickets.Where(t=>!t.IsPrinted).ToList().ForEach(t => Print(t));

Thinking difɘrɘntly in C#

Imperative Declarative

Page 11: 45 F#antastic minutes!

Functional Basic ConceptsDemo: From C# to F#

Page 12: 45 F#antastic minutes!

Functional Basic ConceptsImmutability

RecursionHigher order

Page 13: 45 F#antastic minutes!

10 Reasons not to useFunctional Programming

<ironic>

</ironic>

Page 14: 45 F#antastic minutes!

Reason 1I don't want to follow the latest fad

Page 15: 45 F#antastic minutes!

Reason 2I get paid by the line

I get paid by the line

I get paid by the line

Page 16: 45 F#antastic minutes!

Reason 3{ I love me some curly braces }

Page 17: 45 F#antastic minutes!

Reason 4string s = “I like to see explicit types”;

Page 18: 45 F#antastic minutes!

Reason 5I like to fix vugs

Page 19: 45 F#antastic minutes!

Reason 6I live in the debugger

Page 20: 45 F#antastic minutes!

Reason 7I don't want to think about

every little detail

Page 21: 45 F#antastic minutes!

Reason 8I like to check for != nulls

Page 22: 45 F#antastic minutes!

Reason 9I like to use

design patterns everywhere

Page 23: 45 F#antastic minutes!

Reason 10It's very freaky

Page 24: 45 F#antastic minutes!

Why use F#?The Five C’s

Page 25: 45 F#antastic minutes!

ConcisenessConvenienceCorrectnessConcurrency

Completeness

Page 26: 45 F#antastic minutes!

Understanding F#

Page 27: 45 F#antastic minutes!

Data, Services, Information

Access

Transformations, Analysis,

Algorithms, Code, Parallel

Presentation, Publication, Experience

F# 3.0 F# 2.0 C#, HTML5, JS

Page 28: 45 F#antastic minutes!

Type providersDemo: OData, WSDL

Page 29: 45 F#antastic minutes!

More Resources?

Page 30: 45 F#antastic minutes!
Page 31: 45 F#antastic minutes!

http://Fsharp.org

http://FsharpForFunAndProfit.com

http://www.fssnip.net/

Page 32: 45 F#antastic minutes!

Thanks! Questions?

Alex Casqueteacasquete

Page 33: 45 F#antastic minutes!