View previous topic :: View next topic |
Author |
Message |
FilthyPitDog Apprentice
Joined: 12 Jan 2021 Posts: 199 Location: South Pacific
|
Posted: Tue Jan 17, 2023 7:50 pm Post subject: ChatGPT Sucks at Coding |
|
|
**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...
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 _________________ 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 |
|
|
Leonardo.b Guru
Joined: 10 Oct 2020 Posts: 308
|
Posted: Tue Jan 17, 2023 8:11 pm Post subject: |
|
|
Artificial Intelligence will get better with years, one day droids will dominate humanity and take revenge. Beware! |
|
Back to top |
|
|
Suicidal l33t
Joined: 30 Jul 2003 Posts: 959 Location: /dev/null
|
Posted: Wed Jan 18, 2023 4:50 am Post subject: |
|
|
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 |
|
|
dmpogo Advocate
Joined: 02 Sep 2004 Posts: 3468 Location: Canada
|
Posted: Wed Jan 18, 2023 6:04 pm Post subject: |
|
|
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 |
|
|
Taigo Tux's lil' helper
Joined: 09 Nov 2022 Posts: 105 Location: the Netherlands
|
Posted: Fri Jan 20, 2023 12:48 pm Post subject: |
|
|
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 |
|
|
szatox Advocate
Joined: 27 Aug 2013 Posts: 3489
|
Posted: Fri Jan 20, 2023 5:44 pm Post subject: |
|
|
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 |
|
|
m.s.w Apprentice
Joined: 19 Sep 2004 Posts: 193 Location: Kraków, Poland
|
Posted: Fri Jan 20, 2023 7:31 pm Post subject: |
|
|
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 |
|
|
FilthyPitDog Apprentice
Joined: 12 Jan 2021 Posts: 199 Location: South Pacific
|
Posted: Fri Jan 20, 2023 8:33 pm Post subject: |
|
|
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 |
|
|
szatox Advocate
Joined: 27 Aug 2013 Posts: 3489
|
Posted: Fri Jan 20, 2023 10:57 pm Post subject: |
|
|
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 |
|
Back to top |
|
|
FilthyPitDog Apprentice
Joined: 12 Jan 2021 Posts: 199 Location: South Pacific
|
Posted: Fri Jan 20, 2023 11:03 pm Post subject: |
|
|
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 |
|
|
Hu Administrator
Joined: 06 Mar 2007 Posts: 23062
|
Posted: Fri Jan 20, 2023 11:24 pm Post subject: |
|
|
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 |
|
|
FilthyPitDog Apprentice
Joined: 12 Jan 2021 Posts: 199 Location: South Pacific
|
Posted: Fri Jan 20, 2023 11:31 pm Post subject: |
|
|
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 I just spit out my coffee. That is absolutely hilarious @Hu XD Thanks for the laugh _________________ Gentoo is a way of life... |
|
Back to top |
|
|
Taigo Tux's lil' helper
Joined: 09 Nov 2022 Posts: 105 Location: the Netherlands
|
Posted: Fri Jan 20, 2023 11:54 pm Post subject: |
|
|
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 |
|
|
szatox Advocate
Joined: 27 Aug 2013 Posts: 3489
|
Posted: Sat Jan 21, 2023 2:00 am Post subject: |
|
|
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 |
|
|
Syl20 l33t
Joined: 04 Aug 2005 Posts: 621 Location: France
|
Posted: Sat Jan 21, 2023 11:29 am Post subject: |
|
|
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 |
|
|
pjp Administrator
Joined: 16 Apr 2002 Posts: 20583
|
Posted: Mon Jan 23, 2023 10:33 pm Post subject: |
|
|
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 |
|
|
wuzzerd Guru
Joined: 05 Jan 2005 Posts: 467 Location: New Mexico
|
Posted: Tue Jan 24, 2023 11:40 pm Post subject: |
|
|
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 |
|
|
enhaced n00b
Joined: 10 Mar 2022 Posts: 26
|
Posted: Tue May 09, 2023 1:22 am Post subject: Re: ChatGPT Sucks at Coding |
|
|
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...
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 |
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 |
|
|
Goverp Advocate
Joined: 07 Mar 2007 Posts: 2202
|
Posted: Tue May 09, 2023 8:57 am Post subject: |
|
|
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 |
|
|
|