SlideShare ist ein Scribd-Unternehmen logo
1 von 77
F# AS OUR DAY JOB BY 2016
Oslo/NDC Oslo
Tomas Jansson
19/06/2015
THIS IS ME!
Tomas Jansson
Manager & Practice Lead .NET
BEKK Oslo
@TomasJansson
tomas.jansson@bekk.no
github.com/mastoj
slideshare.net/mastoj
blog.tomasjansson.com
http://www.eatsleepcoderepeat.de/beitraege_2013_10.htm
Sad &
misunderstood
C#
95%
F#
5%
Programming at work in 2015
I want to be
the hero!
C#
50%
F#
50%
Programming at work in 2016
Why change?
Time
Awesomeness
TOMAS’ GRAPH OF AWESOMENESS
No change
Time
Awesomeness
TOMAS’ GRAPH OF AWESOMENESS
No change
Change
Time
Awesomeness
TOMAS’ GRAPH OF AWESOMENESS
No change
Change
You can’t
improve without
change!
Application
With plumbing
Application
Extra complexity
Application
Application
Extra complexity
Why do I
like F#?
The facts!
What can
you do?
Why do I
like F#?
#1: Good habits
#2: Separation
#2: Separation
"Objects are not data structures. Objects may use data structures; but
the manner in which those data structures are used or contained is
hidden. This is why data fields are private. From the outside looking in
you cannot see any state. All you can see are functions. Therefore
Objects are about functions not about state."
Uncle Bob - http://blog.cleancoder.com/uncle-bob/2014/11/24/FPvsOO.html
#2: Separation
"Objects are not data structures. Objects may use data structures; but
the manner in which those data structures are used or contained is
hidden. This is why data fields are private. From the outside looking in
you cannot see any state. All you can see are functions. Therefore
Objects are about functions not about state."
Uncle Bob - http://blog.cleancoder.com/uncle-bob/2014/11/24/FPvsOO.html
#3: Null handling
#3: Null handling
Null References: The Billion Dollar Mistake
- Sir Charles Antony Richard Hoare
http://tinyurl.com/TheBillionDollarMistake
#3: Null handling
type Order = {OrderId: int; Total: int}
let getOrder orderId =
match orderId with
| 0 -> None
| _ -> Some { OrderId = orderId
Total = 23*orderId }
let printOrder order =
match order with
| Some o ->
printfn "Order id: %i, Total: %i«
o.OrderId o.Total
| None ->
printfn "No order"
#3: Null handling
type Order = {OrderId: int; Total: int}
let getOrder orderId =
match orderId with
| 0 -> None
| _ -> Some { OrderId = orderId
Total = 23*orderId }
let printOrder order =
match order with
| Some o ->
printfn "Order id: %i, Total: %i«
o.OrderId o.Total
| None ->
printfn "No order"
Returns
Order option
#3: Null handling
type Order = {OrderId: int; Total: int}
let getOrder orderId =
match orderId with
| 0 -> None
| _ -> Some { OrderId = orderId
Total = 23*orderId }
let printOrder order =
match order with
| Some o ->
printfn "Order id: %i, Total: %i«
o.OrderId o.Total
| None ->
printfn "No order"
Returns
Order option
Explicit null
handling!
#3: Null handling
public class Order
{
public int OrderId { get; set; }
public int Total { get; set; }
}
public Order GetOrder(int orderId)
{
if (orderId == 0) return null;
return new Order() {
OrderId = orderId,
Total = 23*orderId };
}
public void PrintOrder(Order order)
{
Console.WriteLine("Order id: {0}, Total: {1}",
order.OrderId, order.Total);
}
#3: Null handling
public class Order
{
public int OrderId { get; set; }
public int Total { get; set; }
}
public Order GetOrder(int orderId)
{
if (orderId == 0) return null;
return new Order() {
OrderId = orderId,
Total = 23*orderId };
}
public void PrintOrder(Order order)
{
Console.WriteLine("Order id: {0}, Total: {1}",
order.OrderId, order.Total);
}
How do I
differ success
from failure?
#3: Null handling
public class Order
{
public int OrderId { get; set; }
public int Total { get; set; }
}
public Order GetOrder(int orderId)
{
if (orderId == 0) return null;
return new Order() {
OrderId = orderId,
Total = 23*orderId };
}
public void PrintOrder(Order order)
{
Console.WriteLine("Order id: {0}, Total: {1}",
order.OrderId, order.Total);
}
How do I
differ success
from failure?
What about
null?
#4: Types
#4: Types
type Customer =
{ CustomerId: Guid
FirstName: string
LastName: string }
#4: Types
public class Customer
{
public Guid CustomerId { get; private set; }
public string FirstName { get; private set; }
public string LastName { get; private set; }
public Customer(Guid customerId, string firstName, string lastName)
{
CustomerId = customerId;
FirstName = firstName;
LastName = lastName;
}
protected bool Equals(Customer other)
{
return CustomerId.Equals(other.CustomerId) &&
string.Equals(FirstName, other.FirstName) &&
string.Equals(LastName, other.LastName);
}
public override bool Equals(object obj)
{
if (ReferenceEquals(null, obj)) return false;
if (ReferenceEquals(this, obj)) return true;
if (obj.GetType() != this.GetType()) return false;
return Equals((Customer) obj);
}
public override int GetHashCode()
{
unchecked
{
var hashCode = CustomerId.GetHashCode();
hashCode = (hashCode*397) ^ (FirstName != null ? FirstName.GetHashCode() : 0);
hashCode = (hashCode*397) ^ (LastName != null ? LastName.GetHashCode() : 0);
return hashCode;
}
}
}
#5: Type providers
Strongly typed «ORM»
SQL JSON XML WCF 

#5: Type providers
#6: Readability
#6: Readability
#6: Readability
#6: Readability
#6: Readability
#6: Readability
#6: Readability
#6: Readability
#6: Readability
#6: Readability
#6: Readability
#6: Readability
#6: Readability
#6: Readability
#6: Readability
#6: Readability
#6: Readability
// Version 1
let executeCommand command =
command |> validate |> log |> execute |> log
let result = executeCommand command
// Version 2
let executeCommand = validate >> log >> execute >> log
let result = executeCommand command
#6: Readability
// Version 1
public ExecutionResult ExecuteCommand(Command command)
{
return Log(Execute(Log(Validate(command))));
}
var result = ExecuteCommand(new Command());
// Version 2
public ExecutionResult ExecuteCommand(Command command)
{
var validationResult = Validate(command);
Log(validationResult);
var executionResult = Execute(validationResult);
Log(executionResult);
return executionResult;
}
var result = ExecuteCommand(new Command());
The facts!
@simontcousins
@ScottWlaschin
http://tinyurl.com/CyclesInTheWild
http://tinyurl.com/DoesTheLanguageMakeADifference
Cycles
Compared 10 C# projects with 10 F# projects
Compared «top-level» types
Top-level type: “a type that is not nested and
which is not compiler generated”
@ScottWlaschin
http://tinyurl.com/CyclesInTheWild
PROJECTS
Mono.Cecil, which inspects programs and libraries in the
ECMA CIL format
NUnit
SignalR for real-time web functionality
NancyFx, a web framework
YamlDotNet, for parsing and emitting YAML
SpecFlow, a BDD tool
Json.NET
Entity Framework
ELMAH, a logging framework for ASP.NET
NuGet itself
Moq, a mocking framework
NDepend, a code analysis tool
FSharp.Core, the core F# library.
FSPowerPack.
FsUnit, extensions for NUnit.
Canopy, a wrapper around the Selenium test automation
tool.
FsSql, a nice little ADO.NET wrapper.
WebSharper, the web framework.
TickSpec, a BDD tool.
FSharpx, an F# library.
FParsec, a parser library.
FsYaml, a YAML library built on FParsec.
Storm, a tool for testing web services.
Foq, a mocking framework.
C# F#
SpecFlow
SpecFlow
I do think SpecFlow is great tool!
TickSpec
Does your
language
matter?
Application to assist in maintaining the stability and security
of the electricity supply in the UK
Existing solution almost fully implemented in C#
Rewritten in F#
@simontcousins
http://tinyurl.com/DoesTheLanguageMakeADifference
“The C# project took five years and peaked at ~8 devs. It never fully
implemented all of the contracts.
The F# project took less than a year and peaked at three devs (only one had
prior experience with F#). All of the contracts were fully implemented.”
http://tinyurl.com/DoesTheLanguageMakeADifference
THE LANGUAGE YOU USE MAKE A DIFFERENCE
Encapsulated small types
Less top-level dependencies
Less «leaky» abstractions
Types and functions must be
defined
Prevents cycles
Encapsulation
Much easier to do in F#
Linear Generics
What can
you do?
ReadCode
http://fsharp.org/
http://www.meetup.com/OsloFSharp/
https://twitter.com/hashtag/fsharp
http://www.peoplevine.com/page/peoplevine-for-startups
Start small,
but think big!
Demo?
RESOURCES
http://fsharpforfunandprofit.com/
http://tinyurl.com/DoesTheLanguageMakeADifference
http://www.meetup.com/OsloFSharp/ (if you live in Oslo)
http://fsharp.org/
Questions?
Thank you!
@TomasJanssonVote!

Weitere Àhnliche Inhalte

Ähnlich wie F# as our day job by 2016

The Power of Composition
The Power of CompositionThe Power of Composition
The Power of CompositionScott Wlaschin
 
Of complicacy of programming, or won't C# save us?
Of complicacy of programming, or won't C# save us?Of complicacy of programming, or won't C# save us?
Of complicacy of programming, or won't C# save us?PVS-Studio
 
Data Mining Open Ap Is
Data Mining Open Ap IsData Mining Open Ap Is
Data Mining Open Ap Isoscon2007
 
The Ring programming language version 1.3 book - Part 30 of 88
The Ring programming language version 1.3 book - Part 30 of 88The Ring programming language version 1.3 book - Part 30 of 88
The Ring programming language version 1.3 book - Part 30 of 88Mahmoud Samir Fayed
 
Extreme Swift
Extreme SwiftExtreme Swift
Extreme SwiftMovel
 
Tdd is not about testing
Tdd is not about testingTdd is not about testing
Tdd is not about testingGianluca Padovani
 
The First C# Project Analyzed
The First C# Project AnalyzedThe First C# Project Analyzed
The First C# Project AnalyzedPVS-Studio
 
PHP and Platform Independance in the Cloud
PHP and Platform Independance in the CloudPHP and Platform Independance in the Cloud
PHP and Platform Independance in the CloudZendCon
 
Writing clean code in C# and .NET
Writing clean code in C# and .NETWriting clean code in C# and .NET
Writing clean code in C# and .NETDror Helper
 
Dsug 05 02-15 - ScalDI - lightweight DI in Scala
Dsug 05 02-15 - ScalDI - lightweight DI in ScalaDsug 05 02-15 - ScalDI - lightweight DI in Scala
Dsug 05 02-15 - ScalDI - lightweight DI in ScalaUgo Matrangolo
 
Clean Code
Clean CodeClean Code
Clean CodeISchwarz23
 
Twins: Object Oriented Programming and Functional Programming
Twins: Object Oriented Programming and Functional ProgrammingTwins: Object Oriented Programming and Functional Programming
Twins: Object Oriented Programming and Functional ProgrammingRichardWarburton
 
Headache from using mathematical software
Headache from using mathematical softwareHeadache from using mathematical software
Headache from using mathematical softwarePVS-Studio
 
Save time by applying clean code principles
Save time by applying clean code principlesSave time by applying clean code principles
Save time by applying clean code principlesEdorian
 
Python for web security - beginner
Python for web security - beginnerPython for web security - beginner
Python for web security - beginnerSanjeev Kumar Jaiswal
 
How to improve the quality of your TYPO3 extensions
How to improve the quality of your TYPO3 extensionsHow to improve the quality of your TYPO3 extensions
How to improve the quality of your TYPO3 extensionsChristian Trabold
 

Ähnlich wie F# as our day job by 2016 (20)

The Power of Composition
The Power of CompositionThe Power of Composition
The Power of Composition
 
Of complicacy of programming, or won't C# save us?
Of complicacy of programming, or won't C# save us?Of complicacy of programming, or won't C# save us?
Of complicacy of programming, or won't C# save us?
 
Data Mining Open Ap Is
Data Mining Open Ap IsData Mining Open Ap Is
Data Mining Open Ap Is
 
The Ring programming language version 1.3 book - Part 30 of 88
The Ring programming language version 1.3 book - Part 30 of 88The Ring programming language version 1.3 book - Part 30 of 88
The Ring programming language version 1.3 book - Part 30 of 88
 
Extreme Swift
Extreme SwiftExtreme Swift
Extreme Swift
 
XAML/C# to HTML/JS
XAML/C# to HTML/JSXAML/C# to HTML/JS
XAML/C# to HTML/JS
 
Tdd is not about testing
Tdd is not about testingTdd is not about testing
Tdd is not about testing
 
The First C# Project Analyzed
The First C# Project AnalyzedThe First C# Project Analyzed
The First C# Project Analyzed
 
PHP and Platform Independance in the Cloud
PHP and Platform Independance in the CloudPHP and Platform Independance in the Cloud
PHP and Platform Independance in the Cloud
 
Writing clean code in C# and .NET
Writing clean code in C# and .NETWriting clean code in C# and .NET
Writing clean code in C# and .NET
 
Dsug 05 02-15 - ScalDI - lightweight DI in Scala
Dsug 05 02-15 - ScalDI - lightweight DI in ScalaDsug 05 02-15 - ScalDI - lightweight DI in Scala
Dsug 05 02-15 - ScalDI - lightweight DI in Scala
 
Good Coding Practices with JavaScript
Good Coding Practices with JavaScriptGood Coding Practices with JavaScript
Good Coding Practices with JavaScript
 
Compiler2016 by abcdabcd987
Compiler2016 by abcdabcd987Compiler2016 by abcdabcd987
Compiler2016 by abcdabcd987
 
Clean Code
Clean CodeClean Code
Clean Code
 
Twins: Object Oriented Programming and Functional Programming
Twins: Object Oriented Programming and Functional ProgrammingTwins: Object Oriented Programming and Functional Programming
Twins: Object Oriented Programming and Functional Programming
 
Headache from using mathematical software
Headache from using mathematical softwareHeadache from using mathematical software
Headache from using mathematical software
 
Save time by applying clean code principles
Save time by applying clean code principlesSave time by applying clean code principles
Save time by applying clean code principles
 
Python for web security - beginner
Python for web security - beginnerPython for web security - beginner
Python for web security - beginner
 
Perfect Code
Perfect CodePerfect Code
Perfect Code
 
How to improve the quality of your TYPO3 extensions
How to improve the quality of your TYPO3 extensionsHow to improve the quality of your TYPO3 extensions
How to improve the quality of your TYPO3 extensions
 

Mehr von Tomas Jansson

Functional webapplicaations using fsharp and suave
Functional webapplicaations using fsharp and suaveFunctional webapplicaations using fsharp and suave
Functional webapplicaations using fsharp and suaveTomas Jansson
 
What does the future hold for us in asp.net 5
What does the future hold for us in asp.net 5What does the future hold for us in asp.net 5
What does the future hold for us in asp.net 5Tomas Jansson
 
OWIN Web API with Linky
OWIN Web API with LinkyOWIN Web API with Linky
OWIN Web API with LinkyTomas Jansson
 
File -> new project to deploy in 10 minutes with TeamCity and Octopus Deploy
File -> new project to deploy in 10 minutes with TeamCity and Octopus DeployFile -> new project to deploy in 10 minutes with TeamCity and Octopus Deploy
File -> new project to deploy in 10 minutes with TeamCity and Octopus DeployTomas Jansson
 
Getting started with Elasticsearch and .NET
Getting started with Elasticsearch and .NETGetting started with Elasticsearch and .NET
Getting started with Elasticsearch and .NETTomas Jansson
 
Deployment taken seriously with Octopus Deploy and TeamCity
Deployment taken seriously with Octopus Deploy and TeamCityDeployment taken seriously with Octopus Deploy and TeamCity
Deployment taken seriously with Octopus Deploy and TeamCityTomas Jansson
 
State or intent
State or intentState or intent
State or intentTomas Jansson
 
NServiceBus workshop presentation
NServiceBus workshop presentationNServiceBus workshop presentation
NServiceBus workshop presentationTomas Jansson
 
SignalR - Building an async web app with .NET
SignalR - Building an async web app with .NETSignalR - Building an async web app with .NET
SignalR - Building an async web app with .NETTomas Jansson
 
REST for .NET - Introduction to ASP.NET Web API
REST for .NET - Introduction to ASP.NET Web APIREST for .NET - Introduction to ASP.NET Web API
REST for .NET - Introduction to ASP.NET Web APITomas Jansson
 

Mehr von Tomas Jansson (11)

Functional webapplicaations using fsharp and suave
Functional webapplicaations using fsharp and suaveFunctional webapplicaations using fsharp and suave
Functional webapplicaations using fsharp and suave
 
What does the future hold for us in asp.net 5
What does the future hold for us in asp.net 5What does the future hold for us in asp.net 5
What does the future hold for us in asp.net 5
 
OWIN Web API with Linky
OWIN Web API with LinkyOWIN Web API with Linky
OWIN Web API with Linky
 
Roslyn
RoslynRoslyn
Roslyn
 
File -> new project to deploy in 10 minutes with TeamCity and Octopus Deploy
File -> new project to deploy in 10 minutes with TeamCity and Octopus DeployFile -> new project to deploy in 10 minutes with TeamCity and Octopus Deploy
File -> new project to deploy in 10 minutes with TeamCity and Octopus Deploy
 
Getting started with Elasticsearch and .NET
Getting started with Elasticsearch and .NETGetting started with Elasticsearch and .NET
Getting started with Elasticsearch and .NET
 
Deployment taken seriously with Octopus Deploy and TeamCity
Deployment taken seriously with Octopus Deploy and TeamCityDeployment taken seriously with Octopus Deploy and TeamCity
Deployment taken seriously with Octopus Deploy and TeamCity
 
State or intent
State or intentState or intent
State or intent
 
NServiceBus workshop presentation
NServiceBus workshop presentationNServiceBus workshop presentation
NServiceBus workshop presentation
 
SignalR - Building an async web app with .NET
SignalR - Building an async web app with .NETSignalR - Building an async web app with .NET
SignalR - Building an async web app with .NET
 
REST for .NET - Introduction to ASP.NET Web API
REST for .NET - Introduction to ASP.NET Web APIREST for .NET - Introduction to ASP.NET Web API
REST for .NET - Introduction to ASP.NET Web API
 

KĂŒrzlich hochgeladen

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...Neo4j
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
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 DevelopmentsTrustArc
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
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...Drew Madelung
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
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 AutomationSafe Software
 
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 WorkerThousandEyes
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
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 Takeoffsammart93
 
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...Martijn de Jong
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
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...apidays
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 

KĂŒrzlich hochgeladen (20)

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...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
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
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
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...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
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
 
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
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
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
 
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...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
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...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 

F# as our day job by 2016

Hinweis der Redaktion

  1. Welcome! I’m glad you made it. Almost the end of the conference
  2. As most of you I eas sleep, code and repeat Not 100% satisified
  3. Misunderstood Solving problem suboptimal in C#, and the language is part of the problem
  4. As you can see here
  5. Live like a super hero in 2016
  6. Need to change to this 100% would be stretching it because of legacy C#  Would never make me feel like a super hero
  7. The industry is not in a good shape To improve we need to change I studied myself for two periods, one period where I refused change and one where I embraced it, the result were mind blowing
  8. Awesomeness decreased if no change World was changing and I didn’t embrace it
  9. It’s not a smooth ride, but if I’m willing to change I can stop bad trends
  10. Applies to all of us in many situations Bryan Hunter Lean & FP You need to measure and continuosly improve
  11. So what can change? Let’s consider an application. In ideal world the code would match the application and every line would produce value
  12. Reality is that we need to do a lot of plumbing
  13. The plumbing is both in the domain and just access to external services for example. All the code that doesn’t produce value is extra complexity
  14. Decreasing extra complexity would lead to more value delivered
  15. That leads us to the agenda. Why will give you some of my technical arguments to why I like F# The facts show you some number from two different studies How you can get started and what you can do
  16. Enforces more good habits then C#, still need dicipline. But F# set you up in a much better position than C# and many other languages. Higher order reason Better type checking and less typing, because of better inference and linear style programming more declarative than C# imperative style  I can focus on what and let the language deal with how
  17. Proper F# separates data structures and functions in a healthy way C# mixes them and stores state internally
  18. Uncle Bob wrote this in a post about Functional Programming vs. OO
  19. Let’s highlight some important parts Objects are not data structures – but why do we tie them so tightly together? All you can see are functions – focus on functions Objects are about functions These are good points, but it almost feel like he is trying to explain something that better fits in a FP language than OO. Immutable by default.
  20. Do I really need to say something?
  21. Known as Tony Hoare, introduced it in Algol 1965. Talk from 2009
  22. It’s not much less code than a C# version of the same thing, but let’s look at the details
  23. Instea of returning something of type Order we’re returning an Option, which you can think of as nullable for everyt kind of type.  must handle missing order explicit
  24. Instea of returning something of type Order we’re returning an Option, which you can think of as nullable for everyt kind of type.  must handle missing order explicit
  25. Looks ok.
  26. How was I suppose to know I should handle null? The compiler doesn’t tell me!
  27. How was I suppose to know I should handle null? The compiler doesn’t tell me!
  28. I won’t cover everything about types, but they are awesome in F#. Much more powerful than they are in C#.
  29. This is something you can grasp You see the data and you know it is immutable and have structural equality
  30. Let’s check the C# version Here it is much more harder to reason about what the structure give us Am I trying to do it immutable? (yes) Equality? (yes) Is it correct? (Who knows?) – resharper told me it is
  31. This is probably one of thing you can start using quite easily in your own projects to replace ORM and endpoint clients ORM Strongly typed Multiple sources
  32. Automatic types Intelli sense
  33. Often you here people complaining about readability in Functional languages
  34. So let us check this conversation I had with C#Hero
  35. Two simple ways of implementing a function that’s clear what it does Reads left to right in both examples Of course you need to know the pipeline syntax and binding syntax, but that is just syntax!
  36. More noise Reversed logic from inner to outer or right to left, instead of left to right
  37. Dependecies and cycles Scott Wlaschin – Evelina Gabasova made som further studies – based on the first study Comparison of C# and F# Simon Cousins
  38. What is top-level type? Tries to define modularity? Need to find a balance of modularity!
  39. TickSpec and SpecFlow is sort of comparable
  40. Much more top-level types It might be more pluggable, but not necessary because of generics It might also be harder to use and develop in since there are more top-level types to integrate with Doesn’t say that much by itself so let’s check dependencies
  41. Dependencies is good if can keep it down, because then we have module that fit in our head Harder to reason
  42. Here you see how the depencies are distributed among number of dependencies When there are dependencies they are much less of them, because generics and internal types
  43. Almost no cycles in F# projects Fewer depencies -> less likely to have cycles Linear programming -> hard to introduce cycles
  44. Visualization of two «comparable» projects It’s hard to grasp what this project does Maybe harder to fix bug
  45. Provides a lot of the same features Maybe not as many, but I think the structure looks simpler here
  46. Knew more about the domain I think Doesn’t explain a 1:10 ratio between LOC for F# vs C#
  47. Less code  less code to test  higher test ratio Less code  less boiler plate  more useful code
  48. The language you use do make a difference! Why do we get these results in these two studeis? Correctnes – fewer bugs Conciseness  Reason about the code
  49. So what can you do to start using these super powers?
  50. You do need to code & read! If you don’t know the strengths and weaknesses it’s hard to discuss and argue for them You have to put in the hours that Yan talked about in his languages talk Wednesday
  51. There is an amazing community out there that are willing to help!
  52. If you live in Oslo, reach out to the new F# meetup! If not in Oslo, go on twitter and the #fsharp tag and follown along and engage or check the F# foundation Don’t’ wait for the community, be the community
  53. Start small to try it out Test Tools DTOs Data layers -> Demo