Upgrade to Pro — share decks privately, control downloads, hide ads and more …

.NET Day 19 - Go Pro on .NET with F# by Isaac Abraham

.NET Day 19 - Go Pro on .NET with F# by Isaac Abraham

F# has been a part of .NET since the early days of the Framework, yet it still is relatively unknown for a large majority of the .NET developer community. But why is this? With the rise of .NET Core, and with C# going through a large transition at the moment with features such as tuples, pattern matching and non-nullability all influenced from F#, it's never been easier to start using F# today. This talk will cover the discuss the fundamentals of functional programming, cover the basic value proposition of F#, illustrate the philosophy and key language features behind the language, with examples comparing equivalent solutions in C# and F#, as well as looking at the typical life cycle for F# developers. We'll finish up with some demos that show use cases of F# and how, when using a language that has functional programming at its heart, you can "level up" and achieve large boosts in both productivity and developer satisfaction.

dotnetday

May 28, 2019
Tweet

More Decks by dotnetday

Other Decks in Technology

Transcript

  1. Type Providers Exhaustive Pattern Matching Active Patterns Proper Type Inference

    Quotations Records Sum Types Immutability Lightweight syntax Computation Expressions Curried Functions Pipelines Object Initializers Scripting Modules Tail Recursion
  2. • Inheritance • Nulls • Method overloading Run away •

    Mutable data • Events • Enums • Casting • Statements Use with care • Stateless objects • Interfaces • Dot notation • Index notation • Instance members These are good
  3. C# is good enough for me 49% F# is too

    complicated 10% It's not an appropriate fit 9% My company don't allow it 32%
  4. A B C D E F G H I J

    • • • • • •
  5. Designer- first File -> New Project Code generation Closed source

    Code-first CLI tooling Useful APIs Open source
  6. C#2 • Anonymous Functions • Iterators C#3 • Lambda Expressions

    • Type Inference • Extension Methods C#7 • Tuples • Pattern Matching • Local Functions C#8 • Pattern Matching v2 • Switch Expressions • Nullable reference types
  7. C# • Implicit Conversions • Mutability • Overloading • Cyclical

    References F# • Curried Functions • Pipelines • Type Inference • Lightweight Syntax
  8. Implicit conversions Protected access modifier Easy nulls and “part- initialised”

    objects Mutation Cyclical references Implicit expressions Function overloading Open type hierarchies void Early return
  9. Lets you reason about code more easily Lets the compiler

    reason about code more easily Reduce the chance of bugs Results in more succinct code
  10. Developer Happiness Trust the platform • Backed by MS •

    Cross Platform • Huge ecosystem Feel supported • Community-led • Open Source • Commercial Feel productive • REPL • Type Inference • Lightweight Syntax Trust the code • Expressions • Immutability • Sum Types
  11. Spend 30 minutes reading up on F# Get a book,

    make a plan Try hello world Try a simple application Port an application or module that you know Start using F# in your organisation!