Thoroughly Modern: Practical Ways IBM i Developers Can Use AI Today
December 4, 2023 Scott Gingerysty
This October at COMMON’s NAViGATE Conference, I presented a session about practical ways that IBM i developers can use AI in their day-to-day development practices. We discussed how you can streamline and optimize the development process, improve coding velocity, enhance code hygiene, testing and documentation, and we also looked at some of the caveats. After connecting with the folks at COMMON – and seeing their enthusiasm – I felt inspired to share these examples with the IT Jungle community.
So, why AI for developers? AI offers a transformative toolkit that streamlines learning and amplifies creative problem-solving. Through machine learning algorithms, AI empowers developers to automate routine tasks and accelerate their software development lifecycle. These coding assistants enhance code quality and efficiency by offering insightful suggestions and identifying potential errors.
AI-driven tools also help developers make data-informed decisions and optimize their applications by quickly identifying patterns and offering solutions in vast datasets. By shouldering mundane tasks, AI can boost productivity and free developers to focus on innovation while fostering an agile development environment.
Let’s look at a couple practical use cases where AI can be used to streamline and optimize development processes.
CHATGPT for Prompt Engineering
ChatGPT, which stands for Chat Generative Pre-trained Transformer, is a large language model–based chatbot developed by OpenAI and launched on November 30, 2022. It enables users to refine and steer a conversation towards a desired length, format, style, level of detail, and language used. These successive prompts and replies are known as prompt engineering.
In this example, I ask ChatGPT to write a simple Vue.js program. I set some parameters:
- The program must contain a button
- When the button is clicked, call an API that returns the username
- Show the user’s name on the page
- Use the latest version of Vue
You’ll see how in the response, ChatGPT assumes I know nothing – it tells me how to get it installed and supplies the code. What I find particularly impressive is that it remembers the context of my original request when it shows me how to create a postman configuration for a mock response for the original API.
GitHub Copilot For Improving Code Velocity
ChatGPT is helpful but we have to jump between applications. It would be ideal if we could use AI in our developer tool or IDE, and this is where GitHub Copilot shines. Copilot is an intelligent code prompting and suggestion tool that turns natural language into code, and significantly reduces the time it takes to create boilerplate and repetitive code.
In this example, I demo Copilot’s suggestive capabilities in Visual Studio Code as I continue to build the application I created in the previous example. GitHub claims that Copilot helps developers code 55% faster, and you’ll see why as I quickly:
- Update front-end to send to the POST request
- Add form for username and age
- Add function for posting
Other AI Use Cases
Here are a few other ways in which AI is improving coding speed, code quality and overall developer productivity:
Learning New Technologies: Tools like ChatGPT and CoPilot can also help those who are new to web technologies (such as our Presto and WebSmart customers) begin learning how to build modern web-based applications. Perhaps you have a power user or an RPG developer that needs a little bit of help with SQL, HTML or CSS – AI augments our products and speeds up the velocity of learning those technologies.
Try asking ChatGPT “From a software engineer’s point of view, how can I improve the UI/UX of the following…” then paste some code into the tool and see what’s suggested. In one of the use cases I presented at COMMON, I used the code form that I generated in an earlier example, and it supplied useful recommendations for making the form more user friendly, visually appealing and efficient. This is a game-changer for RPG developers or any who might be trying to put together a UI or is perhaps wondering what the UI/UX trends and standards are.
Code Hygiene: As you saw in my examples, the tools used coding best practices and provided proper syntax and formatting. In another example, ChatGPT corrected a small error in a JS function I pasted into the tool.
Documentation: You can also ask a tool like ChatGPT to generate documentation for your code.
Testing: AI can help you save time on the testing side by generating test data, creating test DB files and even writing unit tests. For example, if you’re developing a web application that uses an API and you need data to populate that front end so you can see real information. You could ask ChatGPT to create a mock user dataset for you and define some parameters. Perhaps you want it formatted in JSON and you need a username, first name, last name, phone number and so on. The tool will generate the response. You could then feed it into a fake endpoint.
Cool, right? It gets cooler. Perhaps it generated 5 records. You could ask the tool to supply 50 records instead. Perhaps all users need to be from the US and Canada? No problem. Now, you could then ask it to provide the DB2 commands to create the tables for the dataset, the SQL command to create that table, the insert commands to insert all this data into that database file that it just provided. This is hours of manual work that I completed within a few minutes.
The possibilities are truly exciting – it’s hard to believe that a commercial-grade ChatGPT is only a year old.
Some Warnings And Potential Constraints
While I encourage you to begin exploring how AI might improve your development practices, it’s important to understand the potential challenges, constraints, and limitations. Here are a few things to keep in mind:
- You don’t always get what you ask for, so human oversight is a must
- Better used in small chunks because there are limits on data input and outputs
- Conversations help improve the model so treat every interaction with the assumption anyone in the world can read what you’re sharing
- Do not input private or company confidential information
I’ll close this with a quote by Sam Altman, CEO of OpenAI: “ChatGPT is incredibly limited, but good enough at some things to create a misleading impression of greatness. It’s a mistake to be relying on it for anything important right now. It’s a preview of progress. We have lots of work to do on robustness and truthfulness.”
I hope this gave you some ideas for how you might consider integrating AI into your day-to-day work. If you’re interested in seeing the full 30-minute recording of the session, you can view it here. I’m also happy to chat web development and all things IBM i modernization. Get in touch at scott.gingerysty@freschesolutions.com.
Scott Gingerysty is a Senior Web Developer/Team Lead and Application Modernization expert at Fresche.
This content is sponsored by Fresche Solutions.
RELATED STORIES
Thoroughly Modern: How X-Analysis Transforms IBM i Challenges Into Solutions
Thoroughly Modern: What’s New In IBM i IT Planning
Thoroughly Modern: Top Things To Stop IBM i Hacks
Thoroughly Modern: Remote Managed Services Fill In For Retiring And Overburdened IT Staff
Thoroughly Modern: Proven Strategies For Innovating IT And IBM i In A Digital Age
Thoroughly Modern: Unlocking the Full Potential Of Your IBM i Applications
Thoroughly Modern: Why Modernizing IBM i Applications Is Important And Where to Start
Thoroughly Modern: What You Need to Know About IBM i Security
Thoroughly Modern: Flexible And Fractional Staffing Models That Deliver
Thoroughly Modern: How To Optimize IT In 2023
Thoroughly Modern: A Swiss Army Knife For IBM i Developers
Thoroughly Modern: Digital Solutions For IBM i And Beyond
Thoroughly Modern: Simplify IBM i Application Management and Extract Key Insights
Thoroughly Modern: Four Ways Staff Augmentation Is Helping IT Get Things Done
Thoroughly Modern: Bring Security, Speed, And Consistency To IT With Automation
Thoroughly Modern: Good Security Is Just As Important As Good Code
Thoroughly Modern: The Real Top 5 Challenges For IBM i Shops Today
Thoroughly Modern: Improving The Digital Experience With APIs
Thoroughly Modern: IBM i Security Is No Longer Set It And Forget It
Thoroughly Modern: Taking Charge of Your Hardware Refresh in 2022
Thoroughly Modern: Building Organizational Resilience in the Digital Age
Thoroughly Modern: Time To Develop Your IBM i HA/DR Plan For 2022
Thoroughly Modern: Infrastructure Challenges And Easing Into The Cloud
Thoroughly Modern: Talking IBM i System Management With Abacus
Thoroughly Modern: Making The Case For Code And Database Transformation
Thoroughly Modern: Making Quick Wins Part Of Your Modernization Strategy
Thoroughly Modern: Augmenting Your Programming Today, Solving Staffing Issues Tomorrow
Thoroughly Modern: Clearing Up Some Cloud And IBM i Computing Myths
Thoroughly Modern: IBM i Web Development Trends To Watch In the Second Half
Thoroughly Modern: Innovative And Realistic Approaches To IBM i Modernization
Thoroughly Modern: Running CA 2E Applications? It’s Time To Modernize The UI
Thoroughly Modern: Understanding Your IBM i Web Application Needs With Application Discovery
Thoroughly Modern: What’s New With PHP On IBM i?
Thoroughly Modern: A Wealth Of Funding Options Makes It Easier To Take On Modernization
Thoroughly Modern: Speed Up Application Development With Automated Testing
Thoroughly Modern: The Smart Approach to Modernization – Know Before You Go!
Thoroughly Modern: Strategic Things to Consider With APIs and IBM i
Thoroughly Modern: Why You Need An IT Strategy And Roadmap
Thoroughly Modern: Top Five Reasons To Go Paperless With IBM i Forms
Thoroughly Modern: Quick Digital Transformation Wins With Web And Mobile IBM i Apps
Thoroughly Modern: Digital Modernization, But Not At Any Cost
Thoroughly Modern: Digital Transformation Is More Important Than Ever
Thoroughly Modern: Giving IBM i Developers A Helping Hand
Thoroughly Modern: Resizing Application Fields Presents Big Challenges
Thoroughly Modern: Taking The Pulse Of IBM i Developers
Thoroughly Modern: More Than Just A Pretty Face
Thoroughly Modern: Driving Your Synon Applications Forward
Thoroughly Modern: What To Pack For The Digital Transformation Journey
Well done, Scott!