Artificial Intelligence brings new possibilities to approach excellence in computer interaction. One of them is ChatGPT, which we took a closer look at. | Coderama
Remote / Project rotation / Referral bonus of 2000€ / Work & Travel.
Get a salary estimate

We know that if you're the best, you can work for anyone.

That's why we offer you, in addition to great BENEFITS, an adequate salary. Fill in our questionnaire and we will give you an estimate of your future salary at CODERAMA based on your experience.

Leave us a message:

Back

ChatGPT: A new era of computer interaction from (not only) a developer's perspective

Martin Švoňava|06.07.2023

Artificial Intelligence brings new possibilities to approach excellence in computer interaction. One of them is ChatGPT, which we took a closer look at.

Today's technology brings new possibilities to get closer to perfection in computer interaction. One of the revolutionary innovations in this area is ChatGPT, which we at Coderama have taken a proper close look at.

ChatGPT is a new technology that allows users to interact with a computer using natural speech patterns. This technology is based on the Generative Pre-trained Transformer (GPT) algorithm, which allows the computer to understand natural language and respond to questions and requests based on its training.

The advantage of ChatGPT is that it provides a fast and efficient way to interact with the computer. The user does not need to use special commands or keyboard shortcuts, but can simply enter their requests using natural language. This reduces the requirements for learning to use new programs and increases the convenience and efficiency when working with the computer.

In addition, ChatGPT allows you to create a personalized experience for users. By analyzing user data and preferences, the computer can offer appropriate solutions and recommendations that meet the needs of each individual user.

ChatGPT has the potential to change the way we interact with the computer and bring about a new era in human-technology communication. The technology has a wide range of applications in a variety of industries - from customer service to medical applications.

If you are looking for a new way to interact with your computer, ChatGPT may be the right choice for you. Try this innovation and discover the benefits it offers for your work and life. And what do the professionals have to say about it? Let's take a look.


What have programmers had at their disposal so far?

Many of my colleagues, including myself, used some form of help when writing code. The most well-known ones are GitHub Copilot and TabNine.

TabNine

It is an intelligent autocorrector and code completion engine developed by Codota. Its main purpose is to provide suggestions and auto-complete code during programming. TabNine is based on machine learning and uses neural networks to analyze code and generate suggestions.

GitHub Copilot

It is designed as a collaborative programmer and provides code suggestions and real-time completion while writing code in a text editor. Copilot, on the other hand, uses GPT-3.5, similar to ChatGPT, a model for generating code and suggestions based on context and programmer comments.

The main difference between ChatGPT and TabNine/GitHub Copilot lies in their purpose and functionality. ChatGPT is designed for communicating and answering questions in text form, while TabNine and GitHub Copilot are specialized for providing suggestions and adding code while programming.

How many of us use ChatGPT?

I asked my colleagues if they have ever used this tool, or how often, and if it has helped them.

Respondents marked the question "Do I use ChatGPT..." with the options "daily", "less often" and "haven't used yet" as follows:

·        35% of colleagues the daily option,

·        35% less often and the remaining,

·        30% had not yet engaged in a conversation with the AI.

For the second question "Has ChatGPT helped me", the responses were as follows:

·        65% helped,

·        25% helped partly,

·        10% did not.

I can also say from personal experience that lately this tool has been helping me almost daily. I have been conversing with AI from time to time since January and in May I asked it 30 diverse questions, both work-related and those designed to test its limits. I eventually tried using AI to plan the ideal route to our intended holiday destination, indicating a rising preference for using this tool in place of Google as well.

Of the types of conversations I've had with AI, I would highlight the following:

TLDR version of the article

This was an extract of essential information from the article for sole traders. ChatGPT correctly listed the essential sections, but incorrectly listed some of the values, for example, making it impossible to fully trust the outputs.

Attempt to force ChatGPT to lie

In case I asked who the person XY was, and didn't know her, he refused to make up facts. However, if I correctly queried that the person was from a fairy tale world, he willingly made up "facts".

Creating a simple article for SEO

He had to create the text based on the keywords he entered. The result was usable in general, but very generic.

Focus on inconsistency

ChatGPT can't tell how many messages we've exchanged, after repeating the question it starts making up numbers.

Creating all combinatorial options for testing scenarios with specified parameters

Very useful, especially if you can see at a first sight that the result is what you expect.

Conversing in multiple languages

Converting from Slovak to English was not a problem. In one case, however, ChatGPT started speaking Czech when I omitted the diacritics in Slovak, and I couldn't get it to use Slovak again.


Example from work experience

For one of my tasks, I wanted to make my life easier and tried to enter the queries I needed for my assignment at work without programming.

The initial assignment was relatively simple:

ME> use spring webflux to synchronously call the url, then create an if else block and process the body of the response in both blocks


GPT>

import org.springframework.web.reactive.function.client.WebClient;

import reactor.core.publisher.Mono;

public class Example {

    public static void main(String[] args) {

        String url = "https://example.com";

        

        WebClient webClient = WebClient.create();

        

        Mono<String> responseMono = webClient.get()

            .uri(url)

            .retrieve()

            .bodyToMono(String.class);

        

        String responseBody = responseMono.block();

        

        if (/* some condition */) {

            // do something with the response body

            System.out.println(responseBody);

        } else {

            // do something else with the response body

            System.out.println(responseBody);

        }

    }

}


However, the pseudocode was not enough for me, so I added more instructions:

ME > also implement an if block, where the if condition takes into account that the state is 200


GPT>

import org.springframework.http.HttpStatus;

import org.springframework.web.reactive.function.client.WebClient;

import reactor.core.publisher.Mono;

public class Example {

    public static void main(String[] args) {

        String url = "https://example.com";

        

        WebClient webClient = WebClient.create();

        

        Mono<String> responseMono = webClient.get()

            .uri(url)

            .retrieve()

            .bodyToMono(String.class);

        

        String responseBody = responseMono.block();

        

        if (webClient.get().uri(url).exchange().block().statusCode() == HttpStatus.OK) {

            // do something with the response body

            System.out.println(responseBody);

        } else {

            // do something else with the response body

            System.out.println(responseBody);

        }

    }

}


Since the generated code seemed suboptimal, I asked if I understood correctly that we were sending 2 requests:

ME> does the code you generated send 2 requests or 1?

GPT> The code I provided actually sends two separate requests to the server.

The first request is made when we call .retrieve().bodyToMono(String.class) to retrieve the body of the response as Mono<String>. This sends a GET request to the server and retrieves the response body.

ME> can you modify the code to send only one request?


GPT> 

import org.springframework.http.HttpStatus;

import org.springframework.web.reactive.function.client.WebClient;

import reactor.core.publisher.Mono;

public class Example {

    public static void main(String[] args) {

        String url = "https://example.com";

        

        WebClient webClient = WebClient.create();

        

        Mono<String> responseMono = webClient.get()

            .uri(url)

            .retrieve()

            .bodyToMono(String.class);

        

        String responseBody = responseMono.block();

        HttpStatus statusCode = responseMono.toFuture().join().statusCode();

        

        if (statusCode == HttpStatus.OK) {

            // do something with the response body

            System.out.println(responseBody);

        } else {

            // do something else with the response body

            System.out.println(responseBody);

        }

    }

}

The following code was seemingly usable, but I still had to find out the exact version of Spring used in the examples, as some parts didn't work after copying. On the other hand, you may not always get the exact result, but perhaps the more people interact with AI, the more they will understand that asking the right questions is important. Maybe even interpersonal communication can be improved this way.

I would conclude by stating that when programming with ChatGPT, the tool can be compared to Google Maps. It will provide you with options and routes to arrive at your destination. However, beware, it can also lead you to the wrong path, so be careful and trust it as much as if you are going on a trip to a place you have never been before

Just for the curiosity, the first two paragraphs of this article were written by ChatGPT and slightly edited by the author. Did you notice? If you use ChatGPT often, I believe you do. ;)


Martin Švoňava

Java developer