With technology changing almost by the minute, how do you ensure your team stays current – while still writing code and meeting deadlines?
Hootsuite does many things to keep their engineering team up to date with the newest technologies. In my time here so far, one thing in particular has stood out: Guilds.
It’s clear that Guilds contribute many positives to a company, but for iOS developers it was even more crucial: in 2014, Apple released a new programming language for native iOS applications called Swift. iOS developers have been programming in Objective-C for years (we love our square brackets and infinite method declarations), so learning a whole new language seemed like a daunting task. How do you make time in your day-to-day life as an engineer to master a completely new language? This is where Guilds come in — they’re the perfect way to come together to learn as a team.
Each week, the team met for 90 minutes and worked on something Swift-related. We watched tutorials, completed sample projects, came up with in-house coding standards, and even completed a few Swift challenges.
Since everyone had different levels of expertise in Swift, we were given “homework” to get everyone up to speed to conquer the week’s task. Whenever we got stuck on a problem, we worked out loud to come up with the best solution. This led to improvements in our team’s ability to solve problems together in Swift.
While we didn’t become Swift masters with 90 minutes of programming a week, our Guild meetings helped get our foot in the door and motivated us to learn more on our own. At the end of each Guild session, someone on the team (usually the one driving the coding) wrote a brief summary of what we accomplished and learned during that session. We then posted the summary in our iOS Guild group on Yammer, which allowed anyone from Hootsuite that is interested in iOS to see what we’ve been doing. Also, since Swift shares some characteristics with languages like Ruby and Scala, we hope to do a little internal recruiting for our team.
From Ray Wenderlich’s Programming Challenge #3:
Write a function called sumAny that can take 0 or more parameters of any type. The function should meet the following requirements:
- The function will return the sum of the passed parameters as a String, following the rules below.
- If a parameter is an empty string or an Int equal to 0, add -10 to the result.
- If a parameter is an String that represents a positive number (e.g. “10”, not “-5″), add it to the result.
- If a parameter is an Int, add it to the result.
- In any other case, do not add it to the result.
- For an extra shuriken – write the function as a single return statement and don’t use any loops (i.e. no for or while).
What did I learn from Challenge #3?
I learned how to have a variable number of parameters (variadic parameters) by adding the “…” to the parameter type. The challenge also required us to allow different types of parameters (Strings, Ints, etc.). To do this, we used the type “Any” alias. Due to the type being Any, we had to downcast the item parameter to a String or Int. This was also my first time being exposed to higher-order functions such as map, reduce, and filter. Since Objective-C doesn’t have these functions, it was very interesting to see their power in such a small problem.
What We Got Out of It
While 90 minutes of time per week might seem like a big investment for an entire team, these sessions have already proved their worth. When I’m given the task to write or modify any of our existing Swift code, I have the confidence and technical foundations to do so. A shared knowledge about Swift design patterns and best practices has also helped our team write better code and solve problems faster.
- Here are some resources to get you started learning Swift:
- Apple’s Swift Programming Language Guide
- Objc.io Issue #16 – Swift
- Ray Wenderlich Swift tutorials
- Pro Design Patterns in Swift by Adam Freeman
Thanks to Kimli Welsh, Noel Pullen, and everyone on the iOS team for taking the time to read and help me with this post.
About the Author
Taylor Ledingham is a Software Engineering graduate from the University of Regina, and a graduate from Lighthouse Labs iOS October cohort. She is a big basketball fan and dog lover. You can follow her on Twitter at @taylor_14.