SlideShare a Scribd company logo
1 of 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!

More Related Content

Similar to 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
Ā 
Compiler2016 by abcdabcd987
Compiler2016 by abcdabcd987Compiler2016 by abcdabcd987
Compiler2016 by abcdabcd987乐ē¾¤ 陈
Ā 
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
Ā 

Similar to 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
Ā 

More from 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
Ā 

More from 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
Ā 

Recently uploaded

08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
Ā 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
Ā 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
Ā 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
Ā 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
Ā 
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
Ā 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
Ā 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
Ā 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
Ā 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
Ā 
Finology Group ā€“ Insurtech Innovation Award 2024
Finology Group ā€“ Insurtech Innovation Award 2024Finology Group ā€“ Insurtech Innovation Award 2024
Finology Group ā€“ Insurtech Innovation Award 2024The Digital Insurer
Ā 
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
Ā 
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 educationjfdjdjcjdnsjd
Ā 
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 productivityPrincipled Technologies
Ā 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
Ā 
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
Ā 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel AraĆŗjo
Ā 
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
Ā 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
Ā 
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 Processorsdebabhi2
Ā 

Recently uploaded (20)

08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
Ā 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
Ā 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
Ā 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
Ā 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
Ā 
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
Ā 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Ā 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
Ā 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Ā 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Ā 
Finology Group ā€“ Insurtech Innovation Award 2024
Finology Group ā€“ Insurtech Innovation Award 2024Finology Group ā€“ Insurtech Innovation Award 2024
Finology Group ā€“ Insurtech Innovation Award 2024
Ā 
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
Ā 
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
Ā 
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
Ā 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
Ā 
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
Ā 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Ā 
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
Ā 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
Ā 
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
Ā 

F# as our day job by 2016

Editor's Notes

  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