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

Swift

 Swift

Presentation about the Swift programming language by Apple, given in Zurich, September 9th 2014.

The demos are available here:
https://github.com/akosma/Swift-Presentation

Speech: https://akos.ma/blog/the-tao-of-swift/

Adrian Kosmaczewski

September 09, 2014
Tweet

More Decks by Adrian Kosmaczewski

Other Decks in Technology

Transcript

  1. The Tao of Swift

    View Slide

  2. (Feng Shui)

    View Slide

  3. Thus spake the master
    programmer:

    View Slide

  4. The Tao of Programming
    flows far away and returns
    on the wind of morning.

    View Slide

  5. The Tao gave birth to
    machine language.

    View Slide

  6. View Slide

  7. The assembler gave
    birth to the compiler.

    View Slide

  8. View Slide

  9. Each language has its
    purpose, however
    humble.

    View Slide

  10. View Slide

  11. View Slide

  12. View Slide

  13. Welcome

    View Slide

  14. Adrian Kosmaczewski

    View Slide

  15. View Slide

  16. Xcode 6

    View Slide

  17. View Slide

  18. View Slide

  19. Playgrounds

    View Slide

  20. View Slide

  21. View Slide

  22. View Slide

  23. View Slide

  24. Should you use Swift?

    View Slide

  25. No.
    !
    (well, not yet)

    View Slide

  26. Not (yet) ready for
    primetime

    View Slide

  27. View Slide

  28. View Slide

  29. What is Swift?

    View Slide

  30. Modern
    Safe
    Fast
    Interoperable

    View Slide

  31. View Slide

  32. View Slide

  33. View Slide

  34. View Slide

  35. View Slide

  36. View Slide

  37. http://www.marutisuzuki.com/swift.aspx

    View Slide

  38. http://www.scbroncos.com/

    View Slide

  39. http://www.englandfootballonline.com/TeamClubs/Clubs/Swifts.html

    View Slide

  40. http://www.swiftengineering.com/

    View Slide

  41. https://en.wikipedia.org/wiki/File:5.3.10TaylorSwiftByDavidShankbone.jpg

    View Slide

  42. http://en.wikipedia.org/wiki/File:Jonathan_Swift_by_Charles_Jervas_detail.jpg

    View Slide

  43. http://swift-lang.org/main/

    View Slide

  44. View Slide

  45. View Slide

  46. View Slide

  47. Why Swift?

    View Slide

  48. View Slide

  49. View Slide

  50. View Slide

  51. Who made it?

    View Slide

  52. View Slide

  53. View Slide

  54. View Slide

  55. View Slide

  56. View Slide

  57. View Slide

  58. How does Swift
    compare to others?

    View Slide

  59. View Slide

  60. https://leverich.github.io/swiftislikescala/

    View Slide

  61. http://realm.io/news/swift-for-javascript-developers/

    View Slide

  62. http://pietschsoft.com/post/2014/06/07/Basic-Comparison-of-C-and-Apple-Swift-Programming-Language-Syntax

    View Slide

  63. http://www.haskell.org/

    View Slide

  64. View Slide

  65. View Slide

  66. View Slide

  67. View Slide

  68. Major Features
    Strong typing
    Type inference
    Closures
    Optionals / Nullables
    Generics
    Custom operators
    Tuples
    Interoperable
    Changes every week

    View Slide

  69. Interoperability

    View Slide

  70. View Slide

  71. Not Available in Obj-C
    Generics
    Tuples
    Enumerations
    Structures
    Top-level functions
    Global variables
    Typealiases
    Swift-style variadics
    Nested types
    Curried functions

    View Slide

  72. Is Swift a Functional
    Language™®©?

    View Slide

  73. Sorta.

    View Slide

  74. Cocoa is the new
    Carbon

    View Slide

  75. Built for Speed

    View Slide

  76. View Slide

  77. View Slide

  78. Demos
    !
    (finally!)

    View Slide

  79. … and much more
    Standard library
    WillSet / DidSet in setters
    Memory management in
    closures
    Convenience initializers
    Lazy properties
    Nesting of classes, enums and
    structs
    Pattern matching in `switch`
    statements
    reStructuredText
    documentation headers
    Default parameter values in
    functions
    Monads, futures, promises and
    other functional programming
    constructions
    Nested comments

    View Slide

  80. Tool Support

    View Slide

  81. View Slide

  82. Editor Support
    Sublime Text http://www.sublimetext.com/
    AppCode http://www.jetbrains.com/objc/
    TextMate https://github.com/textmate/textmate
    Textastic http://www.textasticapp.com/
    SimpleEdit http://simpleeditapp.com/
    PaintCode http://www.paintcodeapp.com/
    Vim http://www.vim.org/

    View Slide

  83. View Slide

  84. View Slide

  85. Bad Karma

    View Slide

  86. Lack of “const correctness” / not completely
    functional
    Almost no docs about the standard library
    Lack of extensive dynamic type information
    Changes every week (well, almost.)

    View Slide

  87. More Information

    View Slide

  88. Blogs (1/2)
    Apple https://developer.apple.com/swift/blog/
    Erica Sadun http://ericasadun.com/
    Mattt Thompson http://swifthipster.com/!
    Mike Ash https://www.mikeash.com/pyblog/

    View Slide

  89. Blogs (2/2)
    Airspeed Velocity http://airspeedvelocity.net/
    Alexandros Salazar http://nomothetis.svbtle.com/
    David J Peacock http://davidjpeacock.ca/
    sketchyTech http://sketchytech.blogspot.com/
    Swift Studies http://www.swift-studies.com/

    View Slide

  90. Weekly Newsletters
    Natasha the Robot http://natashatherobot.com/
    Swift Dev Weekly http://swiftdevweekly.com/
    iOS Dev Weekly http://iosdevweekly.com/

    View Slide

  91. Code
    FlappySwift https://github.com/jurvis/FlappySwift
    Alamofire https://github.com/Alamofire/Alamofire
    Swiftz https://github.com/maxpow4h/swiftz
    Dollar https://github.com/ankurp/Dollar.swift
    Quick BDD https://github.com/Quick/Quick

    View Slide

  92. Other Platforms
    RemObjects Silver 

    http://www.remobjects.com/elements/silver/
    Swift-X http://swift-x.org/
    Swift on your browser http://swiftstub.com/

    View Slide

  93. Quick Help
    GitHub 

    https://github.com/github/swift-style-guide
    Cheatsheet 

    http://www.raywenderlich.com/73967/swift-cheat-sheet-
    and-quick-reference
    Closure Syntax

    http://fuckingclosuresyntax.com/
    Playground Builder

    http://jasonsandmeyer.com/playgrounds/

    View Slide

  94. Books

    View Slide

  95. Upcoming Books

    View Slide

  96. More Books
    jamesonquave.com/swiftebook raywenderlich.com/store/swift-tutorials-bundle

    View Slide

  97. Classics

    View Slide

  98. Thus spake the master
    programmer:

    View Slide

  99. It is time for you to
    leave.

    View Slide

  100. Thanks!

    View Slide

  101. Questions?

    View Slide

  102. Credits
    The Tao of Programming

    http://canonical.org/~kragen/tao-of-
    programming.html
    People I follow on Twitter

    View Slide