Can ChatGPT replace software developers? No, but ...

Kann ChatGPT Software-Entwickler ersetzen? Nein, aber ...

Eine Fähigkeit von ChatGPT, die mich geflasht hat, ist dass GPT sogar programmieren kann.

In der jetzigen Version kann GPT kleine Programme und Funktionen schreiben, aber auch Fehler ausbessern und Sachen im Code verändern, wenn man GPT danach fragt und Programme von einer Programmiersprache in eine andere übersetzen.

Das ist schon ziemlich heftig und beeindruckend, aber es gibt wie immer Limitierungen.

GPT kann im Moment nur kleine Beispielprogramme schreiben und remixen, die man höchst wahrscheinlich in einer ähnlichen Form auch mit Google finden würde.

Und dann wäre auch noch die Sache mit den Fehlern. GPT macht häufig Fehler oder erfindet einfach etwas.

Man kann also nicht erwarten, dass einem GPT ganze, funktionstüchtige und fehlerfreie Applikationen oder Webseiten programmiert.

Die Aufgabe eines Software-Entwicklers geht normalerweise auch weit über das Programmieren hinaus und umfasst auch das Design der Software und generell das Lösen von sehr komplexen Problemen.

Ich denke daher nicht, dass GPT im Moment hoch qualifizierte Entwickler ersetzen kann, aber es ist ein sehr mächtiges Werkzeug, das in Zukunft viele Routinearbeiten effizienter machen könnte.

In Summe kann es dann schon in die Richtung gehen, dass man in Zukunft weniger Programmierer brauchen wird und sich die Arbeit eher in Richtung hoch qualifizierte Software-Architekten verlagert, die KIs dirigieren und sich um das Design und die schwierigen Aufgaben kümmern, die KIs im Moment noch nicht lösen können.

Was sagt ihr dazu? Denkt ihr, dass AI-Systeme Software-Entwickler ersetzen werden?

Coding session with ChatGPT

chatgpt-javascript-1.jpg

I asked ChatGPT to write me a javascript function to check whether an email address is correct.

Q

write a javascript function that checks whether an email address is correct

A (ChatGPT)

Sure! Here is a function that checks whether a given email address is in a valid format:

function isValidEmail(email) {
  // Use a regular expression to check for a valid email format
  var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
  return re.test(String(email).toLowerCase());
}

To use this function, you can pass in an email address as a string and it will return true if the email is in a valid format and false if it is not.

For example:

console.log(isValidEmail("test@example.com")); // true
console.log(isValidEmail("test@example")); // false

This function uses a regular expression to check for a valid email format. The regular expression checks for the presence of an "at" symbol (@), at least one character before and after the "at" symbol, and a period (.) after the "at" symbol to indicate a domain. It also allows for the inclusion of characters such as "." and "-" in the email address, as long as they are not the first or last characters.

Note

ChatGPT produced a correct javascript program with a regular expression and even provided some explanation and test examples that could be used for unit testing.

However the regex is not very optimal and efficient. Rather overcomplicated, included a check for an IP4 adress, and the test for uppercase characters is useless because the string was already converted to lowercase before.

Checking an email address with a regex can be quite hard depending how accurate the test should be.

An RFC822-compliant check would need an insanely long regex that is more than 6000 characters long.

But often you don't need an RFC-compliant check in javascript, but what you want to do is implement a quick and dirty solution.

So I asked ChatGPT to simpfly the regex:

Q

simplify the regex that validates the email address

A (ChatGPT)

Here is a simplified version of the regular expression that can be used to validate an email address:

/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/

With this regular expression, you can update the isValidEmail function like this:

function isValidEmail(email) {
  // Use a regular expression to check for a valid email format
  var re = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
  return re.test(String(email).toLowerCase());
}

This regular expression checks for the presence of an "at" symbol (@), at least one character before and after the "at" symbol, and a period (.) after the "at" symbol to indicate a domain. It also allows for the inclusion of characters such as "." and "-" in the email address, as long as they are not the first or last characters.

To use this function, you can pass in an email address as a string and it will return true if the email is in a valid format and false if it is not.

For example:

console.log(isValidEmail("test@example.com")); // true
console.log(isValidEmail("test@example")); // false

Q

make the regex even shorter and simpler

A (ChatGPT)

Here is an even shorter and simpler regular expression that can be used to validate an email address:

/^\S+@\S+$/

This regular expression checks for the presence of an "at" symbol (@) with at least one character before and after it. It does not check for a valid domain name or for the inclusion of special characters such as "." or "-".

With this regular expression, you can update the isValidEmail function like this:

function isValidEmail(email) {
  // Use a regular expression to check for a valid email format
  var re = /^\S+@\S+$/;
  return re.test(email);
}

To use this function, you can pass in an email address as a string and it will return true if the email is in a valid format and false if it is not.

For example:

console.log(isValidEmail("test@example.com")); // true
console.log(isValidEmail("test@example")); // true

Keep in mind that this regular expression is very basic and may not accurately validate all email addresses. For example, it will return true for an email address like "test@example", which is not a valid email because it does not include a domain name. To fully validate an email address, it is recommended to use a more comprehensive regular expression that checks for a valid domain name and allows for the inclusion of special characters.

Conclusion

Amazing!

English

Can ChatGPT replace software developers? No, but ...

One capability of ChatGPT that flashed me is that GPT can even code.

In the current version, GPT can write small programs and functions, but also fix bugs and change things in the code if you ask GPT to, and translate programs from one programming language to another.

This is pretty mind-boggling and impressive, but there are limitations as always.

GPT can currently only write and remix small sample programs that you would most likely find in a similar form using Google too.

And then there is the matter of bugs. GPT often makes mistakes or simply makes something up that does not make sense.

So you can't expect GPT to program you an entire, functional and bug-free app or website.

The job of a software developer usually also goes far beyond programming and includes designing the software and generally solving very complex problems.

So I don't think that GPT can replace highly skilled senior developers at the moment, but it is a very powerful tool that could make many routine tasks more efficient in the future.

All in all, it could lead to a situation where fewer programmers will be needed in the future and the work will shift more towards highly qualified software architects, who will direct AIs and take care of the design and the difficult tasks that AIs cannot solve at the moment.

What do you guys think? Will AI systems replace software developers in the long run?

Sources

[1] ChatGPT https://chat.openai.com/
[2] x-posted on my blog: https://virtualnet.at/weblog/260

Live your Secrets and Hive Prosper 🍯

xx Viki @vikisecrets

H2
H3
H4
3 columns
2 columns
1 column
22 Comments
Ecency