To continue in the spirit of my newsletter...
November 22nd, 2021
To continue in the spirit of my newsletter...
To continue in the spirit of my newsletter edition a few days ago, time for a story from my iOS work at LinkedIn last week. " "" "Voyager-iOS, the code name for the main LinkedIn application, is a massive Xcode project built up since early 2015 with hundreds of engineers' contributions. The project initially started in pure Swift -- only a year after the language came out -- and eschewed Titan, the old Objective-C application codebase. " "" "The project quickly turned into a build time nightmare as the Swift compiler was not yet ready for a codebase of this size (we had builds taking 1hr+ at times), so we started a large migration back to Objective-C. But, of course, the Swift compiler continued to get better over the past few years, and there have been new ways developed of mitigating significant build times. So now we're back to primarily adding new code in Swift, but we have a massive codebase of mixed code that is still slow to build. " "" "Now we skip forward to my experience trying to add a simple, small button hooked up to an API last week. A toast appears when you tap the button, confirming your action, which should be easy to add since that's a shared component in the codebase already. What should have been a super simple change was complicated, though, by having to implement it twice; in both versions of a specific mid-migration feature -- luckily, both were in Swift. While that should've been easy, there were inane quirks with fields I needed in API models inconsistently filled based on which version of the feature we were on, leading to a roundabout solution that took significant effort to iron out since the debugger wasn't working." "" "Debugger wasn't working?! " "" "Currently, using breakpoints within Xcode, a critical task in debugging an issue, and figuring out what's happening within a code path, doesn't work within the voyager-ios codebase. Or, more accurately: I don't have the patience for them to try to work, since last time I tried, Xcode spun for 2 minutes, and then I gave up. " "" "So how to debug in an environment like this? Well, you're going to have to write a BUNCH of print statements and prefix them with an easy-to-recognize pattern since there's a ton of junk logs that are never useful to you. Each build modifying prints will take ~30 seconds to a minute to build, so make sure you get your optional string interpolation right!" "" "I'm very excited at the prospect of improving this whole situation, and I think the iOS platform group that I actively work with is a crucial part of the solution, but perhaps we will all get M1 Maxes too, which can't hurt 😉 #bendevtip
Original post on LinkedIn