SlideShare a Scribd company logo
1 of 80
F# Eye for the C# guy Leon Bambrick, secretGeek.net
F#... Do not be afraid.
hello
I’m F #
 
functional
Purely functional… ,[object Object],[object Object],[object Object]
Purely functional… ,[object Object],[object Object]
Purely functional… ,[object Object],[object Object]
Purely functional… ,[object Object],[object Object]
[object Object],Purely functional…
[object Object]
[object Object],[object Object],Why learn F#?
[object Object],[object Object],[object Object],Why learn F#?
[object Object],[object Object],[object Object],[object Object],Why learn F#?
[object Object],Why learn F#?
[object Object],Why learn F#?
[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object]
 
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Computer Economics is Changing
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Computer Economics is Changing
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Computer Economics is Changing
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Computer Economics is Changing
This  tips the balance  toward higher abstractions
Some Applications of F# ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Think About Game Programming
Game Programming Involves… ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Genealogy of F #  … ,[object Object]
Genealogy of F #  … ,[object Object],[object Object]
Genealogy of F #  … ,[object Object],[object Object],[object Object]
Genealogy of F #  … ,[object Object],[object Object],[object Object],[object Object],Oh!
Genealogy of F #  … ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Oh!
WTF # ? ,[object Object]
WTF # ? ,[object Object],[object Object]
WTF # ? ,[object Object],[object Object],[object Object]
WTF # ? ,[object Object],[object Object],[object Object],[object Object]
Code! ,[object Object]
Code! ,[object Object],[object Object]
Code! ,[object Object],[object Object],The ‘let’ keyword represents a binding between a value and an expression tree.
Code! ,[object Object],[object Object],The ‘let’ blah blah blahblah blah blahblah blahblah blah blah blah blah blah blah.
Code! ,[object Object],[object Object],//C# int a = 2 ≠
Code! ,[object Object],[object Object],//C# //a function! static int a() { return 2; } More like
More Code! ,[object Object],[object Object],[object Object],[object Object],[object Object],//C# using  System; namespace  ConsoleApplication1 { class   Program { static   int  a() { return  2; } static void  Main( string [] args) { Console .WriteLine(a);  } } }
More Code! ,[object Object],[object Object],[object Object],[object Object],[object Object],More Noise  Than Signal!
More Code! ,[object Object],[object Object],[object Object],[object Object],[object Object],Looks Weakly typed? Maybe Dynamic?
F#?
F#
F# Yet Expressive
F# Yet Versatile
More Code! ,[object Object],[object Object],[object Object],[object Object],[object Object],Type Inference
[object Object],[object Object],[object Object],Immutable by default
[object Object],[object Object],[object Object],[object Object],simple function…
[object Object],[object Object],[object Object],[object Object],simple function… Parameter
[object Object],[object Object],[object Object],[object Object],simple function… “ Signature”
[object Object],[object Object],[object Object],[object Object],simple function… Types are “inferred”
Discriminated union types ,[object Object],[object Object],[object Object]
Discriminated union types ,[object Object],[object Object],[object Object],Wish C#/“O-O” had this.
Discriminated union types ,[object Object],[object Object],[object Object],“ O-O” has discriminated union envy When the only tool you have is a hammer Everything looks like a nail
Discriminated union types ,[object Object],[object Object],[object Object],“ O-O” has discriminated union envy When the only tool you have is a hammer Everything looks like a nail e.g. “Inheritance” ends up being used in places where it’s not a perfect fit…
Discriminated union types ,[object Object],[object Object],[object Object],“ O-O” has discriminated union envy When the only tool you have is a hammer Everything looks like a nail e.g. “Inheritance” ends up being used in places where it’s not a perfect fit… ‘ Discriminated union types’ -- a better fit for some problems?
Another great tool is  “pattern matching”
Another great tool is   “pattern matching” “ Switch/Case” statements on steroids
Another great tool is   “pattern matching” “ Switch/Case” statements on steroids “ method overloads” on crack
Discriminated unions   example ,[object Object],[object Object],[object Object],[object Object]
Pattern Matching ,[object Object],[object Object],[object Object],[object Object],//block any weapon! let block w = match w with | Knife  | Gun  -> disarm w | _ -> difuse w block Gun block Knife block Bomb
Pattern Matching ,[object Object],[object Object],[object Object],[object Object],//block any weapon let block w = match w with | Knife  | Gun  -> disarm w | _ -> difuse w block Gun block Knife block Bomb
Lazy is a virtue ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Lazy is a virtue ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Useful libraries Neat manual Awesome Samples
 
 
“ Empty” source file… 5 pages of help!
Make sure F# Interactive is running!
F# Interactive: ,[object Object]
F# Interactive:
 
[object Object]
8 Ways to Learn ,[object Object],[object Object],[object Object],[object Object]
Acknowledgements ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

More Related Content

What's hot

What's hot (20)

Python Introduction
Python IntroductionPython Introduction
Python Introduction
 
Advanced C Language for Engineering
Advanced C Language for EngineeringAdvanced C Language for Engineering
Advanced C Language for Engineering
 
Practical F#
Practical F#Practical F#
Practical F#
 
C languaGE UNIT-1
C languaGE UNIT-1C languaGE UNIT-1
C languaGE UNIT-1
 
JavaScript: Core Part
JavaScript: Core PartJavaScript: Core Part
JavaScript: Core Part
 
Python Programming - I. Introduction
Python Programming - I. IntroductionPython Programming - I. Introduction
Python Programming - I. Introduction
 
C tutorial
C tutorialC tutorial
C tutorial
 
The smartpath information systems c pro
The smartpath information systems c proThe smartpath information systems c pro
The smartpath information systems c pro
 
Learning c - An extensive guide to learn the C Language
Learning c - An extensive guide to learn the C LanguageLearning c - An extensive guide to learn the C Language
Learning c - An extensive guide to learn the C Language
 
Parsing
ParsingParsing
Parsing
 
Parsing
ParsingParsing
Parsing
 
C language ppt
C language pptC language ppt
C language ppt
 
C++ ppt
C++ pptC++ ppt
C++ ppt
 
Python Basics
Python BasicsPython Basics
Python Basics
 
Introduction to C Programming - I
Introduction to C Programming - I Introduction to C Programming - I
Introduction to C Programming - I
 
What is Python? An overview of Python for science.
What is Python? An overview of Python for science.What is Python? An overview of Python for science.
What is Python? An overview of Python for science.
 
Introduction to C programming
Introduction to C programmingIntroduction to C programming
Introduction to C programming
 
Basic C Programming language
Basic C Programming languageBasic C Programming language
Basic C Programming language
 
OpenGurukul : Language : C Programming
OpenGurukul : Language : C ProgrammingOpenGurukul : Language : C Programming
OpenGurukul : Language : C Programming
 
C programming Ms. Pranoti Doke
C programming Ms. Pranoti DokeC programming Ms. Pranoti Doke
C programming Ms. Pranoti Doke
 

Similar to F# Eye for the C# Guy

Douglas Crockford Presentation Goodparts
Douglas Crockford Presentation GoodpartsDouglas Crockford Presentation Goodparts
Douglas Crockford Presentation Goodparts
Ajax Experience 2009
 
Your Library Sucks, and why you should use it.
Your Library Sucks, and why you should use it.Your Library Sucks, and why you should use it.
Your Library Sucks, and why you should use it.
Peter Higgins
 

Similar to F# Eye for the C# Guy (20)

Mike Kotsur - What can philosophy teach us about programming - Codemotion Ams...
Mike Kotsur - What can philosophy teach us about programming - Codemotion Ams...Mike Kotsur - What can philosophy teach us about programming - Codemotion Ams...
Mike Kotsur - What can philosophy teach us about programming - Codemotion Ams...
 
Douglas Crockford - Programming Style and Your Brain
Douglas Crockford - Programming Style and Your BrainDouglas Crockford - Programming Style and Your Brain
Douglas Crockford - Programming Style and Your Brain
 
Section 8 Programming Style and Your Brain: Douglas Crockford
Section 8 Programming Style and Your Brain: Douglas CrockfordSection 8 Programming Style and Your Brain: Douglas Crockford
Section 8 Programming Style and Your Brain: Douglas Crockford
 
Claudia Doppioslash - Time Travel for game development with Elm
Claudia Doppioslash - Time Travel for game development with ElmClaudia Doppioslash - Time Travel for game development with Elm
Claudia Doppioslash - Time Travel for game development with Elm
 
Tour of language landscape (code.talks)
Tour of language landscape (code.talks)Tour of language landscape (code.talks)
Tour of language landscape (code.talks)
 
Tour of language landscape (katsconf)
Tour of language landscape (katsconf)Tour of language landscape (katsconf)
Tour of language landscape (katsconf)
 
Apex for humans
Apex for humansApex for humans
Apex for humans
 
Goodparts
GoodpartsGoodparts
Goodparts
 
JS Fest 2018. Douglas Crockford. The Better Parts
JS Fest 2018. Douglas Crockford. The Better PartsJS Fest 2018. Douglas Crockford. The Better Parts
JS Fest 2018. Douglas Crockford. The Better Parts
 
F# for startups
F# for startupsF# for startups
F# for startups
 
JavaScript Best Pratices
JavaScript Best PraticesJavaScript Best Pratices
JavaScript Best Pratices
 
All of javascript
All of javascriptAll of javascript
All of javascript
 
C 2
C 2C 2
C 2
 
Tour of language landscape (BuildStuff)
Tour of language landscape (BuildStuff)Tour of language landscape (BuildStuff)
Tour of language landscape (BuildStuff)
 
Douglas Crockford Presentation Goodparts
Douglas Crockford Presentation GoodpartsDouglas Crockford Presentation Goodparts
Douglas Crockford Presentation Goodparts
 
A Multiplatform, Multi-Tenant Challenge - Droidcon Lisbon 2023
A Multiplatform, Multi-Tenant Challenge - Droidcon Lisbon 2023A Multiplatform, Multi-Tenant Challenge - Droidcon Lisbon 2023
A Multiplatform, Multi-Tenant Challenge - Droidcon Lisbon 2023
 
Evolve Your Code
Evolve Your CodeEvolve Your Code
Evolve Your Code
 
Your Library Sucks, and why you should use it.
Your Library Sucks, and why you should use it.Your Library Sucks, and why you should use it.
Your Library Sucks, and why you should use it.
 
Rasmus, Think Again! Agile Framework == Happy Php Developer
Rasmus, Think Again! Agile Framework == Happy Php DeveloperRasmus, Think Again! Agile Framework == Happy Php Developer
Rasmus, Think Again! Agile Framework == Happy Php Developer
 
Build a compiler using C#, Irony and RunSharp.
Build a compiler using C#, Irony and RunSharp.Build a compiler using C#, Irony and RunSharp.
Build a compiler using C#, Irony and RunSharp.
 

Recently uploaded

Recently uploaded (20)

Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 

F# Eye for the C# Guy

Editor's Notes

  1. What’s this F# thing anyway?