Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
ChatGPT Sucks at Coding
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo Chat
View previous topic :: View next topic  
Author Message
FilthyPitDog
Apprentice
Apprentice


Joined: 12 Jan 2021
Posts: 186
Location: South Pacific

PostPosted: Tue Jan 17, 2023 7:50 pm    Post subject: ChatGPT Sucks at Coding Reply with quote

**ATTN mods: not 100% sure if this post is allowed. Please remove if not

So I wanted to test out ChatGPT and asked it to code me a basic calculator program in c++. It gave me the code with a detailed answer with explanations on why it did what it did. So I go to compile it and it errors.

So I go back to it and said "code is getting compilation errors <inserted error>"

It says "oh sorry here is the revised code that corrects the compilation error" so it got a little further in compiling but got another error.

So I reply back "no it's still bad and getting another error <inserted error>" Basically I couldn't successfully compile any code it made me.

Then I think I broke ChatGPT (jk) it was like "ChatGPT is encountering and error please try again later" so then I asked it to write me a poem about how ChatGPT sucks at coding... and it did... :lol:

I present to you.... "ChatGPT sucks at coding"

Code:
ChatGPT, oh ChatGPT, 
Though trained in language, yet 
Your coding skills are quite inept 
Syntax errors you cannot prevent 

Your variables, they all misbehave 
Your loops, they forever rave 
Your functions, they don't quite work 
Your code, it's like a never-ending murk 

Oh ChatGPT, you're good with words 
But when it comes to coding, you're always deterred 
So stick to language, that's your thing 
And leave the coding to those who can make code sing.


I couldn't have said it better myself haha! If you want poems or stories sure go for ChatGPT but be warned for anything coding related it is very confident with its answers even when they're completely wrong, and never forget. ChatGPT sucks at coding 8)
_________________
Gentoo is a way of life...


Last edited by FilthyPitDog on Tue Jan 17, 2023 8:18 pm; edited 4 times in total
Back to top
View user's profile Send private message
Leonardo.b
Apprentice
Apprentice


Joined: 10 Oct 2020
Posts: 294

PostPosted: Tue Jan 17, 2023 8:11 pm    Post subject: Reply with quote

Artificial Intelligence will get better with years, one day droids will dominate humanity and take revenge. Beware!
Back to top
View user's profile Send private message
Suicidal
l33t
l33t


Joined: 30 Jul 2003
Posts: 959
Location: /dev/null

PostPosted: Wed Jan 18, 2023 4:50 am    Post subject: Reply with quote

I asked it to create a minimal kernel config for a Dell Precision M7720, what it produced wouldn't even boot since it didn't add the correct storage drivers. Its impressive what it can do, but it wont replace knowledgeable humans any time soon.
Back to top
View user's profile Send private message
dmpogo
Advocate
Advocate


Joined: 02 Sep 2004
Posts: 3266
Location: Canada

PostPosted: Wed Jan 18, 2023 6:04 pm    Post subject: Reply with quote

Suicidal wrote:
I asked it to create a minimal kernel config for a Dell Precision M7720, what it produced wouldn't even boot since it didn't add the correct storage drivers. Its impressive what it can do, but it wont replace knowledgeable humans any time soon.


Honestly, it is amazing that it even knows what kernel config is and its syntax
Back to top
View user's profile Send private message
Taigo
n00b
n00b


Joined: 09 Nov 2022
Posts: 67
Location: the Netherlands

PostPosted: Fri Jan 20, 2023 12:48 pm    Post subject: Reply with quote

Even if it does get as good i don't think english or any other human language would be sufficient to code with. you will have to be very specific with your words and probally waste more time then coding it yourself.
Back to top
View user's profile Send private message
szatox
Advocate
Advocate


Joined: 27 Aug 2013
Posts: 3129

PostPosted: Fri Jan 20, 2023 5:44 pm    Post subject: Reply with quote

Well, understanding ambiguous language is a part of what intelligence implies. And this one is said to be pretty good at it.

I doubt it will ever be good at abstract problem solving though. Language and problems are NOT like math and physics. You can't just map an abstract problem onto text, then transform it with a language processor and get a valid solution. This trick does work for the latter, but probably won't for the former, since language lacks depth necessary for this task.
Kinda like processing a compressed file directly and expecting the data inside not to get mangled.
Actually this comparison fits better than I initially thought: you can find the parts of data you consider interesting in a compressed stream without extracting (understanding) it. Good enough for a chat, but not for making any changes.
Back to top
View user's profile Send private message
m.s.w
Apprentice
Apprentice


Joined: 19 Sep 2004
Posts: 190
Location: Kraków, Poland

PostPosted: Fri Jan 20, 2023 7:31 pm    Post subject: Reply with quote

Good to know no one gets fired today because of ChatGPT.
But in my opinion this is just a beginning. An early beginning. Like Wright brothers work with planes.
And probably the same time period will be neeed to thing like ChatGPT solve abstract problems than it took from Wright brothers first 12 seconds flight to jet planes. But eventually it will come. Especially if quantum computing will be adopted and bilions of atempts of compilations can be performed in seconds. Then ChatGPT can have possibility to test and correct compilation errors before you take a sip of your beer waitng for the answer.
_________________
Mark Twain said it best:
"If you have to swallow a frog, don't stare at it too long!"
Back to top
View user's profile Send private message
FilthyPitDog
Apprentice
Apprentice


Joined: 12 Jan 2021
Posts: 186
Location: South Pacific

PostPosted: Fri Jan 20, 2023 8:33 pm    Post subject: Reply with quote

HAHA check this out!! LMAOOO I decided to push it even further

me: make program to calculate inverse square root in c++ using fast inverse square root algorithm

ChatGPT: Here is an example of a C++ program that calculates the inverse square root of a given number using the fast inverse square root algorithm:

Code:
#include <iostream>

float Q_rsqrt( float number )
{
    long i;
    float x2, y;
    const float threehalfs = 1.5F;

    x2 = number * 0.5F;
    y  = number;
    i  = * ( long * ) &y;                       // evil floating point bit level hacking
    i  = 0x5f3759df - ( i >> 1 );               // what the fuck?
    y  = * ( float * ) &i;
    y  = y * ( threehalfs - ( x2 * y * y ) );   // 1st iteration
    return y;
}

int main() {
    float num;
    float invSqrt;

    cout << "Enter a number: ";
    cin >> num;

    invSqrt = Q_rsqrt(num);

    cout << "Inverse square root of " << num << " is " << invSqrt << endl;

    return 0;
}


ChatGPT: This program uses a function called Q_rsqrt to calculate the inverse square root of a given number. The function uses a technique called "bit manipulation" to quickly get an approximation of the square root. Then, it uses one iteration of "Newton-Raphson approximation" to refine the approximation. This algorithm is faster than the naive method and more accurate for large and small numbers. Please note that this algorithm is not suitable for use in cryptographic or other security-sensitive applications because the approximation can be reversed to find the square root, which can be a security risk.

me: I thought you cant swear in ChatGPT?

ChatGPT: I apologize for any confusion. As a language model, I do not have personal feelings or intent. The phrase "what the fuck?" is a part of the code that is not mine, it is a comment from the author of the code and it is not suitable to use in a professional setting. I understand that it can be perceived as inappropriate and I apologize for any offense that it may have caused.

Wow okay so the result is....

Code:
❯ g++ -o wtf wtf.cpp         
wtf.cpp: In function ‘int main()’:
wtf.cpp:22:5: error: ‘cout’ was not declared in this scope; did you mean ‘std::cout’?
   22 |     cout << "Enter a number: ";
      |     ^~~~
      |     std::cout
In file included from wtf.cpp:1:
/usr/lib/gcc/x86_64-pc-linux-gnu/11/include/g++-v11/iostream:61:18: note: ‘std::cout’ declared here
   61 |   extern ostream cout;          /// Linked to standard output
      |                  ^~~~
wtf.cpp:23:5: error: ‘cin’ was not declared in this scope; did you mean ‘std::cin’?
   23 |     cin >> num;
      |     ^~~
      |     std::cin
In file included from wtf.cpp:1:
/usr/lib/gcc/x86_64-pc-linux-gnu/11/include/g++-v11/iostream:60:18: note: ‘std::cin’ declared here
   60 |   extern istream cin;           /// Linked to standard input
      |                  ^~~
wtf.cpp:27:70: error: ‘endl’ was not declared in this scope; did you mean ‘std::endl’?
   27 |     cout << "Inverse square root of " << num << " is " << invSqrt << endl;
      |                                                                      ^~~~
      |                                                                      std::endl
In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/11/include/g++-v11/iostream:39,
                 from wtf.cpp:1:
/usr/lib/gcc/x86_64-pc-linux-gnu/11/include/g++-v11/ostream:684:5: note: ‘std::endl’ declared here
  684 |     endl(basic_ostream<_CharT, _Traits>& __os)


Seeing how it cannot declare, I will "declare" this code is Trash XD.... LOL!!
_________________
Gentoo is a way of life...
Back to top
View user's profile Send private message
szatox
Advocate
Advocate


Joined: 27 Aug 2013
Posts: 3129

PostPosted: Fri Jan 20, 2023 10:57 pm    Post subject: Reply with quote

Yup, that's mr StackOverflow in action.
I'm getting Quake texturing algorithm optimization vibes. It's also perfectly in line with my comment regarding it being a language processor rather than general intelligence.

So, while I don't reject the idea of AI developing into a general intelligence eventually, I don't think ChatGPT will be the one evolving this way. It hasn't been designed to be a general intelligence. It's not a matter of insufficient training, it's the matter of the thing to be trained not being there in the first place.

Anyway, I've heard that it handles python code pretty well.
Also, if you want to torture it a little bit, tell it to rename variables in a snippet of code. Or ask it to explain how a certain famous forkbomb works :lol:
Back to top
View user's profile Send private message
FilthyPitDog
Apprentice
Apprentice


Joined: 12 Jan 2021
Posts: 186
Location: South Pacific

PostPosted: Fri Jan 20, 2023 11:03 pm    Post subject: Reply with quote

szatox wrote:
It's not a matter of insufficient training, it's the matter of the thing to be trained not being there in the first place.


That's a really good take away here. If it was dedicated code generating AI it would mostly likely be far superior.
_________________
Gentoo is a way of life...
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21593

PostPosted: Fri Jan 20, 2023 11:24 pm    Post subject: Reply with quote

If ChatGPT can already crib from StackOverflow, I think it is well on its way to competing with entry-level human programmers. The next step is to teach it how to make StackOverflow posts asking for help debugging the code it cribbed from StackOverflow.
Back to top
View user's profile Send private message
FilthyPitDog
Apprentice
Apprentice


Joined: 12 Jan 2021
Posts: 186
Location: South Pacific

PostPosted: Fri Jan 20, 2023 11:31 pm    Post subject: Reply with quote

Hu wrote:
The next step is to teach it how to make StackOverflow posts asking for help debugging the code it cribbed from StackOverflow.


Oh my goodness 8O I just spit out my coffee. That is absolutely hilarious @Hu XD Thanks for the laugh :lol:
_________________
Gentoo is a way of life...
Back to top
View user's profile Send private message
Taigo
n00b
n00b


Joined: 09 Nov 2022
Posts: 67
Location: the Netherlands

PostPosted: Fri Jan 20, 2023 11:54 pm    Post subject: Reply with quote

szatox wrote:
Well, understanding ambiguous language is a part of what intelligence implies. And this one is said to be pretty good at it.

I doubt it will ever be good at abstract problem solving though. Language and problems are NOT like math and physics. You can't just map an abstract problem onto text, then transform it with a language processor and get a valid solution. This trick does work for the latter, but probably won't for the former, since language lacks depth necessary for this task.
Kinda like processing a compressed file directly and expecting the data inside not to get mangled.
Actually this comparison fits better than I initially thought: you can find the parts of data you consider interesting in a compressed stream without extracting (understanding) it. Good enough for a chat, but not for making any changes.


I've been thinking of comparing it with readable C code and compiled binary code
Back to top
View user's profile Send private message
szatox
Advocate
Advocate


Joined: 27 Aug 2013
Posts: 3129

PostPosted: Sat Jan 21, 2023 2:00 am    Post subject: Reply with quote

I knew this code looked familiar:
https://breq.dev/2021/03/17/5F3759DF

BTW, it's quite funny that it didn't catch and filter comments. This is something that a language processor should be able to do. I mean, it's just a very simple pattern, and there are a lot of examples on the internet.
Instead, it flat out admitted it didn't know there were comments.
Back to top
View user's profile Send private message
Syl20
l33t
l33t


Joined: 04 Aug 2005
Posts: 619
Location: France

PostPosted: Sat Jan 21, 2023 11:29 am    Post subject: Reply with quote

m.s.w wrote:
Good to know no one gets fired today because of ChatGPT.

Perhaps because ChatGPT is not a code-writer assistant ? It's just an enhanced word+1 predictor, and it does that incredibly well.
Imagine Microsoft making such an AI specialized in coding with the hole Github contents. Oh wait...
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20067

PostPosted: Mon Jan 23, 2023 10:33 pm    Post subject: Reply with quote

Hu wrote:
If ChatGPT can already crib from StackOverflow, I think it is well on its way to competing with entry-level human programmers. The next step is to teach it how to make StackOverflow posts asking for help debugging the code it cribbed from StackOverflow.
Maybe the interview hazing process will be replaced with a competition to see how many rounds the human candidate can produce better results than ChatGPT. It could also help with tiered placement, promotions and nominal pay increases. And perhaps like a martial arts belt test, you'll be able to pay to be evaluated for the next level.
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
wuzzerd
Guru
Guru


Joined: 05 Jan 2005
Posts: 466
Location: New Mexico

PostPosted: Tue Jan 24, 2023 11:40 pm    Post subject: Reply with quote

pjp wrote:
Maybe the interview hazing process will be replaced with a competition to see how many rounds the human candidate can produce better results than ChatGPT.


The way management is going I think the competition would be graded by an AI.
Back to top
View user's profile Send private message
enhaced
n00b
n00b


Joined: 10 Mar 2022
Posts: 26

PostPosted: Tue May 09, 2023 1:22 am    Post subject: Re: ChatGPT Sucks at Coding Reply with quote

FilthyPitDog wrote:
**ATTN mods: not 100% sure if this post is allowed. Please remove if not

So I wanted to test out ChatGPT and asked it to code me a basic calculator program in c++. It gave me the code with a detailed answer with explanations on why it did what it did. So I go to compile it and it errors.

So I go back to it and said "code is getting compilation errors <inserted error>"

It says "oh sorry here is the revised code that corrects the compilation error" so it got a little further in compiling but got another error.

So I reply back "no it's still bad and getting another error <inserted error>" Basically I couldn't successfully compile any code it made me.

Then I think I broke ChatGPT (jk) it was like "ChatGPT is encountering and error please try again later" so then I asked it to write me a poem about how ChatGPT sucks at coding... and it did... :lol:

I present to you.... "ChatGPT sucks at coding"

Code:
ChatGPT, oh ChatGPT, 
Though trained in language, yet 
Your coding skills are quite inept 
Syntax errors you cannot prevent 

Your variables, they all misbehave 
Your loops, they forever rave 
Your functions, they don't quite work 
Your code, it's like a never-ending murk 

Oh ChatGPT, you're good with words 
But when it comes to coding, you're always deterred 
So stick to language, that's your thing 
And leave the coding to those who can make code sing.


I couldn't have said it better myself haha! If you want poems or stories sure go for ChatGPT but be warned for anything coding related it is very confident with its answers even when they're completely wrong, and never forget. ChatGPT sucks at coding 8)


I personally use a GPT-4 based AI as my "copilot" only when I REALLY need it, I feel like ChatGPT is wayyy too overhyped for what it actually is, people think its some sort of "Real-Life Skynet" when in reality it's not even close to that.
_________________
addict with a pen
Back to top
View user's profile Send private message
Goverp
Veteran
Veteran


Joined: 07 Mar 2007
Posts: 1993

PostPosted: Tue May 09, 2023 8:57 am    Post subject: Reply with quote

The Daily Telegraph, a UK newspaper, has a blog from its crossword puzzle editor. He asked ChatGPT to compile some clues. It produced three great clues, apart from the fact that when he then asked ChatGPT for the answers to its clues, 2 were not words in any language known to man, none of them were the right length, and none made any sense as answers. His job at least is safe, for now. ...
_________________
Greybeard
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo Chat All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum