Pro Yearly is on sale from $80 to $50! »

From iOS- to Vapor Developer (Øredev)

From iOS- to Vapor Developer (Øredev)

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 Øredev 2017 on the 9th of November 2017.

9993186221ec65f6f10db0dc9cff7c07?s=128

Steffen D. Sommer

November 09, 2017
Tweet

Transcript

  1. From iOS- to Vapor developer @steffendsommer

  2. None
  3. None
  4. None
  5. Pla$orm support for all Apple pla*orms as well as Linux

  6. None
  7. None
  8. Swi$ on the server

  9. None
  10. !

  11. !"

  12. None
  13. !"

  14. !

  15. • Swi% • Fast • Code share • More fullstack

    developers • Xcode • Big community • Be part of the development
  16. Swi$ on the server

  17. None
  18. !

  19. None
  20. None
  21. !

  22. • New language • New package manager • New framework

    • Xcode • Limited hos9ng op9ons • Less libraries compared to other web frameworks
  23. Programming languages in the making

  24. • JavaScript (1995): 22 years • Java (1996): 21 years

    • Ruby (1996): 21 years • Swi$ (2014): 3 years
  25. Web frameworks in the making 1 1 Since their version

    1.0 release.
  26. • Spring MVC (2002): 15 years • Ruby on Rails

    (2004): 13 years • Express (2010): 7 years • Kitura/Perfect/Vapor (2016): 1 year
  27. The future is bright for server-side Swi/

  28. None
  29. Kitura Perfect Vapor

  30. Kitura Perfect Vapor

  31. Kitura Perfect Vapor

  32. None
  33. Hi, my name is Steffen D. Sommer !

  34. Steffen iOS

  35. Steffen ❤ iOS Swi*

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

  37. None
  38. import Vapor let drop = try Droplet() drop.get("hello") { req

    in return "Hello, world." } try drop.run()
  39. None
  40. None
  41. iOS != Vapor

  42. iOS != Vapor Number of users

  43. ! • 1

  44. • It's all about the requests

  45. iOS != Vapor Performance

  46. ! • Not an issue

  47. • Users do not want to wait for requests to

    return
  48. • Users do not want to wait for requests to

    return • More performance = more money
  49. iOS != Vapor Crash handling

  50. ! • "We'll fix it in the next app update"

  51. • Fix it now

  52. iOS != Vapor Pla$orms

  53. ! • One pla(orm to rule them all

  54. • macOS + Linux

  55. iOS != Vapor Foundation

  56. ! • !

  57. • !

  58. iOS != Vapor The Xcode project file

  59. ! • Merge madness

  60. • .. what file?

  61. iOS != Vapor Third party frameworks

  62. ! • Which one to pick?

  63. • Roll out your own

  64. iOS != Vapor User Interfaces

  65. ! • Storyboards and auto layout

  66. • HTML, CSS, JavaScript & template languages

  67. iOS != Vapor Persistence

  68. ! • Used to some extent

  69. • Used heavily

  70. iOS != Vapor Security

  71. ! • Mostly handled by the OS

  72. • Needs to be taken care of

  73. iOS != Vapor Consumers

  74. ! • None

  75. • "Hey backend dev, I can't get this endpoint to

    work.."
  76. iOS != Vapor Releasing

  77. ! • iTunes Connect

  78. • Deploying

  79. Tips to overcome these challenges

  80. Tip #1 RTFM & get involved

  81. Tip #2 Learn about databases

  82. Tip #3 Consider when to use Foundation

  83. Tip #4 Start repor)ng

  84. Tip #5 Setup CI or a VM

  85. Tip #6 Write (API) tests

  86. Tip #7 Document your APIs

  87. Tip #8 Use security packages

  88. Tip #9 U"lize the template language

  89. Tip #10 Use Vapor Cloud

  90. The last 10 months in hindsight

  91. Challenges

  92. • Lots of moving targets (Swi2, Vapor, Vapor Cloud)

  93. • Lots of moving targets (Swi3, Vapor, Vapor Cloud) •

    Overhead in crea,ng and maintaining open source packages
  94. • Lots of moving targets (Swi3, Vapor, Vapor Cloud) •

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

    Overhead in crea?ng and maintaining open source packages • Lack of documenta?on • Outdated resources
  96. • 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
  97. • 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
  98. • 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
  99. How things have improved

  100. • Updates are slowing down (Swi2 and Vapor)

  101. • Updates are slowing down (Swi3 and Vapor) • Vapor

    Cloud reached 1.0 and is stable
  102. • 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
  103. • 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
  104. • 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
  105. • 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
  106. • 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
  107. • 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 • Swi$ on Linux is more mature
  108. Our results

  109. • 25+ customer projects

  110. • 25+ customer projects • 30+ open source packages created

  111. • 25+ customer projects • 30+ open source packages •

    Hos$ng fees are going down
  112. • 25+ customer projects • 30+ open source packages •

    Hos7ng fees are going down • More and more of our iOS developers starts to catch up
  113. • 25+ customer projects • 30+ open source packages •

    Hos7ng fees are going down • More and more of our iOS developers starts to catch up • We develop faster
  114. • 25+ customer projects • 30+ open source packages •

    Hos7ng fees are going down • More and more of our iOS developers starts to catch up • We develop faster • Less bugs than before making the switch
  115. No major issues since we made the switch

  116. Resources • Vapor docs: h-ps:/ /docs.vapor.codes/2.0/ • Vapor Slack: h-p:/

    /vapor.team • Vapor @Nodes: h-ps:/ /github.com/nodes-vapor • SwiBConf '17 @gtranchedone: h-ps:/ /www.youtube.com/ watch?v=IuW_hLCsIeQ