• Like
Getting+started+with+f#+web+development
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

Getting+started+with+f#+web+development

  • 2,367 views
Published

Getting Started with F# Web Development (CodeStock 2012)

Getting Started with F# Web Development (CodeStock 2012)

Published in Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
2,367
On SlideShare
0
From Embeds
0
Number of Embeds
15

Actions

Shares
Downloads
18
Comments
0
Likes
3

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Getting Started with F# Web Development• Daniel Mohl• @dmohl• blog.danielmohl.com• github.com/dmohl1
  • 2. 2 June 16, 2012 DanielMohl  @dmohl  blog.danielmohl.com  github.com/dmohl Getting Started with F# Web Development
  • 3. 3 June 16, 2012
  • 4. 4 June 16, 2012
  • 5. 5 June 16, 2012Daniel MohlF# MVP and C# Insider danmohl@gmail.com www.twitter.com/dmohl blog.danielmohl.com
  • 6. 6 June 16, 2012What Are We Doing? Why F#? F# Primer/Review F#/C# ASP.NET MVC 4 Example ASP.NET Web API, Service Stack, Nancy, Frank Windows Azure WebSharper Example
  • 7. 7 June 16, 2012Why Functional? Why F#? Simple Code to Solve Complex Problems  Terse Yet Readable  Less Errors The Move to Multi-core (immutable by default) Programming in the Small (Single Responsibility Principle) Higher Level Language Provides Optimization Opportunities Code That is Correct More Often Features Not In Other Mainstream Languages Staying Ahead of the Competition Why Functional Programming Matters F# in the Enterprise
  • 8. 8 June 16, 2012Why F# for Web Dev? Asynchronous Workflows and Reactive Programming F#/JavaScript Commonalities Easier to support next generation web development  HTML5 (Web Sockets, Canvas)  Asynchronous and Reactive ProgrammingWeb Socket ExampleCanvas ExampleTwitter Feed Sample (Reactive Programming)
  • 9. 9 June 16, 2012F# Primer/Review Whitespace Matters The let Keyword Pattern Matching More During the Demos
  • 10. 10 June 16, 2012 Whitespace Matters//F# //C#open System using System;let doSomething val = namespace ConsoleApplication1 val + val {Console.WriteLine class Program (doSomething 1) { static int doSomething(int val) { return val + val; } static void Main(string[] args) { Console.WriteLine( doSomething(1)); } } }
  • 11. 11 June 16, 2012 The let Keyword//F# //C#open System using System;let val2 = 1 namespace ConsoleApplication1let doSomething val = { val + val2 class ProgramConsole.WriteLine { (doSomething 1) static int val2 = 1; static int doSomething(int val) { return val + val2; } static void Main(string[] args) { Console.WriteLine( doSomething(1)); } }
  • 12. 12 June 16, 2012Pattern MatchingKind of like a switch/case statement, but somuch more!Example 1:let boolVal = truematch boolVal with| true -> printf “was true”| _ -> printf “was not true”Example 2:let name = "Dan", "Mohl"match name with| _, "Smith" -> printf "Found a Smith"| "Don", _ -> printf "Found a Don"| "Dan", "Mohl" -> printf "Found Dan Mohl"| _ -> printf "Name not found"
  • 13. 13 June 16, 2012A Few General Examples Sample F# Script (Simple Strategy Pattern Example) Fetch Museum List (Async Example) Twitter Feed (Reactive Programming Example) Interactive DirectX
  • 14. 14 June 16, 2012F#/C# ASP.NET MVC 4Examplehttp://visualstudiogallery.msdn.microsoft.com/3d2bf938-fc9e-403c-90b3-8de27dc23095
  • 15. 15 June 16, 2012F#/C# ASP.NET Web APIhttp://visualstudiogallery.msdn.microsoft.com/3d2bf938-fc9e-403c-90b3-8de27dc23095
  • 16. 16 June 16, 2012Sidebar Windows 9?
  • 17. 17 June 16, 2012Windows 8
  • 18. 18 June 16, 2012Windows 9?
  • 19. 19 June 16, 2012Other Web Frameworks- Service Stack- Nancy- Frank
  • 20. 20 June 16, 2012F# and Azure- Fog - https://github.com/dmohl/Fog
  • 21. 21 June 16, 2012WebSharper Examplehttp://visualstudiogallery.msdn.microsoft.com/en-us/288b94ea-0ea7-4dde-8906-f72eb22fbe1bCheck out http://fpish.net for an exampleof a live site built with WebSharper.
  • 22. 22 June 16, 2012More Information Books - http://msdn.microsoft.com/en- us/fsharp/gg262865.aspx F# MSDN - http://msdn.microsoft.com/en- us/fsharp/gg262865.aspx Blogs Twitter Ask – F# has the greatest community around
  • 23. 23 June 16, 2012Daniel MohlF# MVP and C# Insider danmohl@gmail.com www.twitter.com/dmohl blog.danielmohl.com