# Steve Barnegren

Published articles for Steve Barnegren.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Nitpicky Code Reviews Are a Drag

DevFeed: [Nitpicky Code Reviews Are a Drag](<https://devfeed.tech/articles/nitpicky-code-reviews-are-a-drag-25813.md>)

Original publisher: [Read original article](<https://www.steveonstuff.com/2022/02/09/nitpicky-code-reviews-are-are-drag>)

Author: Steve Barnegren

Published: 2022-02-09T00:00:00Z

Content type: opinion

Language: en

Sources: [Steve Barnegren](<https://devfeed.tech/sources/steve-barnegren.md>)

Topics: [Code review](<https://devfeed.tech/topics/code-review.md>), [Pull Request](<https://devfeed.tech/topics/pull-request.md>), [Code quality](<https://devfeed.tech/topics/code-quality.md>), [engineering-culture](<https://devfeed.tech/topics/engineering-culture.md>)

Tags: [also](<https://devfeed.tech/tags/also.md>), [bug](<https://devfeed.tech/tags/bug.md>), [code-quality](<https://devfeed.tech/tags/code-quality.md>), [code-reviews](<https://devfeed.tech/tags/code-reviews.md>), [complexity](<https://devfeed.tech/tags/complexity.md>), [culture](<https://devfeed.tech/tags/culture.md>), [reviews](<https://devfeed.tech/tags/reviews.md>), [team](<https://devfeed.tech/tags/team.md>)

### AI overview

This opinion argues that code reviews should prioritize bugs, architectural improvements, and complexity reduction over harmless stylistic preferences. Excessive focus on conformity can create review noise without changing how the code works.

### Source excerpt

Programmers can be a pedantic bunch. We like everything to be consistent. Uniform. Organised. Just so.

## There's No Such Thing as Clean Code

DevFeed: [There's No Such Thing as Clean Code](<https://devfeed.tech/articles/there-s-no-such-thing-as-clean-code-25812.md>)

Original publisher: [Read original article](<https://www.steveonstuff.com/2022/01/27/no-such-thing-as-clean-code>)

Author: Steve Barnegren

Published: 2022-01-27T00:00:00Z

Content type: opinion

Language: en

Sources: [Steve Barnegren](<https://devfeed.tech/sources/steve-barnegren.md>)

Topics: [clean-code](<https://devfeed.tech/topics/clean-code.md>), [Code](<https://devfeed.tech/topics/code.md>), [Testing](<https://devfeed.tech/topics/testing.md>), [interfaces](<https://devfeed.tech/topics/interfaces.md>)

Tags: [blog](<https://devfeed.tech/tags/blog.md>), [blog-post](<https://devfeed.tech/tags/blog-post.md>), [clean-code](<https://devfeed.tech/tags/clean-code.md>), [code](<https://devfeed.tech/tags/code.md>), [developers](<https://devfeed.tech/tags/developers.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [interfaces](<https://devfeed.tech/tags/interfaces.md>), [technical](<https://devfeed.tech/tags/technical.md>), [testing](<https://devfeed.tech/tags/testing.md>)

### AI overview

This opinion argues that "clean code" is not a useful technical measure because code quality involves different goals that can conflict. It recommends discussing concrete trade-offs and explaining why one solution is better or worse instead of treating "cleanest" as an objective metric.

### Source excerpt

Everyone seems to be striving for 'clean' code at the moment. You can't read a blog post without the author telling you how clean their approach is. Engineering teams get together and discuss which of the possible solutions is the cleanest. Other developers assure you that they practice 'clean code'.

## An Approach for Migrating From Objective-C to Swift

DevFeed: [An Approach for Migrating From Objective-C to Swift](<https://devfeed.tech/articles/an-approach-for-migrating-from-objective-c-to-swift-25811.md>)

Original publisher: [Read original article](<https://www.steveonstuff.com/2022/01/13/migrating-from-objc-to-swift>)

Author: Steve Barnegren

Published: 2022-01-13T00:00:00Z

Content type: tutorial

Language: en

Sources: [Steve Barnegren](<https://devfeed.tech/sources/steve-barnegren.md>)

Topics: [Objective-C](<https://devfeed.tech/topics/objective-c.md>), [Swift](<https://devfeed.tech/topics/swift.md>), [interoperability](<https://devfeed.tech/topics/interoperability.md>), [iOS](<https://devfeed.tech/topics/ios.md>), [tvOS](<https://devfeed.tech/topics/tvos.md>), [generics](<https://devfeed.tech/topics/generics.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [apple](<https://devfeed.tech/tags/apple.md>), [enums](<https://devfeed.tech/tags/enums.md>), [generics](<https://devfeed.tech/tags/generics.md>), [interoperability](<https://devfeed.tech/tags/interoperability.md>), [ios](<https://devfeed.tech/tags/ios.md>), [objective-c](<https://devfeed.tech/tags/objective-c.md>), [optional](<https://devfeed.tech/tags/optional.md>), [swift](<https://devfeed.tech/tags/swift.md>), [types](<https://devfeed.tech/tags/types.md>), [with](<https://devfeed.tech/tags/with.md>)

### AI overview

This article shares lessons from transitioning a large iOS and tvOS application from Objective-C to Swift. It explains why simply adding new Swift code produced limited progress and caused Swift code to be constrained by Objective-C interoperability.

### Source excerpt

It feels like Swift is pretty ubiquitous across the Apple ecosystem now, but there's a lot of Objective-C out there. The larger and older the app, the more likely that there's still a bunch of Objective-C powering various bits behind the scenes.

## Own Your Abstractions

DevFeed: [Own Your Abstractions](<https://devfeed.tech/articles/own-your-abstractions-25810.md>)

Original publisher: [Read original article](<https://www.steveonstuff.com/2019/09/12/own-your-abstractions>)

Author: Steve Barnegren

Published: 2019-09-12T00:00:00Z

Content type: opinion

Language: en

Sources: [Steve Barnegren](<https://devfeed.tech/sources/steve-barnegren.md>)

Topics: [Swift](<https://devfeed.tech/topics/swift.md>), [Testing](<https://devfeed.tech/topics/testing.md>), [Protocol (disambiguation)](<https://devfeed.tech/topics/protocol.md>), [Filesystems](<https://devfeed.tech/topics/filesystems.md>)

Tags: [objective-c](<https://devfeed.tech/tags/objective-c.md>), [protocol](<https://devfeed.tech/tags/protocol.md>), [shadowing](<https://devfeed.tech/tags/shadowing.md>), [swift](<https://devfeed.tech/tags/swift.md>), [test](<https://devfeed.tech/tags/test.md>), [testing](<https://devfeed.tech/tags/testing.md>)

### AI overview

The article examines a Swift testing technique that mirrors an external concrete type with a protocol and uses mocks for dependency isolation. It argues that this shadowing approach can hide deprecation warnings and encourages designing semantic abstractions instead of replicating awkward APIs.

### Source excerpt

If you want to test your Swift code, at some point you're probably going to need to make some mocks in order to isolate a type that you're testing from system apis. For instance, if your type calls UNNotificationCenter, then in your tests you don't want it to call the real UNNotificiationCenter, but rather a mock substitute that you control.

## Exhaustive Collections Of Structs

DevFeed: [Exhaustive Collections Of Structs](<https://devfeed.tech/articles/exhaustive-collections-of-structs-25809.md>)

Original publisher: [Read original article](<https://www.steveonstuff.com/2019/03/14/exhaustive-collections-of-sructs>)

Author: Steve Barnegren

Published: 2019-03-14T00:00:00Z

Content type: tutorial

Language: en

Sources: [Steve Barnegren](<https://devfeed.tech/sources/steve-barnegren.md>)

Topics: [enum](<https://devfeed.tech/topics/enum.md>), [dataset](<https://devfeed.tech/topics/dataset.md>), [data](<https://devfeed.tech/topics/data.md>), [Compiler](<https://devfeed.tech/topics/compiler.md>)

Tags: [collections](<https://devfeed.tech/tags/collections.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [data](<https://devfeed.tech/tags/data.md>), [dataset](<https://devfeed.tech/tags/dataset.md>), [enum](<https://devfeed.tech/tags/enum.md>), [enums](<https://devfeed.tech/tags/enums.md>)

### AI overview

The article examines modeling a heterogeneous dataset, such as a social networking feed, with enums and associated values. It explains that this approach can become difficult to scale and organize, then introduces collections of structs as a more flexible alternative.

### Source excerpt

It's not uncommon that we need to model a dataset composed of a finite number of discrete data types, where each data type has it's own unique data model. This is often the case for table view data sources - they're often comprised of a few different cell types, with each cell type having a different set of properties that it needs to be configured with.

## The Humble TableView

DevFeed: [The Humble TableView](<https://devfeed.tech/articles/the-humble-tableview-25808.md>)

Original publisher: [Read original article](<https://www.steveonstuff.com/2018/12/05/the-humble-table-view>)

Author: Steve Barnegren

Published: 2018-12-05T00:00:00Z

Content type: tutorial

Language: en

Sources: [Steve Barnegren](<https://devfeed.tech/sources/steve-barnegren.md>)

Topics: [Testing](<https://devfeed.tech/topics/testing.md>), [ui](<https://devfeed.tech/topics/ui.md>), [App](<https://devfeed.tech/topics/app.md>)

Tags: [applications](<https://devfeed.tech/tags/applications.md>), [testing](<https://devfeed.tech/tags/testing.md>), [ui](<https://devfeed.tech/tags/ui.md>)

### AI overview

This article examines why increasingly complex table and collection views are difficult to test when domain models do not contain all the information required by the UI. Using a music-streaming example, it introduces the problem of displaying locally downloaded state alongside track data.

### Source excerpt

I've been thinking about tableviews recently. Table views and collection views have become the default way to build UI for many types of applications, especially content driven ones. As our table views become increasingly complex though, testing that they're showing the correct content becomes difficult to do.

## Intentional Optionality

DevFeed: [Intentional Optionality](<https://devfeed.tech/articles/intentional-optionality-25807.md>)

Original publisher: [Read original article](<https://www.steveonstuff.com/2018/09/13/intentional-optionality>)

Author: Steve Barnegren

Published: 2018-09-13T00:00:00Z

Content type: tutorial

Language: en

Sources: [Steve Barnegren](<https://devfeed.tech/sources/steve-barnegren.md>)

Topics: [Swift](<https://devfeed.tech/topics/swift.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [code](<https://devfeed.tech/tags/code.md>), [guards](<https://devfeed.tech/tags/guards.md>), [let](<https://devfeed.tech/tags/let.md>), [optional](<https://devfeed.tech/tags/optional.md>), [swift](<https://devfeed.tech/tags/swift.md>)

### AI overview

A Swift article examines intentional use of optionality. It argues that while non-optional types are usually preferable, optional values can sometimes make code easier to read and understand, including when handling leaderboard entries and conditional menu items.

### Source excerpt

When I first started writing Swift, I felt like Optionals were a constant pain point. Everything seemed to end up being Optional, resulting in me littering if lets and guards around my code, and generally just making a horrible mess of things.

## Delegates vs Closure Callbacks

DevFeed: [Delegates vs Closure Callbacks](<https://devfeed.tech/articles/delegates-vs-closure-callbacks-25806.md>)

Original publisher: [Read original article](<https://www.steveonstuff.com/2018/08/16/delegates-vs-closure-callbacks>)

Author: Steve Barnegren

Published: 2018-08-16T00:00:00Z

Content type: comparison

Language: en

Sources: [Steve Barnegren](<https://devfeed.tech/sources/steve-barnegren.md>)

Topics: [Swift](<https://devfeed.tech/topics/swift.md>), [Objective-C](<https://devfeed.tech/topics/objective-c.md>)

Tags: [callback](<https://devfeed.tech/tags/callback.md>), [closure](<https://devfeed.tech/tags/closure.md>), [compare](<https://devfeed.tech/tags/compare.md>), [delegates](<https://devfeed.tech/tags/delegates.md>), [objective-c](<https://devfeed.tech/tags/objective-c.md>), [patterns](<https://devfeed.tech/tags/patterns.md>), [swift](<https://devfeed.tech/tags/swift.md>)

### AI overview

This comparison examines delegate and closure callback patterns in Swift, focusing on retain-cycle handling and managing callbacks from multiple instances. It finds delegates safer for weak-reference relationships, while closure callbacks are clearer when separating callbacks for multiple instances.

### Source excerpt

Remember how awesome the delegate pattern was in Objective-C? Enabling classes to be super reusable by delegating out the bits that you might want control over. There's a reason that it's so ubiquitous across Cocoa Touch, it's just so damn good!

## Fixing Xcode's Comment Wrapping Problem

DevFeed: [Fixing Xcode's Comment Wrapping Problem](<https://devfeed.tech/articles/fixing-xcode-s-comment-wrapping-problem-25805.md>)

Original publisher: [Read original article](<https://www.steveonstuff.com/2018/06/28/fixing-xcodes-comment-wrapping-problem>)

Author: Steve Barnegren

Published: 2018-06-28T00:00:00Z

Content type: tutorial

Language: en

Sources: [Steve Barnegren](<https://devfeed.tech/sources/steve-barnegren.md>)

Topics: [Xcode](<https://devfeed.tech/topics/xcode.md>), [Extension](<https://devfeed.tech/topics/extension.md>), [Swift](<https://devfeed.tech/topics/swift.md>)

Tags: [documentation](<https://devfeed.tech/tags/documentation.md>), [extensions](<https://devfeed.tech/tags/extensions.md>), [github](<https://devfeed.tech/tags/github.md>), [swift](<https://devfeed.tech/tags/swift.md>), [xcode](<https://devfeed.tech/tags/xcode.md>)

### AI overview

This tutorial explains Xcode's comment-wrapping problem and presents an automated solution using an Xcode Source Editor Extension. The resulting Comment wrapper tool can wrap and re-wrap comments, with additional features available through GitHub or the App Store.

### Source excerpt

I'm sure we've all come across the comment wrapping problem. You write a long comment that looks like this:

## Better Xcode Build Numbers

DevFeed: [Better Xcode Build Numbers](<https://devfeed.tech/articles/better-xcode-build-numbers-25804.md>)

Original publisher: [Read original article](<https://www.steveonstuff.com/2018/05/24/better-xcode-build-numbers>)

Author: Steve Barnegren

Published: 2018-05-24T00:00:00Z

Content type: tutorial

Language: en

Sources: [Steve Barnegren](<https://devfeed.tech/sources/steve-barnegren.md>)

Topics: [Xcode](<https://devfeed.tech/topics/xcode.md>), [iOS](<https://devfeed.tech/topics/ios.md>), [macOS](<https://devfeed.tech/topics/macos.md>), [Script](<https://devfeed.tech/topics/script.md>), [App](<https://devfeed.tech/topics/app.md>)

Tags: [app](<https://devfeed.tech/tags/app.md>), [build](<https://devfeed.tech/tags/build.md>), [ios](<https://devfeed.tech/tags/ios.md>), [macos](<https://devfeed.tech/tags/macos.md>), [script](<https://devfeed.tech/tags/script.md>), [xcode](<https://devfeed.tech/tags/xcode.md>)

### AI overview

This tutorial explains how to use timestamp-based build numbers for iOS and macOS apps in Xcode. It describes the limitations of manually incrementing build numbers and introduces a Run Script Phase to automate the approach.

### Source excerpt

iOS and macOS apps have a version number and a build number. Typically you see these in Xcode or iTunes Connect represented something like this: