我尝试用 AI 构建了一个真正的应用程序,花了一年时间
I Tried Building a Real App with AI. It Took a Year

原始链接: https://www.alexhyett.com/videos/tried-building-app-with-ai-it-took-a-year/

由于对现有习惯追踪应用高昂的订阅费用和功能缺失感到不满,作者决定利用人工智能构建一款属于自己的应用——“HabitTed”。 尽管项目起步很快,人工智能仅用六小时就生成了一个功能性原型,但开发者很快发现其底层代码是一堆臃肿、不一致且充满错误的“乱码”。人工智能生成的成果缺乏优化,在处理 iCloud 同步等复杂任务时频频失败,也难以适应新的操作系统更新。 最终,作者花费了数月时间手动重构代码库并修复漏洞,才打造出一款精良、可用的应用。虽然作者承认人工智能确实帮助项目完成了起步,但他们警告称,过度依赖 AI 会造成一种“虚假的进度感”。他们认为,人工智能可以处理项目最初的 80%,但至关重要的最后 20%——这需要深度的理解和维护——必须依靠人类真正的专业知识。作者在文末告诫道,过度依赖人工智能可能会导致下一代开发者技能退化,并制造出一个依赖于管理“AI 垃圾”的未来。

这篇 Hacker News 讨论探讨了利用人工智能开发软件的现实情况,起因是一篇关于此类项目耗时特性的文章。 主要观点包括: * **流程转变:** 人工智能将开发模式从结构化、计划性的方法转变为迭代式、“凭感觉”的过程。虽然这加快了编码速度,但也可能导致设计选择不稳定以及代码库“混乱”。 * **信任鸿沟:** 用户对“终身”软件许可和独立应用的长期支持日益怀疑。随着人工智能降低了入门门槛,软件的价值已从“能否构建”转向“能否信任”。 * **人工监督仍然必不可少:** 经验丰富的开发者认为,人工智能是工具,而非决策者的替代品。高质量的软件依然需要人工把关,以处理极端情况、维护整洁的架构并把控产品方向。 * **部署难题:** 尽管人工智能加速了编码,但最后的 10% 到 20%——包括应用商店合规、发布和持续维护——仍然是巨大的障碍。 归根结底,参与者一致认为,虽然人工智能可以快速生成代码,但构建可持续、精良的产品仍然需要大量的人类智慧和自律。
相关文章

原文

Subscribe so you don't miss out on new videos

My wife and I have been looking for an app to track things like habits, hobbies, and when we last did certain chores.

To be honest there are probably hundreds of different habit trackers on the App Store. Next to todo list apps they are supposed to be the easiest apps to create so it is not really that surprising there are so many options. But we must have tried dozens of different apps but none of them quite fit what we were looking for.

Of course now we have AI, so this sort of thing should be easy to create. You just right a couple of prompts and AI will build it for you, while you sleep, or sip cocktails on the beach.

As we shall see it didn't quite turn out that way.

Requirements and Existing Apps

So for this app I had a few requirements:

  1. We wanted to have the habits in a long list and not have to go through multiple pages to find them.
  2. We didn't want any data be stored in the cloud or on other peoples servers.
  3. We wanted to be able to use the gen-emojis from iOS 18 for some of the icons. It is a great option when the predefined icons don't fit.
  4. We needed to set goals on a daily, weekly, or monthly basis.
  5. It should be possible to have no goal and just count the number of occurrences. My wife sometimes gets headaches so she wanted to keep track of all of those as well.
  6. We wanted the ability to add notes. I wanted to be able to write down what exercises I did in each of my workouts and what speed I had got a song to when practicing guitar.
  7. We wanted to set reminders on habits, either every day or on specific days of the week or month.

There is nothing in this list that is particularly groundbreaking so I had a look at the various options to see if something would work to save me having to develop something.

We first tried the Streaks app. This is a completely free app on iOS and even has an Apple Health integration.

This suited most of my needs but it couldn't do some of the requirements on this list:

  • The apps were in pages instead of a long list. When you have 20 things you want to track this can get pretty tedious flicking through all the pages. This app has won design awards so that is probably more of a me issue.
  • My wife couldn't find suitable icons for some of the things she wanted to do. Hence wanting the ability to create your own.
  • There was no way to count occurrences. You had to set how many times you wanted to do something every day. Which if you are tracking headaches isn't what you want as ideally you don't want any.
  • She also realised she needed a way of turning off streaks. Streaks aren't always helpful for everything that you are tracking.

We tried a few more apps as well. There is a popular one called HabitKit and another one called Grit. I quite liked the GitHub style contribution charts of HabitKit but my wife, not being a developer wasn't really fussed by this. Grit was probably the closet to what we were looking for but still lacked a few features.

To be honest I would have been quite happy with either HabitKit or Grit for my needs if it wasn't for one thing, the price.

Now I don't mind paying for applications. I have lots of apps on my phone that I have bought as well as desktop software I have paid for. I am all for supporting indie developers but I also remember a time when an iPhone app was the price of a coffee.

Grit on the other hand costs £9.99/month or £29.99/year. There is an option to buy a lifetime licence but it costs a whopping £44.99. That is nearly the cost of a new console game.

It is the same story with HabitKit as well but not quite as much at £1.99/month or £11.99/year with a £29.99 lifetime option.

Maybe I am just a stingy git but I don't want to add even more subscriptions to my budget I have enough as it is.

So I set out to build one myself with the help of AI.

I started this project in March last year. Cursor were giving away free credits and it was the perfect opportunity to see what AI was capable of. Up until this point I had mostly avoided using AI beyond simple chat questions. Given I had never developed anything in Swift before I needed all the help I can get.

We decided on the name HabitTed and my wife even designed a cute bear logo.

AI Development Process

If you haven't developed an iOS app before you are pretty much limited to using XCode if you want to test your application on a simulator and debug it. So there was a lot of back and forth between cursor and Xcode to try and get everything set up.

This was just before Claude Code was released so this wasn't full agentic hands-off engineering. Instead, I broke down the development into lots of small tasks and went through them manually with the AI, testing each change as I went along.

I started with a simple hello world application. Then added in the habit list, the ability to add a habit, edit a habit and so on.

To be fair after about 6 hours over the course of a weekend, I had an app that appeared to work. It didn't do everything I wanted yet but you could create a habit with a custom icon, you could click on it to complete it, and it supported various goal options and even had iCloud syncing.

Even though I had something working and only took 6 hours, I can't say it was a pleasant 6 hours.

Usually when I complete a project, I am proud of what I have accomplished. Even if I had problems and things took longer than needed, I would finish it having learned something new.

Those failures taught me something and any frustrations I had during development were usually worth it by the end and at least I learned not to make the same mistake again.

However, after 6 hours I can't say I learnt much about Swift development.

Whenever there was an error I would find myself copy and pasting the error message and asking AI to try and fix things. I was getting annoyed with the AI for not being good enough to solve the issue, but also annoyed with myself that I couldn't do it either.

The Problems

Even though I hadn't programmed in Swift before I have programmed in many other languages and looking at the code I could tell it wasn't good code.

Each of the views was nearly a 1000 lines long. The compiler on XCode couldn't handle the length and was always telling me to break things down. Styling for things like buttons that looked the same had completely different code in different views. The whole thing was a bit of mess.

So instead of relying on AI to try and fix the mess I decided to refactor it myself, manually, the old school way. I moved everything into separate views that were no more than 100 lines long and I fixed all the inconsistent code.

I then tested the app some more to make sure everything worked properly and found even more problems.

I found that the iCloud sync didn't actually work. It may have been syncing to iCloud but if you uninstalled the application and reinstalled it, it would just lose all your data.

I also found that once I had added a lot of completions to my habits, things started to become really slow. I realised the stats I had on the details page were looping through all the habits to calculate them every single time you went on the page.

I created some properties on the habits to store the stats instead, and moved the calculation to be done on habit completion, and then I realised the data model was overly complex and had some really weird naming. This led me to coming up with a data migration plan, otherwise habits would break whenever I changed the schema.

Once everything was fixed, I added in some of the missing features such as reminders and different goal options.

Then iOS 26 came out.

I am not sure if the used AI a lot for development in Apple, but iOS 26 had a lot of bugs.

I am really not a fan of the glass effect, so I turned on the reduce transparency accessibility option and this caused all sorts of problems in my app.

I use dark mode everywhere but opening a habit caused the title bar to turn white but with white text too so you couldn't read anything.

This is where AI really falls apart. iOS 26 had only just been released so AI couldn't help with any of the new changes. I even tried to convince it that iOS 26 was the latest version and it told me I must be mistaken.

In the end I managed to solve some of my problems from reading blog posts from other developers and ultimately Apple fixed the transparency bug in 26.1.

The Result

So after many months of development, and even more months of testing I finally have an app that I am happy enough to put my name against and the code is something I am happy to carry on maintaining.

When it comes to releasing an app there is more than just the app itself, you have to put together a website and all the screenshots as well for the app listing. This always takes a lot longer than you anticipate.

It is available on the App Store if you want to give it a try, I will leave a link in the description. It is free to use for up to 6 habits, and if you did want to support me you can unlock everything for the price of a single coffee.

If it wasn't for AI, I probably wouldn't have started this app to begin with so for that I am thankful.

On the other hand, if I hadn't have used AI at all, I would have learnt a lot more and I wouldn't have needed to spend months cleaning up the codebase and fixing all the bugs.

After 6 hours, AI produced something usable but on deeper inspection it was a mess. AI coding can get you 80% there, but the last 20% will take you 80% of the time or even longer if you don't understand what it has written.

AI is more capable now than it was a year ago, but it is also more expensive and it doesn't solve the fact that by using it your aren't gaining any skills yourself. If your not able to do your job when Claude is down then you are relying far too much on AI.

I do wonder what this industry is going to be like in a few years time. No juniors are getting hired because companies are relying on senior developers with AI to do all the work.

Meanwhile, the senior developers are in 2 camps.

One half are using AI for absolutely everything but are slowly losing their ability to code. It is like a frog in boiling water that doesn't know it's dead until it is too late.

The other half are so sick of AI and are getting burnt out having to write prompts every day that they just don't want to do it anymore.

If the AI bubble does ever pop, I am not sure there is going to be enough competent developers left who are willing to pick up the pieces. Spending your time cleaning up AI slop that you didn't want to write in the first place doesn't sound like much fun.

Whichever side you're on, just make sure you don't sit in that hot water for too long.

Want to interact with this post? This website supports webmentions so you can like, comment or repost by sending a webmention from your website. You can also upvote this post on Bubbles.

You can also interact with this post by liking and commenting on this post on Mastodon. Just copy the post URL and paste it into your Mastodon search to find it. For privacy reasons, comments from Mastodon are not shown below.

联系我们 contact @ memedata.com