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

'How Open Source Development can make you a better developer' by Arthur Sabintsev

'How Open Source Development can make you a better developer' by Arthur Sabintsev

Everyone uses Open Source Software, but not everyone contributes back to the community. Some are scared of being judged on their skill, while others may feel that they have nothing to share. These excuses couldn’t be farther from the truth! Open Source Development, especially in the Swift community, is fun, exciting, and especially welcoming! With 5 years of OSS experience, 7300+ stars on GitHub, over 1.5 million downloads on CocoaPods, and contributions to established projects, like Swift, and the Swift Source Compatibility Suite, Arthur will discuss how contributing has made me a more confident developer, share the lessons learned in the process, and most importantly, convince others that their contributions will better themselves and the community!
He also will talk about how to get involved in open source, and how to contribute to Swift.

This talk was made for CocoaHeads Kyiv #13 which took place Dec 16 2017.

CocoaHeads Ukraine

December 16, 2017
Tweet

More Decks by CocoaHeads Ukraine

Other Decks in Programming

Transcript

  1. How Open Source So-ware
    Development Can Make You a
    Be9er Developer
    Arthur Sabintsev
    Lead iOS Developer
    The Washington Post
    © 2017, Arthur Ariel Sabintsev.
    ArtSabintsev on Twi:er & Github. 1

    View Slide

  2. "Open source so,ware is so,ware
    with source code that anyone can
    inspect, modify, and enhance."
    — OpenSource.com
    © 2017, Arthur Ariel Sabintsev.
    ArtSabintsev on Twi:er & Github. 2

    View Slide

  3. OSS Résumé
    • 1.3 million+ downloads via CocoaPods1
    • 7,200+ stars on GitHub2
    • Contributed to [email protected] 3.13
    • Contributed to [email protected] Source CompaBbility4 5
    Stats on the right generated by GitFame6
    6 GitFame: Swi- CLI Script That Logs GitHub Stars and
    Forks.
    5 Swi& Source Compa0bility Suite
    4 Guitar: Pla,orm-Independent Regular Expression and String
    Library
    3 XCTAssertNoThrow Implementa5on for Swi9 3.1
    2 GitHub Account for ArtSabintsev
    1 CocoaPods Stats for ArtSabintsev
    © 2017, Arthur Ariel Sabintsev.
    ArtSabintsev on Twi:er & Github. 3

    View Slide

  4. You don't need a computer science
    degree to contribute to Open
    Source.
    — Lesson #1
    © 2017, Arthur Ariel Sabintsev.
    ArtSabintsev on Twi:er & Github. 4

    View Slide

  5. 4 Types of Open-Source Projects Based on Adop8on7
    1. No Adop)on
    2. Adop)on
    3. Gold Standard
    4. Hyper-Scale
    7 Feilx Krause's Four Stages of Open Source Projects
    © 2017, Arthur Ariel Sabintsev.
    ArtSabintsev on Twi:er & Github. 5

    View Slide

  6. Journey into the past, to a 0me before
    • JSON Parsing libs (Argo, Gloss, Swi/yJSON, etc.)
    • Auto Layout libs (PureLayout, SnapKit, Stevia, etc.)
    • Async. Image Downloading libs (Kingfisher, SDWebImage, etc.)
    • Journey back to the days of Pull to Refresh!
    © 2017, Arthur Ariel Sabintsev.
    ArtSabintsev on Twi:er & Github. 6

    View Slide

  7. © 2017, Arthur Ariel Sabintsev.
    ArtSabintsev on Twi:er & Github. 7

    View Slide

  8. Drive+ by Porsche & Duca* Community for Duca0
    © 2017, Arthur Ariel Sabintsev.
    ArtSabintsev on Twi:er & Github. 8

    View Slide

  9. Programmers are like
    Blacksmiths, we create
    our own tools.
    — Lesson #2
    © 2017, Arthur Ariel Sabintsev.
    ArtSabintsev on Twi:er & Github. 9

    View Slide

  10. Gump%on
    — Lesson #3
    © 2017, Arthur Ariel Sabintsev.
    ArtSabintsev on Twi:er & Github. 10

    View Slide

  11. The Float Label Pa-ern 8 9 10
    10 UIFloatLabelTextView
    9 UIFloatLabelTextField
    8 The Float Label Pa.ern by Ma. D. Smith
    © 2017, Arthur Ariel Sabintsev.
    ArtSabintsev on Twi:er & Github. 11

    View Slide

  12. Swizzling UITextField's Clear Bu8on
    - (void)setuptextFieldClearButton
    {
    // A boolean that toggles the state of the keyboard after the clear-text button is pressed.
    _dismissKeyboardWhenClearingTextField = @NO;
    // Create selector for Apple's built-in UITextField button - clearButton
    SEL clearButtonSelector = NSSelectorFromString(@"clearButton");
    // Reference clearButton getter
    IMP clearButtonImplementation = [self methodForSelector:clearButtonSelector];
    // Create function pointer that returns UIButton from implementation of method that contains clearButtonSelector
    UIButton * (* clearButtonFunctionPointer)(id, SEL) = (UIButton *(*)(id, SEL))clearButtonImplementation;
    // Set textFieldClearButton reference to "clearButton" from clearButtonSelector
    _textFieldClearButton = clearButtonFunctionPointer(self, clearButtonSelector);
    if (_textFieldClearButton) {
    // Remove all textFieldClearButton target-actions (e.g., Apple's standard clearButton actions)
    [self.textFieldClearButton removeTarget:nil action:NULL forControlEvents:UIControlEventAllEvents];
    // Add new target-action for textFieldClearButton
    [_textFieldClearButton addTarget:self action:@selector(clearTextField) forControlEvents:UIControlEventTouchUpInside];
    }
    }
    © 2017, Arthur Ariel Sabintsev.
    ArtSabintsev on Twi:er & Github. 12

    View Slide

  13. Experimen)ng with APIs You Normally Wouldn't Use 11
    /// Returns the latinized version of the string without diacritics.
    ///
    /// let string = "Hello! ͩΩ΁ͷ΅! สวัสดี! ﻣ



    ﺎ ! ఍অ!"
    /// print(string.latinized())
    /// // Prints "Hello! kon'nichiha! swasdi! mrhba! nin hao!"
    ///
    /// - Returns: The latinized version of the string without diacritics.
    @discardableResult
    func latinized() -> String {
    #if !os(Linux)
    if #available(iOS 9.0, macOS 10.11, tvOS 9.0, watchOS 3.0, *) {
    return (applyingTransform(.toLatin, reverse: false) ?? self).withoutAccents()
    } else {
    assertionFailure("The latinized function is only available iOS 9.0+, macOS 10.11+, tvOS 9.0+, and watchOS 3.0+")
    return self.withoutAccents()
    }
    #else
    assertionFailure("The latinized function is only available for Darwin devices; iOS, macOS, tvOS, watchOS")
    return self.withoutAccents()
    #endif
    }
    11 Guitar
    © 2017, Arthur Ariel Sabintsev.
    ArtSabintsev on Twi:er & Github. 13

    View Slide

  14. Learn and experiment with language
    and pla2orm APIs that you normally
    wouldn't in your day job.
    — Lesson #4
    © 2017, Arthur Ariel Sabintsev.
    ArtSabintsev on Twi:er & Github. 14

    View Slide

  15. Harpy & Siren
    Checks currently installed version of your app against the version that is available in the App Store.
    © 2017, Arthur Ariel Sabintsev.
    ArtSabintsev on Twi:er & Github. 15

    View Slide

  16. Package Managers
    • CocoaPods
    • Carthage
    • Swi1 Package Manager
    © 2017, Arthur Ariel Sabintsev.
    ArtSabintsev on Twi:er & Github. 16

    View Slide

  17. Con$nuous Integra$on
    • BuddyBuild.com / Travis CI
    • YAML Files
    • Pre-Install & Post-Install Scripts
    © 2017, Arthur Ariel Sabintsev.
    ArtSabintsev on Twi:er & Github. 17

    View Slide

  18. Interna'onaliza'on (i18n) & Localiza'on (l10n)
    • Adding ability to be used across Languages
    • NSLocalizedString, Custom Bundles
    • Localized for 40 Languages.
    • Overriding iOS-system-level localizaBon
    © 2017, Arthur Ariel Sabintsev.
    ArtSabintsev on Twi:er & Github. 18

    View Slide

  19. Being a Maintainer vs. Being a Consumer
    • I rarely use Harpy and Siren
    • 80,000+ combined monthly downloads
    • Consumers:
    • Report when the projects stop working
    • Request features
    • Add features via PRs
    © 2017, Arthur Ariel Sabintsev.
    ArtSabintsev on Twi:er & Github. 19

    View Slide

  20. Maintaining an Open Source project
    is both a rewarding and thankless
    job.
    — Lesson #5
    © 2017, Arthur Ariel Sabintsev.
    ArtSabintsev on Twi:er & Github. 20

    View Slide

  21. How to Contribute to Open Source
    © 2017, Arthur Ariel Sabintsev.
    ArtSabintsev on Twi:er & Github. 21

    View Slide

  22. Contribu)ng to Swi.
    • Search bugs.swi0.org for StarterBug
    issues that are Open.
    • Search the Swi0 and Corelibs
    repositories for
    • NSUnimplemented()
    • // FIXME: Unsupported
    © 2017, Arthur Ariel Sabintsev.
    ArtSabintsev on Twi:er & Github. 22

    View Slide

  23. Contribu)ng to
    Established Projects (1/2)
    • Issues posted by the maintainer
    © 2017, Arthur Ariel Sabintsev.
    ArtSabintsev on Twi:er & Github. 23

    View Slide

  24. Contribu)ng to
    Established Projects (2/2)
    • Look at labels:
    • starter task
    • help
    • feature
    • bug
    • Help me implement a rule in Swi6Lint!
    • Swi6Lint#1315
    © 2017, Arthur Ariel Sabintsev.
    ArtSabintsev on Twi:er & Github. 24

    View Slide

  25. Crea%ng Your Own Project
    • Add a README
    • Document every line of public code
    • Document private code as necessary
    • Add Documenta8ons using Jazzy
    • Add Tests and hook up to Con8nuous Integra8on
    • Add a document describing the Vision (e.g., VISION.md)
    • Add issues delinea8ng future features
    • Mark some with labels, like Starter Tasks
    © 2017, Arthur Ariel Sabintsev.
    ArtSabintsev on Twi:er & Github. 25

    View Slide

  26. Marke&ng your Library
    • Submit to Mailing Lists
    • iOS Dev Weekly - Dave Verwer, Evan Dekhayser, Vicc Alexander
    • This Week in SwiD - Natasha The Robot
    • iOS Goodies - Rui Peres & Tiago Almeida
    • Lil' Bites of Cocoa - Jake Marsh
    • iOS Cookies - Adam Bardon
    • SwiD Weekly - 9Elements
    • SwiD Developments - Andy Bargh
    • TwiQer
    • #swiDlang, #iosdev
    © 2017, Arthur Ariel Sabintsev.
    ArtSabintsev on Twi:er & Github. 26

    View Slide

  27. Maintenance Tips & Tricks
    © 2017, Arthur Ariel Sabintsev.
    ArtSabintsev on Twi:er & Github. 27

    View Slide

  28. Issue Templates
    • Pre-populate the New Issue screen with
    informa5on that informs people about
    previously answered ques5ons.
    • Located at /path/to/
    project/.github/
    ISSUE_TEMPLATE.md
    © 2017, Arthur Ariel Sabintsev.
    ArtSabintsev on Twi:er & Github. 28

    View Slide

  29. Pull Requests vs. Issues
    Turn off issues in favor of pull requests13
    PRs require the consumer to (at the very least):
    • RTFM.
    • Provide sample code for a feature.
    • A9empt fixing a bug.
    • Understand how to fork a GitHub project and open a PR.
    13 Turning Off Github Issues
    © 2017, Arthur Ariel Sabintsev.
    ArtSabintsev on Twi:er & Github. 29

    View Slide

  30. The 5 Day Rule
    If a consumer opens an Issue/PR, but does not
    follow up to your ques9ons/comments within
    5 work days, close the Issue/PR and move on.
    © 2017, Arthur Ariel Sabintsev.
    ArtSabintsev on Twi:er & Github. 30

    View Slide

  31. Network of Trust
    ...built on a network of trust among developers that have come to
    know each other over the years. There’s no way I can test all the
    plaevery single commit that gets merged..."
    — Linus Torvalds14
    14 Video: Linus Torvalds on How to Build a Successful Open Source Project
    © 2017, Arthur Ariel Sabintsev.
    ArtSabintsev on Twi:er & Github. 31

    View Slide

  32. Depreca'ng A Project
    • Update the README
    • Remove the codebase from the final
    commit
    © 2017, Arthur Ariel Sabintsev.
    ArtSabintsev on Twi:er & Github. 32

    View Slide

  33. Passing the Torch
    • Jesse Squires recently deprecated
    JSQMessagesViewController15
    • MessageKit is a community effort to
    support a rewri?e [email protected] version of the
    library
    15 Officially Depreca/ng JSQMessagesViewController Blog Post
    © 2017, Arthur Ariel Sabintsev.
    ArtSabintsev on Twi:er & Github. 33

    View Slide

  34. Final Words of Advice
    © 2017, Arthur Ariel Sabintsev.
    ArtSabintsev on Twi:er & Github. 34

    View Slide

  35. From The Shark Tank
    © 2017, Arthur Ariel Sabintsev.
    ArtSabintsev on Twi:er & Github. 35

    View Slide

  36. © 2017, Arthur Ariel Sabintsev.
    ArtSabintsev on Twi:er & Github. 36

    View Slide

  37. Thank You!
    h"ps:/
    /github.com/ArtSabintsev/360iDev-2017
    © 2017, Arthur Ariel Sabintsev.
    ArtSabintsev on Twi:er & Github. 37

    View Slide