That's Not What I Asked For (RE: AI Writes Code)

So here’s my “Project” … Take a fairly big Text File without [CR][LF] to make Line-by-Line Processing easy, but it does have plenty of HTML Tags.

  • Goal: Find “</” … and replace it with “<[CR][LF]/” for every instance in text.

:roll_eyes: Unfortunately, ChatGPT 4o Mini thinks that I meant:

* Given: abcdefghijklmo</TAG>xyz123
* Find: "</[a-z].*>" (paraphrased) ..... and Insert "[CR][LF]" such that:
* Output: abcdefghijklmo[CR][LF]</TAG>xyz123

:man_mechanic: I actually WANTED to “Break” the Closing HTML Tag with the Insert of [CR][LF]. :cockroach: Note: I did not “require” a Correctly-formed HTML-Tag … just “</” (2 chars).

  • It appears that ChatGPT “knows” Code which “Preserves HTML Tag Function/Syntax” - so that’s the Code that it copies.
  • I don’t use “awk” - but it looked like ChatGPT tried to read the file as ONE-HUGE-LINE (which I suppose could work).
  • In the Buffer-based C Program - it looked like it would FAIL (No Insert [CR][LF]) for “<” as Last Char in Buffer, with “/” as First Char in Buffer (on read-next-block-of-text).

@leebase :skull: :scream: I want it to give me the Right Answer on the first try. A novice could easily MISS the Logic Error, when the Code Compiles without Warnings, but “Special Cases” Fail-to-Process (as expected). :face_vomiting: 98% Correct isn’t really acceptable for most computer programs.
:sob:
Aside from Programming, I still don’t think I should have to “Pry” or “Bully” to get useful (non-trivial) answers… For now, I’m treating “AI” as a Glorified Front-End to some kind of search engine.

3 Likes

So…you push back. This notion that every prompt is going to work as a one shot - doesn’t match my experience.

Neither does giving a person instructions.

1 Like

That’s basically what it is. A very expensive, cpu intensive API layer on top of Stack Overflow and O’Reilly.

As for other topics, I can tell you the same problem exists, in even more insidious ways. I focused on ancient Greek philosophy (particularly Aristotle) when I was going through my masters program a few years ago. When I prod Grok or ChatGPT now with queries about certain concepts or theoretical constructs, it’s immediately obvious that the engine is reciting the same confusions you can find in dozens of places on the internet. Which means: it’s just an API, and every website on the internet is its “backend”.

There is no substitute for hard work. Just do it.

8 Likes