The Future is Now: Integrating AI in Software program Improvement


On the planet of software program growth, the rise of synthetic intelligence (AI) has been nothing in need of revolutionary. As programmers, we’re all the time looking out for instruments that may streamline our workflow and increase productiveness. AI gives thrilling potentialities to help us in writing higher code, automating duties and even inspiring new concepts.

A robot helper standing at the shoulder of a programmer
Picture from Midjourney.

Nonetheless, whereas AI holds super promise, it’s essential to method its use with care. Like several software, AI has limitations and potential pitfalls that demand cautious navigation.

So, let’s embark on a practical journey by means of the realm of AI in programming and app design. Collectively, we’ll uncover the true worth of AI as a robust software in your arsenal and study greatest practices for leveraging its potential responsibly.

What You’ll Study:

  • The potential for utilizing AI in app growth.
  • Efficient methods for collaborating with AI.
  • Pitfalls to keep away from when utilizing AI in app design.

Be aware: All through this text, I’ll be utilizing OpenAI’s ChatGPT for all text-based examples.

On this article, you’ll study some ways in which you need to use AI to strengthen your coding skills — together with real-world examples from my very own app-building expertise. You’ll additionally study potential pitfalls to pay attention to while you use generative AI as a coding software.

Particularly, you’ll study three highly effective methods to make use of AI in software program growth:

  1. Planning your app.
  2. Enhancing your code.
  3. Designing icons and paintings.

It’s time to get began!

Brainstorming App Concepts and Options

Earlier than you write a single line of code, you want to know what you’re constructing. However the place do you start? Right here’s the place AI involves the rescue. It may be extraordinarily useful within the early phases of app creation.

Be aware that utilizing AI for design doesn’t change conducting your personal analysis amd person testing. Somewhat, it serves as a software to beat “author’s block” and provide help to deal with the suitable issues.

As you utilize Ai on this capability, bear in mind that it might provide unsound recommendation or suggest generic and uninteresting concepts. For distinctive and charming person interactions, you meed a human contact.

Suppose you need to construct an Astrology app. Your first query to ChatGPT could also be one thing like this:


I need to construct an astrology app for iOS. Are you able to give me an overview of what I would like for an MVP?

ChatGPT response shows an ordered list of app suggestions.

This can be a nice begin! It provides you a couple of concepts to pursue. Nonetheless, being an MVP, not every thing on this record will make it to model 1.0 of the product. You might ask ChatGPT to slim issues down, however it’s straightforward to see already that a very powerful function is horoscope era.

Speaking to the AI must be like brainstorming with a buddy over espresso. An excellent response to the above options may very well be:


I do not need to cope with person onboarding simply but, as that is an MVP. I just like the concepts round horoscope era. May you go into extra element on that and the way it might work in an app context?

ChatGPT response outlining the astrology app's onboarding process.

ChatGPT returns one other record and contains extra particulars about the way it must be offered to the person:

More details from ChatGPT explaining the onboarding screen.

At this level, there’s sufficient to begin engaged on the primary display screen of the app. For those who want extra guidlance, you’ll be able to proceed to ask for assist. For instance, for those who’re uncertain concerning the format, you’ll be able to ask the AI for steerage on parts like coloration schemes, UI parts and fonts.

You’ll be able to, after all, strive different prompts or ask for the responses in a unique format. Generally, I’ll ask it to interrupt its options into duties with acceptance standards. I can then copy the outcomes into mission administration software program.

AI Programming Help

AI-assisted programming is a booming business, with instruments like GitHub Copilot and Amazon’s Code Whisperer gaining reputation. Whereas some issues about AI changing programmers exist, relaxation assured that it gained’t occur anytime quickly (the explanations for which deserve a separate article). Nonetheless, leveraging AI for code writing generally is a game-changer in your programming journey.

You could be tempted to ask ChatGPT to construct a whole display screen or app for you. I’d advise towards that. Listed here are a couple of causes from ChatGPT itself:

  1. Lack of Precision and Focus: AI fashions like ChatGPT are highly effective, however their outputs might lack precision when coping with intensive codebases. By asking AI to write down code operate by operate, you keep a sharper deal with particular person elements, lowering the danger of errors and making certain higher high quality.
  2. Simpler Debugging and Testing: Smaller code snippets are simpler to debug and take a look at. When AI generates extra complete sections of code, it turns into difficult to isolate potential points or errors, resulting in lengthier debugging classes.
  3. Smoother Code Integration: Breaking down code into smaller items lets you combine it with present codebases extra easily. By step by step including AI-generated features, you’ll be able to assess their compatibility and guarantee they match seamlessly into the general construction.
  4. Human-AI Collaboration: AI is a worthwhile assistant, however collaboration with human programmers stays essential. Requesting code in smaller segments encourages a extra cooperative and iterative method, the place human programmers assessment, refine and modify the AI-generated code as wanted.

In fact, you are able to do no matter you want, however the high quality and longevity of your code might endure.

Code Technology

Astrology apps want to have the ability to convert a date of delivery to a star signal. This can be a excellent instance of the type of neat little features we will ask ChatGPT to create for us.

Right here’s the immediate I used:


May you please write a operate in Swift that takes in a date object and converts that right into a star signal?

And the response?


enum ZodiacSign: String {
  case aries = "Aries"
  case taurus = "Taurus"
  case gemini = "Gemini"
  case most cancers = "Most cancers"
  case leo = "Leo"
  case virgo = "Virgo"
  case libra = "Libra"
  case scorpio = "Scorpio"
  case sagittarius = "Sagittarius"
  case capricorn = "Capricorn"
  case aquarius = "Aquarius"
  case pisces = "Pisces"
}

func getZodiacSign(from date: Date) -> ZodiacSign {
  let calendar = Calendar.present
  let month = calendar.element(.month, from: date)
  let day = calendar.element(.day, from: date)
  
  swap month {
  case 1: // January
    return (day >= 20) ? .aquarius : .capricorn
  case 2: // February
    return (day >= 19) ? .pisces : .aquarius
  case 3: // March
    return (day >= 21) ? .aries : .pisces
  case 4: // April
    return (day >= 20) ? .taurus : .aries
  case 5: // Could
    return (day >= 21) ? .gemini : .taurus
  case 6: // June
    return (day >= 21) ? .most cancers : .gemini
  case 7: // July
    return (day >= 23) ? .leo : .most cancers
  case 8: // August
    return (day >= 23) ? .virgo : .leo
  case 9: // September
    return (day >= 23) ? .libra : .virgo
  case 10: // October
    return (day >= 23) ? .scorpio : .libra
  case 11: // November
    return (day >= 22) ? .sagittarius : .scorpio
  case 12: // December
    return (day >= 22) ? .capricorn : .sagittarius
  default:
    // Invalid date, return a default signal (e.g., Aries)
    return .aries
  }
}

The code compiles and runs completely positive in Swift Playgrounds with no errors! Even higher, ChatGPT created an enum for the zodiacs. This offers you choices so as to add extra performance sooner or later, if you need.

Nonetheless, are you able to see how there could be points with dropping this into your mission with out reviewing it? What if the dates are improper? May there be a typo within the names? Is it sluggish?

It’s vital that you simply assessment this code and make corrections the place mandatory, simply as you’d when bringing in code from different sources.

Fortunately, you’ll be able to simply take a look at this operate. For this instance, verification would solely be a matter of researching the true date ranges and writing unit checks to cowl a couple of delivery dates.

Rubber Ducking With AI

AI will all the time attempt to offer solutions, and it might fairly present a improper reply than none in any respect. Not often will it admit when it lacks info. Understand that AI’s effectiveness depends on its coaching set. Due to this fact, you’ll encounter challenges while you depend on AI to unravel distinctive or uncommon coding points.

When you end up in a loop of back-and-forth makes an attempt at making corrections and rewriting code many times, there’s another method to asking AI to unravel the difficulty instantly: rubber ducking.

Robot rubber duck
Picture from Midjourney

Rubber ducking is while you clarify your code in pure language to a buddy, and even an inanimate object, like a rubber duck. An AI software like ChatGPT makes a superb rubber duck; participating in a short chat session with it may well lead you to find your personal resolution.

Very like a problem-solving session with a colleague or explaining issues to pets or plushies, or perhaps a breakthrough bathe thought, having another person asking questions and aiding you’ll be able to show immensely helpful in overcoming obstacles and discovering artistic options.

Right here’s an actual immediate I attempted a while in the past that resulted in an incorrect reply and an in depth chat session attempting to appropriate errors:


Please create some SwiftUI code that may maintain views (as tiles) in an infinitely scrolling grid. This grid should scroll vertically and horizontally, infinitely.

Somewhat than waste web page house on all of the generated code, I’ll briefly clarify the place it went improper.

In its response, the AI’s recommendation is to nest `LazyHGrids`s inside `LazyVGrid`s inside a `ScrollView`. It didn’t even try to write down code to loop the contents. The code compiles simply positive, however to spare these with out data of SwiftUI, simply understand it doesn’t work as supposed. So what’s going to work?

Anybody accustomed to sport programming will know that this downside may very well be solved with the same method to scrolling backgrounds. When one “tile” strikes offscreen, its place is up to date to the other incoming facet.

When Code Technology Fails

After not making any progress with code era, it’s time to have a dialog with ChatGPT:


In order that code does not work as anticipated. It does not create an infinite 2D grid. Are you able to brainstorm with me some various options? I feel we might must create a customized view to deal with this. Do not give me code, ask me questions and assist me give you my very own reply

And that is the response:

ChatGPT asking me a few questions about data source, performance, etc, to help solve the problem

It got here up with some good questions. These are my solutions:


1. The information will probably be photographs. So every merchandise within the grid will probably be of a picture view kind.
2. When photographs transfer offscreen, I need to delete them from the information and cargo new ones in. The views must be relocated from the outgoing facet to the incoming facet.
3. Already talked about in quantity 2.
4. Inertial scrolling can be good.

ChatGPT’s response to that is fairly giant, however one part left a thread to comply with.

ChatGPT's description of custom scrolling behavior that mentions using DragGesture

The point out of `DragGesture` provides me an thought. So I reply with the next:


What if we began with a ZStack with picture views and used a drag gesture to alter the offset of the picture views? As soon as they transfer offscreen, we will reuse them as new content material is available in, however replace the picture reference. 

AI lastly gives some steps to unravel the issue.

ChatGPT response outlining the steps needed to solve the problem with a ZStack and using subview offsets and a drag gesture.

There’s no assure that following this information will show to achieve success. The AI may very well be improper right here, too. But it surely’s a superb begin that helped information my pondering, and it might result in a real resolution sooner or later.

Utilizing AI to Design Icons and Art work

Each app wants an icon, however not each developer is a designer. My software of selection for producing artwork for my initiatives is Midjourney, which is barely accessible through Discord.

Directions on generate the artwork might change sooner or later, however proper now, you begin a immediate with the `/think about` command. Midjourney will produce 4 photographs for any immediate. You’ll be able to select your favourite from amongst these 4 choices or create a brand new immediate and check out once more.

Right here’s a immediate I wrote to generate an icon for the astrology app:


/think about an app icon for an astrology app that gives a each day horoscope

A grid of four AI-generated app icons depicting stars and other horoscope themes

I’ve been utilizing AI to generate icons for my very own app, Summoning Stone. It contains a sound results board with customized paintings for every button.

iPad screenshot of an app called Summoning Stone displaying a sound effects board with many icons.

I wanted over 100 sound results for this mission. Sourcing them on-line or manually creating them would have been a particularly time-consuming process. Nonetheless, because of AI artwork era, I saved time right here that I can now direct towards constructing different options.

The place to Go From Right here?

AI is a flexible software, very like our trusted IDEs, {hardware}, mission administration and design software program. Embracing AI empowers us to spice up productiveness, opening new avenues for creativity and problem-solving. But, as we delve into this expertise, it’s essential to acknowledge the importance of human involvement. AI ought to complement our skills, not change them.

As you harness AI’s capabilities, method it with curiosity, warning and the duty to share its purposes in ways in which finally enrich and empower humanity.

For those who’d prefer to strive these instruments for your self:

Additionally think about different duties you might apply AI to, resembling:

  • Studying code and writing documentation.
  • Writing metadata and App Retailer descriptions.
  • Translating your product to different languages.
  • Producing in-app content material.
  • Creating paintings for press kits and different promotional supplies.

For those who’re involved in leveraging the facility of generative AI to create video games, take a look at Unlocking the Energy of AI in Sport Creation by Eric Van de Kerckhove.

Key Factors

  • AI has the aptitude to streamline and revolutionize numerous phases of app creation.
  • Builders ought to deal with AI as a collaborative software fairly than an entire resolution supplier.
  • Breaking down code into smaller segments can yield extra correct AI-generated options.
  • Iterative discussions with AI can result in personalized options tailor-made to the app’s particular wants.
  • AI-driven instruments like Midjourney empower non-designers to supply compelling visible property for his or her apps.

Have you ever discovered some other fascinating methods to make use of AI in your coding efforts? Did you may have any fascinating fails when utilizing AI in software program growth? Click on the Feedback hyperlink under to share your expertise within the boards!

In regards to the Creator

Beau Nouvelle is an iOS developer and educator with over a decade of expertise. Latest AI-powered apps embrace Summoning Stone for enhancing your tabletop video games with music, sound results and ambiance and Cryptic Wombat, a not-so-great cryptic crossword fixing app utilizing ChatGPT. He’s additionally growing an astrology app utilizing backed by AI and hosts programming dwell streams on YouTube as GetSwifty.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles