Live data from Hacker News

Tips for better coding with ChatGPT

nature.com

41–50 of 114 posts

Re: Tips for better coding with ChatGPT

#41
Anthropomorphize is a good way to get ChatGPT to code some obvious but tedious code and to remind you how to cherry pick in git or other myriad of task that most of know how to do and before we will revisit in some site. I give ChatGPT good context and then do code review of the code it presents in the same way I do code reviews with the code I see elsewhere. One warning here though. Don't ask ChatGPT to code something that you don't know how to interpret and/or not willing to test for correctness.

Re: Tips for better coding with ChatGPT

#42

I am absolutely disgusted by the idea of people using ChatGPT for serious coding work. Maybe I am just getting old but the idea of using a non-deterministic tool that can hardly be reasoned about that will straight up hallucinate facts for any professional work sounds insane to me. Yes, I do see the value for Junior Devs as I am sure it can drastically increase their output in the short term but aren't they shooting…

Ive been moving a large HTML / nunjuck CMS to nextjs. It's pretty decent and TSX. And when I said, this is the template, rewrite it based upon this example it does a decent job and definitely saves me time. For rewriting things like these it's been a time saver. There were also tasks where it mostly wasted my time.

Re: Tips for better coding with ChatGPT

#43

I am absolutely disgusted by the idea of people using ChatGPT for serious coding work. Maybe I am just getting old but the idea of using a non-deterministic tool that can hardly be reasoned about that will straight up hallucinate facts for any professional work sounds insane to me. Yes, I do see the value for Junior Devs as I am sure it can drastically increase their output in the short term but aren't they shooting…

It's nice to get a template out to build from.

But yes, I have seen it make up its own Powershell cmdlets (my main usage)

So cannot be used unless you already know.

Re: Tips for better coding with ChatGPT

#44

I am absolutely disgusted by the idea of people using ChatGPT for serious coding work. Maybe I am just getting old but the idea of using a non-deterministic tool that can hardly be reasoned about that will straight up hallucinate facts for any professional work sounds insane to me. Yes, I do see the value for Junior Devs as I am sure it can drastically increase their output in the short term but aren't they shooting…

What's so sanctimonious about writing code? If I vaguely know what I want to do in bash, but I don't know everything off the top of my head, I could search stackoverflow, or I could just type it into ChatGPT, apply some judgement, and run it. We're not slaughtering a holy cow, it's just another tool in the tool box in addition to the manual and google.

Re: Tips for better coding with ChatGPT

#45

I am absolutely disgusted by the idea of people using ChatGPT for serious coding work. Maybe I am just getting old but the idea of using a non-deterministic tool that can hardly be reasoned about that will straight up hallucinate facts for any professional work sounds insane to me. Yes, I do see the value for Junior Devs as I am sure it can drastically increase their output in the short term but aren't they shooting…

Strong "Just read the manual" vibes.

Re: Tips for better coding with ChatGPT

#46

I am absolutely disgusted by the idea of people using ChatGPT for serious coding work. Maybe I am just getting old but the idea of using a non-deterministic tool that can hardly be reasoned about that will straight up hallucinate facts for any professional work sounds insane to me. Yes, I do see the value for Junior Devs as I am sure it can drastically increase their output in the short term but aren't they shooting…

I often start writing (short) programs based on something else I wrote - I take what I did before and hack it to start doing what I need now. Even when you end up changing everything there's some advantage for me in not having to start entirely from scratch. I can see it being useful for that.

I feel exactly as you do and I've reviewed code, found all sorts of weirdness and then realised that the developer used ChatGPT to do it and probably to do its unit tests. It all worked within itself but clearly didn't work in the real world at all! :-)

Ultimately, I cannot really be bothered to use ChatGPT. It might be my backwardness but I can be bothered to use an IDE when it helps (instead of VIM) so I don't think I'm a hopeless fundamentalist. Why has my brain written it off? I don't know but I know I am lazy and I do things that make life easier.

Re: Tips for better coding with ChatGPT

#47

I am absolutely disgusted by the idea of people using ChatGPT for serious coding work. Maybe I am just getting old but the idea of using a non-deterministic tool that can hardly be reasoned about that will straight up hallucinate facts for any professional work sounds insane to me. Yes, I do see the value for Junior Devs as I am sure it can drastically increase their output in the short term but aren't they shooting…

I don’t think it’s more insane than copying and pasting code from anywhere on the internet. You have to understand what you use and you must not trust it blindly, whatever the source.

Re: Tips for better coding with ChatGPT

#48

I am absolutely disgusted by the idea of people using ChatGPT for serious coding work. Maybe I am just getting old but the idea of using a non-deterministic tool that can hardly be reasoned about that will straight up hallucinate facts for any professional work sounds insane to me. Yes, I do see the value for Junior Devs as I am sure it can drastically increase their output in the short term but aren't they shooting…

I’m not an expert in every area I need to touch. I don’t work at a place like google where there are teams dedicated to solving the same problems across the org which I can rely on.

Getting a simple example roughly tailored to my needs, which I can use as a launching point, is often extremely useful. For example, I encounter scientific libraries with poor documentation and I could spend half my day reading through it or searching stack overflow for a good explanation…or, I can ask ChatGPT4 for a specific implementation using a specific library, then ask it to explain anything I don’t understand.

These tools aren’t solving any real problems for me - they are replacing slower and less responsive systems I already relied on for research and development.

Re: Tips for better coding with ChatGPT

#49

I am absolutely disgusted by the idea of people using ChatGPT for serious coding work. Maybe I am just getting old but the idea of using a non-deterministic tool that can hardly be reasoned about that will straight up hallucinate facts for any professional work sounds insane to me. Yes, I do see the value for Junior Devs as I am sure it can drastically increase their output in the short term but aren't they shooting…

> a non-deterministic tool that can hardly be reasoned about that will straight up hallucinate facts for any professional work

This sounds like a decent enough description of the human brain.

Don't get me wrong: I'm not for a moment suggesting that what we have today is anything approaching "General Artificial Intelligence", and I am extremely concerned & worried about the inevitable massive damage AI is going to do to our world, but I do think it's a little funny that many people's specific objections to it amount to "it can do what people do". Yes. That's the idea.

The main concern with AI usage is not that it will write bad buggy code or lie: we already do that ourselves plenty, so that's not a novel skill in the professional arena. The main concern is that we can scale that stupidity.

But that's a problem of scale: individual usage isn't really going to do you notable damage on an individual level.

> Yes, if you are constantly hopping from one framework of the month to the next big thing, you just don't have the time to learn anything in depth and then again ChatGPT can help.

I actually think the opposite is true. Having used ChatGPT quite a lot for work (by mandate - I wouldn't have chosen to either but am glad now that I had to), I've found it's really very good at generating bad code and being confidently wrong (again, much like people): if you ask it about a subject you're not deeply knowledgeable about, it's going to lead you astray. The most astute way to use it is actually in going the last mile on something you're already very confident in, so that you can correct it as needed.

Re: Tips for better coding with ChatGPT

#50
As I've been moving on from writing code to higher level work, I find these tools very welcome. I can just ask it to give me a quick grid layout or the right ffmpeg string of options and go about my tasks, instead having to dive into the nitty gritty or doing "manual labour" every time.
Post reply on HN