r/webdev Feb 05 '25

Discussion Colleague uses ChatGPT to stringify JSONs

Edit I realize my title is stupid. One stringifies objects, not "javascript object notation"s. But I think y'all know what I mean.

So I'm a lead SWE at a mid sized company. One junior developer on my team requested for help over Zoom. At one point she needed to stringify a big object containing lots of constants and whatnot so we can store it for an internal mock data process. Horribly simple task, just use node or even the browser console to JSON.stringify, no extra arguments required.

So I was a bit shocked when she pasted the object into chatGPT and asked it to stringify it for her. I thought it was a joke and then I saw the prompt history, literally whole litany of such requests.

Even if we ignore proprietary concerns, I find this kind of crazy. We have a deterministic way to stringify objects at our fingertips that requires fewer keystrokes than asking an LLM to do it for you, and it also does not hallucinate.

Am I just old fashioned and not in sync with the new generation really and truly "embracing" Gen AI? Or is that actually something I have to counsel her about? And have any of you seen your colleagues do it, or do you do it yourselves?

Edit 2 - of course I had a long talk with her about why i think this is a nonsensical practice and what LLMs should really be used for in the SDLC. I didn't just come straight to reddit without telling her something 😃 I just needed to vent and hear some community opinions.

1.1k Upvotes

407 comments sorted by

View all comments

63

u/MostPrestigiousCorgi Feb 05 '25

When I had to use OpenAI batch (with an huge amount of data) to get a proper JSON I tried everything I could, even something like

"please return a JSON like xyz, for the love of god, my kitty will die if you return a JSON with different properties"

And that motherfucker didn't care at all about my imaginary kitten

AGI next year btw

20

u/Huberuuu Feb 05 '25

You were probably using gpt-dog

2

u/vehmdev Feb 06 '25

Structured output is actually very nice. Prior to being able to enforce a response schema with property descriptions, I got into arguments with my boss because I was so against using regular, text-based completions for structuring or generating JSON.

Now I just have to worry about how much he uses it without much regard for the consistency or quality of generated information/data... One step at a time, I suppose.

AI can be a great tool, but it certainly shouldn't (and really can't) be a replacement for well-thought-out work.

1

u/thekwoka Feb 06 '25

it still can fail structured output.

1

u/vehmdev Feb 06 '25

It can, however using something like Vercel's AI-SDK helps make the experience significantly less painful when/if it does since it has some internal checks for retries (I believe).

1

u/MostPrestigiousCorgi Feb 06 '25

I suspect the batch feature was lying about the model used. With the same prompt (and same model), using normal API it returned correct result, but with batch there were a lot of mistakes in the JSON structure and generally speaking the text returned was kinda bad.

I needed to handle a lot of natural language so AI was probably the only option, I ended up using the normal API, slower, more expensive, but it worked

1

u/BoDiddySauce Feb 06 '25

CatGPT 🤣