Chatgpt and Programming

Caporegime
Joined
20 Oct 2004
Posts
26,484
Location
....
I've used it for my students, gave them some powershell stuff to 'fix'. Told a couple about chatgpt, who got to the answer within minutes, the rest of the class took significantly longer.

For beginner stuff, it's excellent.
 
Soldato
Joined
12 Dec 2006
Posts
5,105
No. It's only useful for beginner stuff and can't do more advanced programming techniques. I actually had to correct it at least twice yesterday when it was trying to use an invalid resource attribute.

Looking online. People testing it that when they retested it a few weeks later (with coding tests) it no longer had the errors they originally found. So its learning as it goes. It also didn't produce the most efficient or reusable code.

I think its useful tool for someone who can already code. But you need to be able to code to ask it the right questions. Or whatever the subject is.
 
Associate
Joined
15 Dec 2010
Posts
1,046
Location
UK
Yes. Used it to port Apache Tiles UI classes to Thymeleaf and for generating automation test feature files and steps.

It's about 80% good enough, saves a lot of legwork though.
 
Associate
Joined
18 Feb 2008
Posts
842
I use it most days now, it's wrong a lot but even with having to correct the code it outputs (or at least guide it towards the correct solution) GPT4 still saves time overall for my workflow.
 
Associate
Joined
26 Apr 2006
Posts
699
yeah as others have said it quite often has errors in its coding, however can save a bit of leg work to get a point in the right direction
 
Associate
OP
Joined
3 Oct 2014
Posts
1,755
Coming back to this, the updates seem to have completely downgraded the coding abilities.
GPT4 doesn't remember much context nowadays, avoids producing code in lots of areas and instead just wants to summarize.

That magic when I first started using it seems to have disappeared, not sure if anyone else noticed?
 
Associate
OP
Joined
3 Oct 2014
Posts
1,755
If you access ChatGPT Playgrounds it does list the older gpt-4-0613 but I don't think you can select it in their own interface.


babbage-002150,0003
davinci-002150,0003
gpt-3.5-turbo-061340,0003
gpt-3.5-turbo-110640,0003
gpt-4-061310,0003
 
Last edited:
Soldato
Joined
15 Oct 2019
Posts
11,645
Location
Uk
I had it write me some farming bot script for an old MMO I played and it worked well, you have to take care in how you ask it though as if you mention bot it’ll refuse to assist any further.
 
Associate
Joined
12 Nov 2010
Posts
790
Location
UK
Right now, I think ChatGPT is more useful for writing emails and documentation than producing code that's actually practical. Likewise, Copilot seems most useful in scenarios where it's just recognising a trend of input and suggesting a continuation of that, as opposed to actually completing entire functions or come up with it's own ideas
 
Associate
Joined
29 Oct 2008
Posts
989
I'm trailing copilot at the moment. I'm finding bits of value here and there. It can be a bit slow to suggest something inline. For instance if you write a method stub it can take a few seconds for it to generate it's suggestion meaning unless your actively waiting for it you would have begun writing the method causing you to miss any potential suggestion from copilot.

I asked it to improve a unit test from a PR recently and it pretty much just improved what was immediately obvious, taking a foreach loop and re-working it into a linq statement. I did it quickly though.

There is value to be had from these tools but key to success for everyday usage is how well they integrate with your IDE
 
Last edited:
Associate
Joined
18 Oct 2002
Posts
459
Location
In my own little world
Started using chatgpt but only for specific issues. Impressed with how well the AI interprets the requests, far better than asking similar question to google, and getting straight to stack overflow.
Colleague at work loves it.
I found the sample code it produces is pretty good in general, enough to work from anyway.
 
Man of Honour
Joined
13 Oct 2006
Posts
90,519
I just made the mistake of deciding to create a "simple" desktop program in C++... I doubt even ChatGPT could brute force through the issues I've had along the way :s

It is one bad decision after another but kind of interesting at the same time - I decided to implement DIY UPS control via a DigiSpark ATTiny85 board, which while it has a Serial over USB implementation doesn't work under Windows 10 or newer, but it can be made to look like a HID Joystick device, which using raw input can be interfaced with in the background by misusing the inputs as data streams... with the program implementing a shell notification icon to show current battery levels, etc. enable the selecting and configuring of the device and implement low battery behaviours such as shutting down the system...

I'd forgotten even simple things like getting a millisecond value in C++ is a headache... never mind raw input - even leaning heavily on someone else's code for that bit it is an absolute mess.
 
Last edited:
Soldato
Joined
28 Dec 2009
Posts
6,753
Location
Wales
IM using a gpt trained on Apple's swift documentation to help support me learning to code. It replaces endless searching. Its by no means infallible but I am blown away
 
Associate
Joined
1 Jan 2010
Posts
1,017
ChatGPT is great for either simplifying code or writing basic functions to parse / extract data. Anything beyond "simple" it falls on its head
 
Associate
Joined
28 Feb 2023
Posts
57
Location
liverpool
I've found it to be pretty poor giving me code
Doesn't compile.
Doesn't do what I asked
When I've pointed a fault out, it apologised... And gives me the same bad code.

If you're doing beginner code which solves a very common problem which has lots of repos available it can copy paste from, sure it does fine. Someone told me there's a bias even there though. Enough beginners show it bad code, that ( I was told ) biases what you get back out.

Another issue is you have code you want refined you have to give it your code. We're not allowed to do that at work.
 
Back
Top Bottom