News for hackers. Stuff that matters.
Re:ChatGPT Cheat Sheet by scifibestfi on Tuesday January 24, 2023 @11:24AM (#34505735)
Have you found it to be better than Copilot?
Re:ChatGPT Cheat Sheet by Karunamon on Tuesday January 24, 2023 @11:41AM (#34506054)
Different use case I think. With chatGPT you write something like:

write a function using the python requests library which makes a get request to the URL example.com, parses the JSON response and returns the value of the "foo" field. Throw an exception if the get request fails, the response is not JSON or is invalid JSON, or if the foo field is not present in the response.

I just tried this and got a correct (and reasonable) function on the first try.

This kind of high level description to low-level implementation is a huge timesaver but it saves time in a different way than copilot.

Re:ChatGPT Cheat Sheet by 5e92cb50239222b on Tuesday January 24, 2023 @03:16PM (#34509600)
I use it to generate whole test suites from function definitions. Not one test, but dozens, covering various inputs and edge cases. TDD purists will balk at that, but it saves serious amounts of typing out boilerplate. You have to recheck its suggestions, of course.

I couldn't get Copilot to spew anything like that (a single simple test at best, and it fails at that more frequently than it produces something useful).

It's also quite good at converting relatively simple programs or configs between languages. For example, I used it to convert PostgreSQL DDL queries into Hibernate models (and also in reverse), JS snippets into OCaml, XML into YAML, maven pom.xml into gradle build scripts, and a few more.