Give your simulator superpowers

RocketSim: An Essential Developer Tool
as recommended by Apple

Issue 72
Jul 20, 2021

3rd party dependencies: yes or no?

A question that always arrives when working on code projects is whether or not it's wise to add a 3rd party dependency. It has the benefit of moving fast but the risk of adding a dependency that might end up not being maintained anymore.

I used to work at an agency in which we had to move fast. Customers paid us per hour, based on estimations developers made. Like we often didn't have time to write tests, we also didn't have time to write solid solutions ourselves.

Picking a 3rd party dependency is tricky. It's important to estimate whether the library is well maintained, contains quality code, and is likely to last for the long-term future. An undocumented, not so old and unpopular library is probably not something you want to depend on.

At WeTransfer, we have a different approach to finding solutions to our problems. We use popular frameworks as an inspiration, and we always consider using them. However, if we find it possible to write a little extension ourselves, we would always prefer to go that route. Frameworks often come with much more features than needed, and you always have to wait for contributors to keep the framework up to date. Unless you want to contribute yourself, obviously, by writing your own solution, you know for sure you need to maintain it yourself, but you're also aware of what it implies, and you can keep the code to a minimum.

If a 3rd party dependency is exactly what you need, definitely consider using it. The point I want to make is that it should be a well-considered decision and not just a quick answer to a problem.

This week, I'm demonstrating such a case by implementing a relatively small piece of code to solve dependency injection instead of integrating a larger popular 3rd party framework.

Enjoy this week's SwiftLee Weekly!

THIS WEEK'S BLOG POST

Dependency injection is a common thing we do when writing code in any language. Swift comes with several features allowing us to write a simplified solution without a 3rd party dependency. I took this challenge and created a solution using static subscripts, extensions, generics, and a property wrapper.

TWEET OF THE WEEK

If you like writing, you might like this opportunity to apply for a writing position at Apple! If not, you can always look at SwiftLee Jobs to find yourself another step in your career.

SPONSORED

Never lose a copy again with Paste. It’s like a time machine for your clipboard that stores every link, image, file, or piece of code you copy and lets you access it within seconds. Want to work better, faster, and smarter? Try Paste for free right now.

CURATED FROM THE COMMUNITY

CONFERENCES

I’m linking to this for those interested in the scholarship and those interested in attending Hacking with Swift: Live!, which will be full of opportunities to learn and grow as a Swift developer.

PRODUCTIVITY

Speeding up with Xcode Behaviours can we just that little improvements that help you stay in your flow. Combine it with tips from Dominik Hauser, and you’ll be just a little faster!
One of the things I really should get better at is shortcuts. Especially the shortcut tip given by Sarun W. for showing and hiding the console will be very welcome in many cases.

CODE

That’s right; it’s not all about structured concurrency these days. Andy Ibanez explains what unstructured concurrency is and why you still need it today in Swift.
If you’re new to testing, you’re going to enjoy reading this article by Marina Gornostaeva ✨ covering several testing-related questions you might have while also giving you advice on picking what to test.
ShazamKit is one of those interesting new frameworks that arrived this year at WWDC. Rudrank Riyam started playing around with the SDK and shared his learnings with the source code to play around with it yourself.
Last weekend, I had the opportunity to try out Xcode Cloud for RocketSim. It’s been a bumpy ride, and tests aren’t succeeding yet, but it was interesting to experience the UI and integration of Xcode Cloud beta.

SWIFTLEE JOBS

Is your company hiring too? Post your job position for free at SwiftLee Jobs and reach thousands of developers.
We are looking for pragmatic, proactive senior iOS developers based in the US (for legal reasons) who love writing clean and high-quality code in Swift/Objective-C and are comfortable using UIKit,...
Work with Swift, SwiftUI, and Combine in a project that’s fully written in Swift. A modular foundation built with Swift Package Manager makes it a great project to work in.

THANK YOU

Thanks for being a SwiftLee subscriber! 
Continue your journey: