To Code or Not To Code

naveen xavier
5 min readJul 13, 2024

--

My experiment of transforming an idea into a fully functional Android application within a few hours using ChatGPT

Do Coders Really Need LLMs?

I have been using LLMs extensively for different purposes in my line of work and have had a mixed experience; some astounding and some not so great. So my stance on LLMs has always been a skeptical optimist. I am also privy to a lot of debate raging across organisations whether ChatGPT can really change the way a software developer actually writes code. Coding for me is a logical task, which needs to be precise and contextualised to the problem being solved. I hence believed that while an LLM can generate code, it would always require a human who knows better to validate, test and correct the generated code.

So one Sunday morning, I decided to find out the answer for myself rather than rely on a gut feeling. I setup a challenge for myself with the following constraints:

  1. To pick-up a problem which needs solving using code, something personal.
  2. To use an IDE, I have never used before.
  3. To use a language, I have never heard before.
  4. Not to use any tool other than ChatGPT (No Google, StackOverflow, Github etc.)

What’s the Problem?

I had recently witnessed my wife struggling with her kiln firing at her newly constructed pottery studio. She had to maintain a log of temperature readings every few minutes, juggling between the thermocouple meter, stop clock, calculator, paper & pen among a host of other things. Here my technically adept brain saw an opportunity where this tedious process could be easily revamped through digitalisation.

Image of log book that my wife used to record temperature readings during kiln firing at her pottery studio

Next I needed an unexplored platform to bring this idea to life. I have never really been into mobile app development and for as long as I can remember, I only owned Apple products. Android is an alien concept to me and I struggle to use even its basic features. I did a quick search and found that Kotlin is the programming language and Android Studio is the platform for development.

That was perfect. My challenge to ChatGPT was to help me build an android mobile app using kotlin to aid my wife in her studio…before she serves lunch!

Challenge Accepted

My conversation started with setting up the IDE and helping me get acquainted with the interface. Next I shared with ChatGPT my wife’s plight and how she needs help with logging and calculating temperature readings. ChatGPT inundated me with more ideas than I could handle. The ideas kept going back & forth, just as I would do with an experienced colleague. Finally we agreed on the basic features of the app and locked it down.

  1. Need to handle sessions for each firing
  2. Need chronometers to handle timing requirements
  3. Build a data model to store information
  4. Create tables for viewing the readings
  5. Trigger alerts using alarms
  6. Manage files for persistence & sharing

Next was the design phase and ChatGPT was not ready to backdown. Based on our conversation, it came back with a suggested layout with all design elements. We went through some iterations and it willingly accommodated the changes I recommended.

Design iteration for layout of the mobile app

For the next phase, ChatGPT was on auto-pilot. It generated all the files in the project which encompassed all the source code, resources and config files. It told me exactly what to do and I dutifully followed the instructions. I triggered the build and waited with bated breath to see the device emulator screen pop up and the application come to life. Not a single compile error, all dependencies managed and all the features working like ‘clockwork’. That was amazing!

This was too easy, I said to myself. Need to take it to the next level. Let me add more features in the app which it has to incorporate into existing code. I was aware that any deviation in the rate of change of temperature against expected rate over a time period could severely impact quality of firing. I hence decided to ask for charts to be inserted on the screen that progressively displays current readings against expected readings. I got back revised code and I tried it out again. Gradle Build Error!!! I threw back the exception error message to ChatGPT and said your move now. It did come back with revised code but the problem persisted. Aha, I said. Not so smart after all, I smirked.

Build failure error on adding charts

I now had to don my coder cap and start the diagnosis. First time I had to really read the lines of code and do some hard labour. I realised that it had used AnyChart as the chart component and there were dependency issues when building with Maven. Well I could try and resolve this with Google but that was against the rules. So I asked ChatGPT if it could use any other chart library and also asked it to clearly provide the details where the dependencies need to be added. ChatGPT decided to try MPAndroidChart and returned back fresh code along with necessary gradle build scripts.

Loaded the new files in my project folder… and lo and behold, it worked better than I had imagined. The final step was to build the debug apk package and install the app on my low cost android phone. It sprang to life and I sat mesmerised at my desk. Is this for real? Thanks ChatGPT, for helping me bring that expression of sheer joy on my wife’s face, when I proudly showed her the app at the lunch table.

Functional mobile app with all features working as expected

Verdict is Out

The app was later successfully used for a firing session, it had a few hitches, made a few changes but it was good to go. I know this application is far from perfect, but to be fair, I just spent a couple of hours and started with nothing but arrogance. I have no doubt now. This round goes to ChatGPT. My message to every coder out there, we can do so much more in so little time… let’s start using these tools for what its worth.

--

--