A.I. as a programming assistant..?
- attofishpi
- Posts: 13319
- Joined: Tue Aug 16, 2011 8:10 am
- Location: Orion Spur
- Contact:
A.I. as a programming assistant..?
Does anyone here use ChatGPT or other AI as an assistant to their programming?
I use ChatGPT all the time and it is saving me loads of time.
Anything I am not sure how to do in most languages, I get the answer with sample code generated. Rather than searching stackoverflow etc..can't remember last time I was on that site.
I've been using GPT to do most of the code on anything basic - rather than typing out a lot of stuff, I get GPT to create the template for what I need and modify from there.
..and for code analysis - it's fantastic - I created a javascript function and all of a sudden none of the JS functions worked. I spent 10 mins looking at the code for all those daft things, ya know a single character that might be missing or out of place - didn't spot anything - then I thought mmm get GPT to look at it. Straight away there was a missing '+' for a string concatenation.
Everyday I am amazed at how "clever" it is - if I need something added to code that I am not sure how to do - such as just now creating drop down selection lists where one defines what the second list contains. I gave it this prompt:
I will paste dosomething.php which needs modifiction to provide for two 'drop-down' selection boxes. The first will have the 3 options: person/country/symbol and depending on which one is selected then the second 'drop'down' selection box will contain a list of: peoples names/country names/symbol names. Do you know how to add this functionality to it: <I pasted my current dosomething PHP text>
It adjusted the code perfectly on testing first time...AND...it created sample options as per this snippet of the JS code:-
if (category === 'person') {
options = ['John Doe', 'Jane Smith', 'Bob Johnson'];
} else if (category === 'country') {
options = ['USA', 'Canada', 'Mexico'];
} else if (category === 'symbol') {
options = ['Heart', 'Star', 'Circle'];
}
Hey presto!! It gave me SAMPLE peoples names, country names, symbol names - just wow honestly!
I use ChatGPT all the time and it is saving me loads of time.
Anything I am not sure how to do in most languages, I get the answer with sample code generated. Rather than searching stackoverflow etc..can't remember last time I was on that site.
I've been using GPT to do most of the code on anything basic - rather than typing out a lot of stuff, I get GPT to create the template for what I need and modify from there.
..and for code analysis - it's fantastic - I created a javascript function and all of a sudden none of the JS functions worked. I spent 10 mins looking at the code for all those daft things, ya know a single character that might be missing or out of place - didn't spot anything - then I thought mmm get GPT to look at it. Straight away there was a missing '+' for a string concatenation.
Everyday I am amazed at how "clever" it is - if I need something added to code that I am not sure how to do - such as just now creating drop down selection lists where one defines what the second list contains. I gave it this prompt:
I will paste dosomething.php which needs modifiction to provide for two 'drop-down' selection boxes. The first will have the 3 options: person/country/symbol and depending on which one is selected then the second 'drop'down' selection box will contain a list of: peoples names/country names/symbol names. Do you know how to add this functionality to it: <I pasted my current dosomething PHP text>
It adjusted the code perfectly on testing first time...AND...it created sample options as per this snippet of the JS code:-
if (category === 'person') {
options = ['John Doe', 'Jane Smith', 'Bob Johnson'];
} else if (category === 'country') {
options = ['USA', 'Canada', 'Mexico'];
} else if (category === 'symbol') {
options = ['Heart', 'Star', 'Circle'];
}
Hey presto!! It gave me SAMPLE peoples names, country names, symbol names - just wow honestly!
-
Flannel Jesus
- Posts: 4302
- Joined: Mon Mar 28, 2022 7:09 pm
Re: A.I. as a programming assistant..?
Yeah. I use intellij's built in one. I just use it for singular atomic little tasks though - write me a function that does this one specific thing, write me a loop that finds this element in the array. The intellij code writer can't actually even change multiple files at once so I can't (and wouldn't want to) rely on it to understand more complicated tasks than just those straight forward ones I can clearly define.attofishpi wrote: ↑Wed Jul 10, 2024 6:49 am Does anyone here use ChatGPT or other AI as an assistant to their programming?
It teaches me stuff all the time actually. It often knows simpler, more concise ways to solve certain problems than I would think of.
I'm probably atrophying my brain using this shit though...
- attofishpi
- Posts: 13319
- Joined: Tue Aug 16, 2011 8:10 am
- Location: Orion Spur
- Contact:
Re: A.I. as a programming assistant..?
I'm not familiar with intellij, from what I read on wikip it doesn't appear to be 'AI' as such - but looks like a really good IDE for code assistance - per below from wiki - I might check it out..Flannel Jesus wrote: ↑Wed Jul 10, 2024 9:43 amYeah. I use intellij's built in one. I just use it for singular atomic little tasks though - write me a function that does this one specific thing, write me a loop that finds this element in the array. The intellij code writer can't actually even change multiple files at once so I can't (and wouldn't want to) rely on it to understand more complicated tasks than just those straight forward ones I can clearly define.attofishpi wrote: ↑Wed Jul 10, 2024 6:49 am Does anyone here use ChatGPT or other AI as an assistant to their programming?
It teaches me stuff all the time actually. It often knows simpler, more concise ways to solve certain problems than I would think of.
I'm probably atrophying my brain using this shit though...
Coding assistance
The IDE provides certain features[16] like code completion by analyzing the context, code navigation which allows jumping to a class or declaration in the code directly, code refactoring, code debugging[17] , linting and options to fix inconsistencies via suggestions.
ChatGPT doesn't require a login anymore which is really handy because sometimes they boot me out of my account once a certain level of processing has been consumed - then I resort to no login and still can use it. (https://chatgpt.com/)
It's pretty handy to have sat on a 2nd screen - just copying and pasting what you need into your IDE (I still just use notepad++ !!)
I used GPT to sort a text file alphabetically for me yesterday - boy am I getting lazy! It sorted my country list - but it put numbers in front of each country - so an easy copy and paste to my country.txt file was going to have numbers - I just said, please do that again without the numbers..boom! Done!
Awesome tool - no wonder I think billions were invested into it.
-
Flannel Jesus
- Posts: 4302
- Joined: Mon Mar 28, 2022 7:09 pm
Re: A.I. as a programming assistant..?
Intellij isn't an AI, it's an IDE, that's right, and one of the features of that IDE is an AI. That's what I'm saying when I sayattofishpi wrote: ↑Wed Jul 10, 2024 10:25 amI'm not familiar with intellij, from what I read on wikip it doesn't appear to be 'AI' as such - but looks like a really good IDE for code assistance - per below from wiki - I might check it out..Flannel Jesus wrote: ↑Wed Jul 10, 2024 9:43 amYeah. I use intellij's built in one. I just use it for singular atomic little tasks though - write me a function that does this one specific thing, write me a loop that finds this element in the array. The intellij code writer can't actually even change multiple files at once so I can't (and wouldn't want to) rely on it to understand more complicated tasks than just those straight forward ones I can clearly define.attofishpi wrote: ↑Wed Jul 10, 2024 6:49 am Does anyone here use ChatGPT or other AI as an assistant to their programming?
It teaches me stuff all the time actually. It often knows simpler, more concise ways to solve certain problems than I would think of.
I'm probably atrophying my brain using this shit though...
https://www.jetbrains.com/help/idea/ai-assistant.htmlI use intellij's built in one.
I press ctrl+\ at some line in my code, tell it what I want it to do, and it writes some code for me (usually, sometimes it fucks up).
- attofishpi
- Posts: 13319
- Joined: Tue Aug 16, 2011 8:10 am
- Location: Orion Spur
- Contact:
Re: A.I. as a programming assistant..?
Ah. Sounds like a good idea will check it out sometime. I like the idea of doing some code and then just asking for the rest of some code to be generated. Someone likely has a GPT for that too..well, pretty much what I'm doing is the same - but it means I gotta paste the code into GPT and tell it what I want - still really easy.Flannel Jesus wrote: ↑Wed Jul 10, 2024 10:42 am Intellij isn't an AI, it's an IDE, that's right, and one of the features of that IDE is an AI. That's what I'm saying when I say
https://www.jetbrains.com/help/idea/ai-assistant.htmlI use intellij's built in one.
I press ctrl+\ at some line in my code, tell it what I want it to do, and it writes some code for me (usually, sometimes it fucks up).
I find GPT really good for generating the PHP and client HTML/javascript to work together on a solution too.
-
Flannel Jesus
- Posts: 4302
- Joined: Mon Mar 28, 2022 7:09 pm
Re: A.I. as a programming assistant..?
yeah that is quite interesting. not sure how well my ide would handle that, but potentially okay - i'm 80% sure it picks up context clues from other files in the system, but it can't edit multiple files at once which means a lot of the time, i have to help it fill in some blanks.attofishpi wrote: ↑Wed Jul 10, 2024 11:04 am I find GPT really good for generating the PHP and client HTML/javascript to work together
Have you read this? https://adamkarvonen.github.io/machine_ ... odels.html
Really fascinating write-up on LLMs ability to generate actual models - actual internal representations - of the things they're interacting with.
-
Impenitent
- Posts: 5774
- Joined: Wed Feb 10, 2010 2:04 pm
Re: A.I. as a programming assistant..?
I remember programming in basic...
-Imp
-Imp
- attofishpi
- Posts: 13319
- Joined: Tue Aug 16, 2011 8:10 am
- Location: Orion Spur
- Contact:
-
Impenitent
- Posts: 5774
- Joined: Wed Feb 10, 2010 2:04 pm
Re: A.I. as a programming assistant..?
- attofishpi
- Posts: 13319
- Joined: Tue Aug 16, 2011 8:10 am
- Location: Orion Spur
- Contact:
Re: A.I. as a programming assistant..?
Amazing..Flannel Jesus wrote: ↑Wed Jul 10, 2024 11:09 amyeah that is quite interesting. not sure how well my ide would handle that, but potentially okay - i'm 80% sure it picks up context clues from other files in the system, but it can't edit multiple files at once which means a lot of the time, i have to help it fill in some blanks.attofishpi wrote: ↑Wed Jul 10, 2024 11:04 am I find GPT really good for generating the PHP and client HTML/javascript to work together
Have you read this? https://adamkarvonen.github.io/machine_ ... odels.html
Really fascinating write-up on LLMs ability to generate actual models - actual internal representations - of the things they're interacting with.
I found this interesting..
"My immediate thought is to look for some sort of internal tree search. When I play chess, I perform a sort of tree search, where I first consider a range of moves, then consider my opponent’s responses to these moves. Does Chess-GPT perform a similar internal calculation when predicting the next character? Considering that it is better than I am, it seems plausible."
RE "plausible" I thought wow..surely rather than just considering the methods the GPT is employing - there must be a way to analyse how it is 'considering' its next move..maybe another GPT needs to be developed to analyse the GPT that is playing chess and provide some technical overview as to what the chess playing GPT is doing - but in a way that seems reasonable to a human!!
- just read this bit: I fine-tuned GPT-2 on a 50 / 50 mix of OpenWebText and chess games, and it learned to play chess and continued to output plausible looking text. Maybe there’s something interesting to look at there?
Kinda ironic, but I just saw ChatGPT make it's first mistake for me! - check this:-
ME:- Is Elo rating 300 Elo more advanced skill level than 1300 Elo?
GPT:- Yes, an Elo rating of 1600 indicates a significantly higher skill level compared to an Elo rating of 1300 in chess.
Looks like it added the 300 to the 1300!!
Last edited by attofishpi on Wed Jul 10, 2024 11:38 am, edited 2 times in total.
- attofishpi
- Posts: 13319
- Joined: Tue Aug 16, 2011 8:10 am
- Location: Orion Spur
- Contact:
Re: A.I. as a programming assistant..?
Yes, not the best form of coding!Impenitent wrote: ↑Wed Jul 10, 2024 11:28 aminfinite loops were a bear
-Imp
-
Flannel Jesus
- Posts: 4302
- Joined: Mon Mar 28, 2022 7:09 pm
Re: A.I. as a programming assistant..?
That's kinda what the 'linear probe' he talks about is.attofishpi wrote: ↑Wed Jul 10, 2024 11:31 ammaybe another GPT needs to be developed to analyse the GPT that is playing chess and provide some technical overview as to what the chess playing GPT is doing - but in a way that seems reasonable to a human!!
I don't blame gpt for that confusion, that is a really confusingly constructed sentence. It's easy to think you're asking about an elo rating that's '300 elo more than 1300 elo'. I bet you a lot of people would have that confusion too.attofishpi wrote: ↑Wed Jul 10, 2024 11:31 am Kinda ironic, but I just saw ChatGPT make it's first mistake for me! - check this:-
ME:- Is Elo rating 300 Elo more advanced skill level than 1300 Elo?
GPT:- Yes, an Elo rating of 1600 indicates a significantly higher skill level compared to an Elo rating of 1300 in chess.
Looks like it added the 300 to the 1300!!![]()
-
Flannel Jesus
- Posts: 4302
- Joined: Mon Mar 28, 2022 7:09 pm
Re: A.I. as a programming assistant..?
I tried it myself:
Maybe one of us is using gpt 3.5 and one is on 4.Is Elo rating 300 Elo more advanced skill level than 1300 Elo?
ChatGPT
An Elo rating of 300 is significantly lower in skill level compared to an Elo rating of 1300. In the Elo rating system, which is commonly used in chess and other competitive games, a higher rating indicates a stronger player. Here’s a general breakdown:
300 Elo: This is considered a very low rating, indicating a beginner or someone who is very new to the game.
1300 Elo: This rating is considered intermediate. Players at this level have a solid understanding of the game and can handle basic strategies and tactics.
Therefore, a player with a rating of 1300 Elo is much more advanced and skilled than a player with a rating of 300 Elo. The difference of 1000 Elo points is substantial, suggesting that the 1300 Elo player would consistently win against the 300 Elo player.
- attofishpi
- Posts: 13319
- Joined: Tue Aug 16, 2011 8:10 am
- Location: Orion Spur
- Contact:
Re: A.I. as a programming assistant..?
Yes - on re-edit I and re read I see that's basically what he is addressingFlannel Jesus wrote: ↑Wed Jul 10, 2024 11:38 amThat's kinda what the 'linear probe' he talks about is.attofishpi wrote: ↑Wed Jul 10, 2024 11:31 ammaybe another GPT needs to be developed to analyse the GPT that is playing chess and provide some technical overview as to what the chess playing GPT is doing - but in a way that seems reasonable to a human!!
mmm...nah, maybe if I used quotes to make it more distinguishable but honestly - in the year i've been using it that surprised me :-Flannel Jesus wrote:I don't blame gpt for that confusion, that is a really confusingly constructed sentence. It's easy to think you're asking about an elo rating that's '300 elo more than 1300 elo'. I bet you a lot of people would have that confusion too.attofishpi wrote: ↑Wed Jul 10, 2024 11:31 am Kinda ironic, but I just saw ChatGPT make it's first mistake for me! - check this:-
ME:- Is Elo rating 300 Elo more advanced skill level than 1300 Elo?
GPT:- Yes, an Elo rating of 1600 indicates a significantly higher skill level compared to an Elo rating of 1300 in chess.
Looks like it added the 300 to the 1300!!![]()
Is Elo rating "300 Elo" more advanced skill level than "1300 Elo"?
-
Flannel Jesus
- Posts: 4302
- Joined: Mon Mar 28, 2022 7:09 pm
Re: A.I. as a programming assistant..?
Oh no, the first signs of turning into Age.