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

From iOS- to Vapor Developer (VaporLondon)

From iOS- to Vapor Developer (VaporLondon)

Diving into server-side Swift can seem straightforward at first if one knows the programming language, but it might be harder than you think since it involves developing on a new platform. I will walk you through my journey coming from iOS into Vapor, what challenges I faced, and which strengths I had coming from the iOS platform. I will talk about how these challenges can be overcome and I will share my experiences after working with Vapor in production for 6 months.

Talk given at a VaporLondon event (https://www.meetup.com/VaporLondon/events/243769172/) on the 30th of October 2017.

Steffen D. Sommer

October 30, 2017
Tweet

More Decks by Steffen D. Sommer

Other Decks in Programming

Transcript

  1. From iOS- to Vapor developer

    View Slide

  2. View Slide

  3. View Slide

  4. View Slide

  5. Swi$

    Linux

    View Slide

  6. View Slide

  7. Kitura
    Perfect
    Vapor
    Zewo

    View Slide

  8. Pros
    • Swi$

    View Slide

  9. Pros
    • Swi%
    • Fast

    View Slide

  10. Pros
    • Swi%
    • Fast
    • Code share

    View Slide

  11. Pros
    • Swi%
    • Fast
    • Code share
    • More fullstack developers

    View Slide

  12. Pros
    • Swi%
    • Fast
    • Code share
    • More fullstack developers
    • Xcode

    View Slide

  13. Pros
    • Swi%
    • Fast
    • Code share
    • More fullstack developers
    • Xcode
    • Big community

    View Slide

  14. Cons
    • New language

    View Slide

  15. Cons
    • New language
    • New package manager

    View Slide

  16. Cons
    • New language
    • New package manager
    • New framework

    View Slide

  17. Cons
    • New language
    • New package manager
    • New framework
    • Xcode

    View Slide

  18. Cons
    • New language
    • New package manager
    • New framework
    • Xcode
    • Hos$ng

    View Slide

  19. Cons
    • New language
    • New package manager
    • New framework
    • Xcode
    • Hos6ng
    • Lack of libraries

    View Slide

  20. Programming languages in the making
    • JavaScript (1995): 22 years
    • Java (1996): 21 years
    • Ruby (1996): 21 years
    • Swi$ (2014): 3 years

    View Slide

  21. Web frameworks in the making 1
    • Spring MVC (2002): 15 years
    • Ruby on Rails (2004): 13 years
    • NodeJS (2009): 8 years
    • Kitura/Perfect/Vapor (2016): 1 year
    1 Since their version 1.0 release.

    View Slide

  22. The future is bright for server-side
    Swi/

    View Slide

  23. View Slide

  24. Kitura
    Perfect
    Vapor

    View Slide

  25. Kitura
    Perfect
    Vapor

    View Slide

  26. Kitura
    Perfect
    Vapor

    View Slide

  27. View Slide

  28. Hi, my name is
    Steffen D. Sommer
    !

    View Slide

  29. View Slide

  30. View Slide

  31. View Slide

  32. View Slide

  33. Steffen iOS

    View Slide

  34. Steffen

    iOS Swi*

    View Slide

  35. Swi$ as a language, not iOS as a
    pla/orm

    View Slide

  36. View Slide

  37. View Slide

  38. iOS != Vapor

    View Slide

  39. iOS != Vapor
    Number of users

    View Slide

  40. iOS
    - 1

    View Slide

  41. Vapor
    - Lots of users

    View Slide

  42. iOS != Vapor
    Performance

    View Slide

  43. iOS
    - Not an issue

    View Slide

  44. Vapor
    - Users do not want to wait for requests to return

    View Slide

  45. Vapor
    - Users do not want to wait for requests to return
    - More performance = more money

    View Slide

  46. iOS != Vapor
    Crash handling

    View Slide

  47. iOS
    - "We'll fix it in the next app update"

    View Slide

  48. Vapor
    - Fix it now

    View Slide

  49. iOS != Vapor
    Updates

    View Slide

  50. iOS
    - 2 week release cycles

    View Slide

  51. Vapor
    - Whenever we want

    View Slide

  52. iOS != Vapor
    Pla$orms

    View Slide

  53. iOS
    - One pla(orm to rule them all

    View Slide

  54. Vapor
    - macOS + Linux

    View Slide

  55. iOS != Vapor
    Foundation

    View Slide

  56. iOS
    -
    !

    View Slide

  57. Vapor
    -
    !

    View Slide

  58. iOS != Vapor
    Breaking changes in the API

    View Slide

  59. iOS
    - Good to go

    View Slide

  60. Vapor
    - Handle different versions depending on the client

    View Slide

  61. iOS != Vapor
    The Xcode project file

    View Slide

  62. iOS
    - Merge madness

    View Slide

  63. Vapor
    - .. what file?

    View Slide

  64. iOS != Vapor
    Third party frameworks

    View Slide

  65. iOS
    - Which one to pick?

    View Slide

  66. Vapor
    - Roll out your own

    View Slide

  67. iOS != Vapor
    User Interfaces

    View Slide

  68. iOS
    - Storyboards and auto layout

    View Slide

  69. Vapor
    - HTML, CSS and JavaScript

    View Slide

  70. iOS != Vapor
    Persistence

    View Slide

  71. iOS
    - Used to some extent

    View Slide

  72. Vapor
    - Used heavily

    View Slide

  73. iOS != Vapor
    Security

    View Slide

  74. iOS
    - Mostly handled by the OS

    View Slide

  75. Vapor
    - Needs to be a first class ci/zen in your project

    View Slide

  76. iOS != Vapor
    Consumers

    View Slide

  77. iOS
    - None

    View Slide

  78. Vapor
    - Frontend

    View Slide

  79. iOS != Vapor
    Releasing

    View Slide

  80. iOS
    - iTunes Connect

    View Slide

  81. Vapor
    - Deploying

    View Slide

  82. Tips to overcome these challenges

    View Slide

  83. Tip #1
    Start repor)ng

    View Slide

  84. Tip #2
    Setup con*nous integra*on

    View Slide

  85. Tip #3
    Write tests

    View Slide

  86. Tip #4
    Write documenta.on

    View Slide

  87. Tip #5
    Learn about databases

    View Slide

  88. Tip #6
    Consider when to use Foundation

    View Slide

  89. Tip #7
    Use Vapor Cloud

    View Slide

  90. Tip #8
    Use security packages

    View Slide

  91. Tip #9
    Use a template language

    View Slide

  92. Tip #10
    Get involved

    View Slide

  93. My experiences with Vapor in
    produc4on

    View Slide

  94. My experiences with Vapor in produc4on
    • Lots of moving targets (Swi2, Vapor, Vapor Cloud)

    View Slide

  95. My experiences with Vapor in produc4on
    • Lots of moving targets (Swi3, Vapor, Vapor Cloud)
    • Overhead in crea,ng and maintaining open source packages

    View Slide

  96. My experiences with Vapor in produc4on
    • Lots of moving targets (Swi3, Vapor, Vapor Cloud)
    • Overhead in crea?ng and maintaining open source packages
    • Lack of documenta.on

    View Slide

  97. My experiences with Vapor in produc4on
    • Lots of moving targets (Swi3, Vapor, Vapor Cloud)
    • Overhead in crea?ng and maintaining open source packages
    • Lack of documenta?on
    • Outdated resources

    View Slide

  98. My experiences with Vapor in produc4on
    • Lots of moving targets (Swi3, Vapor, Vapor Cloud)
    • Overhead in crea?ng and maintaining open source packages
    • Lack of documenta?on
    • Outdated resources
    • Few experts

    View Slide

  99. My experiences with Vapor in produc4on
    • Lots of moving targets (Swi3, Vapor, Vapor Cloud)
    • Overhead in crea?ng and maintaining open source packages
    • Lack of documenta?on
    • Outdated resources
    • Few experts
    • Lots of boilerplate

    View Slide

  100. My experiences with Vapor in produc4on
    • Lots of moving targets (Swi3, Vapor, Vapor Cloud)
    • Overhead in crea?ng and maintaining open source packages
    • Lack of documenta?on
    • Outdated resources
    • Few experts
    • Lots of boilerplate
    • Linux quirkiness

    View Slide

  101. How things have improved
    • Updates are slowing down (Swi2 and Vapor)

    View Slide

  102. How things have improved
    • Updates are slowing down (Swi3 and Vapor)
    • Vapor Cloud reached 1.0 and is stable

    View Slide

  103. How things have improved
    • Updates are slowing down (Swi3 and Vapor)
    • Vapor Cloud reached 1.0 and is stable
    • We don't create as many open source packages anymore

    View Slide

  104. How things have improved
    • Updates are slowing down (Swi3 and Vapor)
    • Vapor Cloud reached 1.0 and is stable
    • We don't create as many open source packages anymore
    • Documenta*on is improving

    View Slide

  105. How things have improved
    • Updates are slowing down (Swi3 and Vapor)
    • Vapor Cloud reached 1.0 and is stable
    • We don't create as many open source packages anymore
    • DocumentaDon is improving
    • More and more resources

    View Slide

  106. How things have improved
    • Updates are slowing down (Swi3 and Vapor)
    • Vapor Cloud reached 1.0 and is stable
    • We don't create as many open source packages anymore
    • DocumentaDon is improving
    • More and more resources
    • Bigger community - more experts

    View Slide

  107. How things have improved
    • Updates are slowing down (Swi3 and Vapor)
    • Vapor Cloud reached 1.0 and is stable
    • We don't create as many open source packages anymore
    • DocumentaDon is improving
    • More and more resources
    • Bigger community - more experts
    • Less boilerplate

    View Slide

  108. How things have improved
    ...
    - Swi$ on Linux is more mature

    View Slide

  109. What it means to us
    • 25+ customer projects running in produc3on using Vapor and
    Vapor Cloud

    View Slide

  110. What it means to us
    • 25+ customer projects running in produc4on using Vapor and
    Vapor Cloud
    • 30+ open source packages created

    View Slide

  111. What it means to us
    • 25+ customer projects running in produc4on using Vapor and
    Vapor Cloud
    • 30+ open source packages created
    • Hos$ng fees are going down

    View Slide

  112. What it means to us
    • 25+ customer projects running in produc4on using Vapor and
    Vapor Cloud
    • 30+ open source packages created
    • Hos4ng fees are going down
    • More and more of our iOS developers starts to catch up

    View Slide

  113. What it means to us
    • 25+ customer projects running in produc4on using Vapor and
    Vapor Cloud
    • 30+ open source packages created
    • Hos4ng fees are going down
    • More and more of our iOS developers starts to catch up
    • More rapid development

    View Slide

  114. No major issues since we made the
    switch

    View Slide