Hacker News new | ask | show | jobs
by madelyn 1272 days ago
I spent a few days working on using ChatGPT to write code. I've been meaning to write a blogpost about my experience, but here's my synopsis.

Where ChatGPT was best was when I wanted to do generic data structure work with common tools. Prompts like "make a Python class that stores keys in a redis sorted set, with the score as a timestamp, that removes members older than a configured time on access / insertion." I know how that code should work, I know what's correct- but it's nice being lazy and letting ChatGPT spit out a class for me I can clean up.

Anytime I want to do anything weird or nonstandard, ChatGPT is an uphill battle. Try asking it to write a convolution function without using Numpy (say you're using PyPy or AWS Lambda and C extensions are a no go). It will often insist you have to use Numpy- it argued with me at one point it wasn't possible without it! (This has gotten a bit better since, but was still quite interesting)

Working with pre-existing code, especially anything database related, was not worth the time spent at all. Terrible query plans, misinterpreting the schema that was provided, etc. I do love SQL though- I'm quite biased here.

It was interesting in that when it worked best, I needed to know what to ask for. I asked a good friend who started learning to code a few months ago to try it, and she was way less successful with it versus reading documentation.

Ultimately I think with tight text editor integration it will be great, but it's still going to require someone skilled and who knows what to ask for- at least for a couple years. As for how productive it's made me, I've stopped using it for anything except greenfield work with common libraries I already know how to use.

1 comments

> I asked a good friend who started learning to code a few months ago to try it, and she was way less successful with it versus reading documentation.

This was my experience. As a learning programmer, I determined it is easier to read the documentation than learn from chatGPTs code snippits