First, what is ChatGPT?
ChatGPT is an advanced language model developed by OpenAI, which uses machine learning to understand language and generate natural and human-like responses to various questions and requests. The model is trained on enormous amounts of text data and can be used for a variety of purposes, including generating text, answering questions, engaging in conversations, and even assisting with research.
ChatGPT can be particularly useful for automating common tasks, such as responding to customer support inquiries or generating text for marketing or journalism. The model can also be used to improve language comprehension and writing skills by providing feedback and correction on written texts.
It is important to note that ChatGPT is not perfect and has its limitations. The model can sometimes generate erroneous responses or misunderstand questions or requests. However, with proper use and understanding of its limitations, ChatGPT can be a valuable tool for exploring and improving language comprehension and automating common tasks that previously required human intervention.
Time saved with ChatGPT
Everything you have read under the section "What is ChatGPT" is text generated by ChatGPT. Did you suspect that? I asked the question "Can you explain to me what ChatGPT is and what it can be used for in a maximum of 200 words?" and thus saved myself a few minutes of writing it myself.
So, ChatGPT is a language model, but not a knowledge model and therefore has no hint of intelligence. It is trained with "Reinforcement Learning from Human Feedback (RLHF)," which in practice means that the model tries to achieve that people like the answer it gives. That means the answer you get may seem very convincing, but actually be completely wrong. The model has not been fed with data since 2021, and therefore the service cannot give you answers about things that have happened since then. For example, if I ask ChatGPT if Avatar 2 is among the 5 most profitable films of all time, it will not be able to take a stand on that because Avatar 2 was released in December 2022. So if I search for information after 2021, I still stick to Google Search.
ChatGPT is not entirely up to date on the most profitable movies of all time.
How should we not use ChatGPT?
We constantly read about how both employers and educational institutions must deal with ChatGPT, such as teachers who despair over students who use the service to cheat on assignments and Danish universities that ban the use of the service during exams. It is natural that traditional assessment forms are challenged by such a service.
I don't think we'll see ChatGPT replace jobs anytime soon. It is rather a tool that, if used correctly, we can use to become more productive.
But before we look at what we can actually use ChatGPT for, let's take a quick look at some examples of what we should not use ChatGPT for as developers:
- Don't use ChatGPT to learn new programming languages. Even though the code it returns may run, it may not necessarily be the best way to solve the task or even be correct. There are already many fantastic services where you can get started with new programming languages.
- If you want to produce code that requires context, ChatGPT is not the solution. It will be impossible to feed ChatGPT with all the context required, such as from a codebase or a product. Writing good code that solves tasks related to the domain often requires a lot of domain knowledge, and these parameters will not be taken into account by ChatGPT.
- Where is the code stored, and who has access to the code afterwards? This is something to consider when feeding ChatGPT with code snippets. Do not include sensitive information or code that you do not want to be exposed externally. When working with a domain, you should ideally give variable names that make sense in the domain you are working in, and thus the names can expose sensitive information. An if statement is an if statement, but the name of a method can give intruders what they need to start a hacker attack
6 tips for increased productivity for developers using ChatGPT:
Now that we've looked at some examples of what not to use ChatGPT for, let's see how you can use the service to become a more efficient developer:
- If you have a code snippet that you don't fully understand, and that may be poorly documented, paste the part of the code you don't understand into ChatGPT and ask it to explain the code to you, and you may be one step closer.
- Every developer strives to code as efficiently as possible, and refactoring code can take time. Ask ChatGPT to simplify the code you want refactored, and you can achieve a more compact result more quickly.
- Writing test cases is important, but can be time-consuming and at times repetitive. ChatGPT handles writing unit tests quite well, and there is low risk of errors since you can easily see if they work, either by failing or not testing what they should. Since unit tests are quite straightforward, there is a good chance that the model can solve it well, provided you follow the following format: Test component X with inputs a, b, and c and expect the output to be Y.
- Taking time to document can sometimes be deprioritized in a busy development cycle. Get the task done faster by using ChatGPT to write parts of the documentation for you. It can even include use cases as part of the documentation.
- Do you have a segment of your code that you are struggling to debug? Then you can feed ChatGPT with what you expect to get versus what you actually get. The model can assist you in finding the problem.
- If you are evaluating new system architecture, there are many choices to be made. Use ChatGPT to compare different frameworks, and you can get some extra thoughts on which choices you should make.
These tips come with a disclaimer, of course. It is important to remember that when you use ChatGPT, it is not about letting ChatGPT do the work for you, but about streamlining processes that usually take a long time to do manually.
You should not blindly trust the output ChatGPT provides, and you should always double-check what comes out to assess whether it is usable. This is not a senior consultant with many years of experience that you can ask for help. It is currently an advanced chatbot that can help you with very specific tasks, or summarize available information in an efficient way. ChatGPT has not come to replace the job of developers. But used correctly, the service can increase your productivity, and thus free up time to write better code. And it's kind of fun to test, too.