1. Rewriting old code
ChatGPT is great at rewriting code, such as moving the codebase from Objective-C to Swift. This was one of the first cases of the Globus IT team using neural networks. To verify the authenticity of the rewritten code, iOS Team Lead Dmitry Lemaikin manually checked each line: ‘Initially, we did not believe that this was possible and that the code would not contain errors. But when we were convinced that the results were correct, we began to trust ChatGPT more’.
Tip: ChatGPT doesn’t care what language the code is written in and how it is formatted, in any case, it successfully converts it into the desired language in Swift.
2. Moving code from one platform to another
Globus IT develops native applications on both iOS and Android, so Swift and Kotlin go side by side. Often the task of transferring logic from one platform to another arises. With ChatGPT, you can port code from one platform to another, saving significant time and resources. Both languages are quite similar in syntax and structure, which means that such a conversion should not be difficult for a machine.
Tip: You can transfer models and even user interface components. There may be exceptions for complexity or compatibility.
3. Structuring unstructured data
If data or text is sent to you in an unsuitable format, then instead of wasting time for parsing it, just create a structuring prompt and send the unstructured text to ChatGPT – it will return the text in the format you need.
Tip: the text can be anything, for example, JSON, XML, a piece of literary text, a mixture of texts that are different in format and meaning.
4. Changing the styles of finished code or text
If you are unable to use a linter, then ChatGPT will come to your rescue again. In the prompt you can write your requirements for the text: change style and format of the text or translate the text into another language. It allows you to get one more piece of content.
Tip: you can use it when composing letters and formatting code.
5. Writing instructions
In order not to waste time writing instructions, for example, for adding applications to the store, you can take a finished article, run it through ChatGPT to check its relevance, and get complete instructions. Don’t forget to validate the result before sending it to the customer – to do this, you must be an expert in the field for which the instructions are written.
Tip: you will still have to validate the result, but it is easier than to write the instructions from scratch.
6. Writing unit tests
ChatGPT and other neural networks, for example, Gemini, handle unit tests well. With NLP, you can automate this process and ultimately improve the quality of your application and ensure its reliability.
Tip: you can add several classes to one prompt, as far as tokens allow.
7. Generating Stub data
This function is very useful in case you need to fill a database with descriptions of users and products. You can press “Regenerate” button in ChatGPT as many times as you like, and as a result, you will receive a huge amount of data that can be structured and used.
Tip: use that method if you need to create 1000 products with descriptions, prices, reviews and other fields.
8. Writing regular expressions
ChatGPT makes routine tasks easier. You can write a regular expression to check email and immediately ask ChatGPT to write a hundred-unit tests for this.