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

My talk on i4cup meetup

My talk on i4cup meetup

My talk on small local i4cup meetup. Telling about my Swift fuckup :)

042b7c0e45c53de46667f07de2fb2614?s=128

vixentael

April 28, 2016
Tweet

More Decks by vixentael

Other Decks in Programming

Transcript

  1. i4☕

  2. Code that smells aka ‘bydlo-code’

  3. kill me, please

  4. don’t write code that smells

  5. None
  6. there was a dev team…

  7. there was a dev team… …writing on ObjC

  8. and they decided to switch to Swift!

  9. and they decided to switch to Swift! in production!

  10. None
  11. it was nice morning and PM decided to install app

  12. it was nice morning and PM decided to install app

    on device!
  13. None
  14. it’s not us! it’s new 7.3 Xcode!

  15. oh no, it’s us :(

  16. "loadData has not been implemented" found in logs

  17. None
  18. – loadData(…) -> … – loadData(…) -> … ChildTableViewController <T>

    BaseTableViewController <T>
  19. BaseTableViewController <T> – loadData(…) -> … ChildTableViewController <T> – loadData(…)

    -> … generics stub overriden
  20. BaseTableViewController <T> – loadData(…) -> … ChildTableViewController <T> – loadData(…)

    -> … generics stub overriden not called at all
  21. A – architecture

  22. Problem solving

  23. What if we disable optimization?

  24. let’s disable optimization..

  25. too many optimizations! swift compiler optimization!

  26. Why debug is ok?

  27. …Testability

  28. Debug Release Optimization Testability WMO yes WMO no

  29. WMO https://developer.apple.com/swift/blog/?id=27 if method has no ‘internal’ access, compiler may

    mark it as ‘final’
  30. Testability allows you to use all ‘internal’ methods in tests

    like ‘public’
  31. everything is ok overriden methods may be lost Debug Release

    Optimization Testability WMO yes WMO no
  32. tweet all the things!

  33. tweet all the things!

  34. sudden help!

  35. sudden help! swift contributor

  36. https://gist.github.com/PaulTaykalo/5c97010874a93626ca3c Minimal crashable code

  37. http://openradar.appspot.com/radar?id=4971716266688512 Filed Radar

  38. SIL devirtualization: Conservatively avoid filtering devirt candidates on generic base

    classes Fix by @jckarter https://github.com/apple/swift/pull/1954
  39. SIL devirtualization: Conservatively avoid filtering devirt candidates on generic base

    classes Fix by @jckarter https://github.com/apple/swift/pull/1954
  40. Fix by @jckarter fix! https://github.com/apple/swift/pull/1954

  41. Tests https://github.com/apple/swift/pull/1954

  42. Swift 2.2 Patch https://github.com/apple/swift/pull/1954

  43. Lessons learnt

  44. Lesson #1 every decision has consequences

  45. sooner or later they’ll appear Lesson #1 every decision has

    consequences
  46. Lesson #2 always try build in release on device

  47. at least once a day Lesson #2 always try build

    in release on device
  48. and community Lesson #3 twitter rulez

  49. Lesson #4 PMs are useful

  50. sometimes Lesson #4 PMs are useful

  51. team: Vitaliy, Igor, Paul Thanks community: @akosma, @jckarter PM: Anna

  52. None