Refactoring, Visualizing, and Wasting(?) Days Vibe Coding
Code Paths

Refactoring, Visualizing, and Wasting(?) Days Vibe Coding

My Every app continues to progress, albeit slowly. The big reason for that is spending days upon days, hours upon hours, figuring out how my app worked, let alone why it didn't load new workouts and then fixing that. But last week, I went for a walk, looked at my phone, and BAM! A push notification telling me my walk had imported! Finally!

What have these past few weeks been like? I’ll sum it up with four realities of Vibe (and maybe Regular) Coding:

1 - Refactoring takes time, but will keep you sane.

Back in my corporate life, I joked that UX Designers always want to redesign from scratch, and developers always want to refactor. It wasn't really a joke, though. When you add new features, you realize bolting them on will just create a frankenapp* - as true for experience as it is for code. Even just thinking about your app over time helps you realize your original structure has gotten clunky. Unfortunately, AI hasn’t been great at automatically reworking code; instead, it just builds on top.

Two examples stand out:

The first was simple. I asked the AI to change a variable to a persistent one (that lives across app launches and reinstalls). I think I could have done it myself, but I'm still learning and wanted support. Instead of just declaring the variable differently, it created an entirely new persistent variable, methods to sync the old local one and the new persistent one, and complex tracking logic. After some stern questioning, it backtracked, and the correct solution was indeed a one line variable change that matched other examples in my code. For the first time, I think it would have been faster for me to have done it myself!

The second example was more complicated. I’d originally architected generic methods to process workouts, intending them to be reusable for both historical data and new workouts. When we tried adding the "new workout" functionality, the AI built a completely independent “new workout” manager, duplicating a ton of existing code instead of tweaking the generic methods I’d already created. It took days of going back and forth with the AI to create a better architecture than either the original or the “bolted on” one, but the way it works now is simple to understand - and works.

2 - Visualization in AI doesn’t just suck. It’s nonexistent.

I’m a designer, so I tend to understand things better when visualized. Developers use diagrams for the same reason: they clarify structure and logic. Unfortunately, the AI tools I’ve used don’t create visual diagrams (if you know one that does, tell me!). I eventually turned to Canva for its flowchart capabilities and manually mapped out the exact code paths for launching, authenticating, connecting to HealthKit, getting notified, rendering UI, and processing workouts in my app (part of the days described in #1). AI helped some by describing paths in text, but I never could get the descriptions to actually detail out every function call, in order. By combining AI’s text explanations, my own code walkthroughs, and my logs (see below), I created a visual that crystallized my understanding of my app completely. I highly recommend doing that if you’re a visual thinker like me. Of course like most "specs," it was outdated about 2 days later lol! Guess I'll add updating it to my tasks this week.

3 - OMG LOGS!

I have print statements for nearly everything. Seriously, my logs are as chatty as a caffeinated parrot. I announce when a function calls another function, when the second one starts, right before it finishes, and then back in the first function when it returns. I even integrated XCGLogger (AI discovered this for me) to add timestamps and function names. And, I created “task IDs” passed into every function to track concurrency, which I highly recommend, since Apple Healthkit randomly notifies your app about “new” workouts even when none exist, and your app’s "scene" changes to Active in the middle of launching (which is, duh, becoming active, but oddly timed imo).


Article content
Caffeinated Parrot Living in My Logs

I did spend an entire day trying to get logs to save to an iCloud file, allowing easy access from both my phone and computer. This was an utter and complete failure (see #4 below). Logging and visualization were worth the time; but the iCloud attempt probably wasn’t. I’m a little scared of doing production-level logging…something to learn still. :) Tips appreciated.

4 - Integration documentation pretty much sucks, ergo, AI sucks at integration.

I’ve said it before, but configuring an iOS app isn’t a strong suit of any AI model I’ve tried. After reading Apple’s own documentation closely, I can see why. When your AI goes around in circles and then just suggests deleting your entire app from the Apple Developer Portal, you know there’s an issue. (Yes, that happened.) As mentioned, I never did get iCloud Documents to work, despite exhaustively questioning three different models (and doing my own web research). On the other hand, push notifications worked immediately, though Claude and ChatGPT disagreed and I had to cross my fingers a little.

Next up is building my map interface. Will it be as easy as push notifications? Or as time-consuming as HealthKit? Or will it end in frustration like the iCloud Documents fiasco? My app is just ridiculous without a map, so let’s hope it’s not option three.

A final, vulnerable note and request

Learning to code again after 25 years, in new languages and with tools like AI, is daunting. Honestly, I’m not even sure I like it lol. I’m grateful for the individuals who’ve been supportive along the way. But I’ve also come across some subreddits and forums filled with snark, or even outright hostility, toward those of us trying our hand at software engineering. I worry that if newcomers are too afraid to engage, feeling like lurking imposters (like I have), predictions about the flood of poorly built products may become reality. I completely understand the fear of losing one’s job (though if you’re already incorporating AI, trust me, you’re far ahead of us vibing), and how frustrating it is when your expertise is glossed over by someone untrained (been there, heard that). Vibe coders should 100% be humble and respectful. But developers, please remember when you were new and confused - someone probably answered your questions instead of telling you that you didn’t belong. Please raise concerns, but also encourage learning. Thanks :) 

     

* yes, I know the scientist, not the monster, was Frankenstein, but frankenapp is just too much fun to say.

To view or add a comment, sign in

More articles by Marissa Dulaney

Others also viewed

Explore content categories