Michael Long
1 min readJun 25, 2023

--

Been awhile since I bothered to visit one of your articles and this one looked fun, so I decided to drop in.

I don't think your example proves much.

I can write anything in three lines of code that makes it look simple, especially since you're comparing your "top level" code to the internals of his.

In your case, your "simple" code hides the custom code for api, the custom code added to Resource, your post function, and your onSuccess function.

It's also a lot fewer lines of code when you ignore Codable, enumerations, and so on in Swift and decide to root around in the raw JSON

Should also note that when you hide the code for obtaining api we also can't see how you're managing injection of that resource, how you're managing coupling, what has to change when that api is switched to another server, or even how you'd test that code that uses that code.

Oh. Right. As I remember, you don't believe in testing,, either.

--

--

Michael Long
Michael Long

Written by Michael Long

I write about Apple, Swift, and SwiftUI in particular, and technology in general. I'm also a Lead iOS Engineer at InRhythm, a modern digital consulting firm.

No responses yet