Using Chatgpt to write code
Author
Discussion

Inbox

Original Poster:

595 posts

4 months

Thursday 9th October
quotequote all
I really struggle to write any code, having spent the morning on a project on a Raspberry Pi Pico I thought I would ask Chatgpt.

Basically it came up with some working code in less time it took me to type in what I wanted, then you can just keep asking for bits to be added or changed and it produces more code, that works.

If I were a software engineer I would be worried.

Harpoon

2,275 posts

232 months

Thursday 9th October
quotequote all
What's known as "Vibe Coding" these days

james6546

1,379 posts

69 months

Thursday 9th October
quotequote all
People keep sending me code that they’ve asked AI to write, think I’ll be ok for a while yet.

Customers who are able to do their own changes sounds terrifying, I spend most of my time explaining why code changes are a bad idea to do!

FarmyardPants

4,261 posts

236 months

Thursday 9th October
quotequote all
This assumes you need new code, for which AI tools are a great time saver.

There is plenty of legacy code that no AI could deal with when it comes to maintenance and enhancement.

mike9009

8,659 posts

261 months

Thursday 9th October
quotequote all
I used to be fairly good with VB code (and before that pascal, fortran, zx81 and spectrum). Today, probably 20 years after writing any 'decent' code, I resorted to ChatGPT as my memory failed me in VB.

Did it straight away with no issues. Really simple but solved an issue at work in a matter of seconds.....

...and, I realise I am an amateur......

Hoofy

78,898 posts

300 months

Thursday 9th October
quotequote all
Sadly, I've had problems trying to get it to code stuff in Google Sheets. It managed it but I kept having to feed back errors and it kept apologising.

NiceCupOfTea

25,480 posts

269 months

Thursday 9th October
quotequote all
It's when the ChatGPT generated code starts writing its own code we need to worry.

Inbox

Original Poster:

595 posts

4 months

Thursday 9th October
quotequote all
james6546 said:
People keep sending me code that they ve asked AI to write, think I ll be ok for a while yet.

Customers who are able to do their own changes sounds terrifying, I spend most of my time explaining why code changes are a bad idea to do!
Having seen some of the bodgers that purport to be experienced embedded software engineers I think AI could give 'em run for their money.

One software project that I needed a good few years back was basically transmitting data between two devices and looping back at one end, the code needed to send/receive the data and then flash an led, red if corrupted, green if not.

The result was one bit sent the data round the loop, the other bit flashed the led but the 2 bits didn't talk each other, as useless as a chocolate teapot.

mikef

5,836 posts

269 months

Thursday 9th October
quotequote all
AI coding assistants can be real time savers

In XCode 2026 I can start to type a for-loop and it will generate several lines of code that are, for the most part, exactly what I would have written

Either we will need fewer coders, or coders will produce more syntactically-correct output quicker

james6546

1,379 posts

69 months

I think it will probably replace traditional coders tbh, but probably not those in a consultancy role, so I’ll be fine for now!

I’d be happy being replaced at the moment, might get some sleep.

.:ian:.

2,625 posts

221 months

It can be good for the bare bones of some code, especially if its complex or badly documented. Though if its too badly documented then it will struggle too. laugh

For example, create some python code using pyqt6 with a button that opens a dialogue box and another button that links to a different window.

Theres a lot of setup for that, but if you want to have a load of buttons and other ui elements and you need to explain what each one is and does, it starts to take longer to explain, rather than just take what was given for the simple example and expand on it just copy n paste the bits of code.

Unless you like writing HLD/LLD documents laugh

Also it will only give you what you ask for, mostly. Like outsourced devs, if you ask for the wrong thing, thats what you get. If you dont specify defensive measures like input sanitisation or not having sensitive information stored in publicly accessible firebase databases, you wont get them.

Experienced devs should do this by default, or at least raise it as a requirement,


Edited by .:ian:. on Friday 10th October 12:48

otolith

62,997 posts

222 months



My devs use it - but they use it either to generate boilerplate, or to produce basically a free PoC for something they're trying to do and haven't done before. They aren't asking it to generate production code.

My biggest concern about it is that what generative AI does is essentially "create text that looks like a human response to this question". When it generates nonsense, it's plausible looking nonsense. I worry that it's going to generate something that is wrong, but subtly so. It has, however, got better at analytical tasks, and is a bit less "virtual plausible bullstter" than it was.

Crafty_

13,736 posts

218 months

Inbox said:
I really struggle to write any code, having spent the morning on a project on a Raspberry Pi Pico I thought I would ask Chatgpt.

Basically it came up with some working code in less time it took me to type in what I wanted, then you can just keep asking for bits to be added or changed and it produces more code, that works.

If I were a software engineer I would be worried.
Until you realise writing code is maybe 10% of the job.
Granted, AI can help in other ways but its certainly not the be all and end all.

Chances are there was some boilerplate code on a website you could use or would at least get you a good way there.


Scabutz

8,595 posts

98 months

Im a director of SE, have loads of engineers working for me. None of us are particularly worried. AI can be useful, its good for cobbling together boilerplate stuff for POCs but it cant build enterprise level software, its nowhere near it. I use it for personal projects but find it frustrating.

The problem with it is its trained on the information available on the internet, most tutorials and info are very basic stuff, so yes it can compare and contrast a lot of ways of doing basic things and throw code together, but doesnt mean its any good. Ive seen it include 3rd party libraries that are out of date, not supported and riddled with vulnerabilities. Veracode did some research and found almost half the code it was asked to create introduced an OWASP Top 10 vulnerability, that sort of stuff makes some one in my position very nervous.

One thing I have been impressed with recently is Figma Make, ask it to design something and it throws together a design and some React code in minutes, great for rapid protyping stuff

lizardbrain

3,181 posts

55 months

Paul Graham
@paulg
The reason AI coding works so well is that the source code of the median app was already slop before LLMs.


I think this is the reason I'm finding it transformative. I'm guilty of cutting corners with dev costs, and AI is producing much better code than the cowboys I've worked with.

Not every business needs enterprise grade code with all the compliance that goes with it. I think AI will have the biggest impact in this middle ground and then work its way outwards.



Youreterriblemuriel

43 posts

94 months

Saturday
quotequote all
I'm no coder but occasionaly have to write some simple scripts for work, I can spend a few hours going through tutorials or I ask ChatGPT to write something for me and then put that into Claude to check for errors. Once it's at that point I can normally debug it myself

Hedobot

713 posts

167 months

Saturday
quotequote all
Same, here.

I have no coding aspirations but have used AI to create some apps that allow me to manipulate some files how i wanted to. PDF file conversion and formatting markup layers etc. It was surprising easy.

The thing for me is how quick it can generate the code. Im not generating commercial code so dont have to worry too much about security etc.

I have decided to try some prototypes in Rust, which is a bit of a step on from python but as an assistant I find AI invaluable and saves a lot of time.

The kicker for me is if AI coding is in its infancy now, what the hell is is going to be like in a decades time, probably worrying.

Edited by Hedobot on Saturday 11th October 08:56

Scabutz

8,595 posts

98 months

Saturday
quotequote all
lizardbrain said:
Paul Graham
@paulg
The reason AI coding works so well is that the source code of the median app was already slop before LLMs.


I think this is the reason I'm finding it transformative. I'm guilty of cutting corners with dev costs, and AI is producing much better code than the cowboys I've worked with.

Not every business needs enterprise grade code with all the compliance that goes with it. I think AI will have the biggest impact in this middle ground and then work its way outwards.
I agree, the middle ground will be where the impact is. The script kiddies and amateur coders will be buggered. Business will be able to have AI churn out some stuff that works well enough.

It's interesting the impact it will have. Demand for Software Engineers has generally always been greater than the supply and really good ones are very hard to find, and often are hard to manage bell-ends. I'm happy for AI to mature where we can trust it to pop out some usable code for simple stuff and we focus on the proper hard problems.

Lucas Ayde

3,975 posts

186 months

Yesterday (12:42)
quotequote all
As long as you have an idea of the basic principles of coding and you are capable of breaking things down into sensible steps, you can use it to generate a lot of useful code, extremely quickly. It's a fantastic tool and can enable someone to multiply their productivity by a large factor. I used github copilot to code a bunch of utilities and tools in Python (a language I'd previously not used) a year or so back, it was pretty amazing how easy it made things. And that was before AI got good enough to write really large bodies of code from a prompt, I was more or less using it like an auto-complete, in VScode.

If you expect to be able to give a prompt 'Produce a full featured clone of MS Word in rust' then you are going to be extremely disappointed and are likely to be for a while.

However, I could foresee a future scenario where LLMs designed for systems analysis and design could instruct dedicated project manager LLMs to supervise dedicated code generation LLMs and testing LLMs to develop really large projects with a relative minimum of human input.

The point those who say that it can't fully replace a human coder frequently miss, is that if you can 5X programmer productivity you only need 1/5 the amount of coders to do a given job in a given time.

Inbox

Original Poster:

595 posts

4 months

Yesterday (13:34)
quotequote all
Lucas Ayde said:
The point those who say that it can't fully replace a human coder frequently miss, is that if you can 5X programmer productivity you only need 1/5 the amount of coders to do a given job in a given time.
Then the coders in 4/5th that no longer have anything to do take up hacking to make some money, not sure all this end that well.