>- refactor "broadly" (say, "rename all variables to match the following style" or "turn this class into a dataclass like XXX" or "transform the SQL queries into builder queries using XYZ"). Often requires some manual work but it gets a lot of tedious stuff out of the way
Can you go on more about this, please? This sounds, frankly, heavenly, but the second sentence gives me pause. I guess it's not necessarily a question of how reliably it can "broadly" refactor but rather how broadly "broadly" is meant to be taken...
>- generate SQL queries at the speed of mouth
...and this? I'm not really a database guy, but I do keep hearing from them about how (eg, a database guy's) stateful knowledge of a database can result much, much more efficient queries than eg a sales guy with a query builder. Are the robut's queries more like the former or the latter?
I gave some insights on the SQL thing above. For the refactor broadly, it's useful when I have something that's a bit too squishy for my IDE refactoring tools/multicursor editing/vim macros, but easy enough to do or provide an example for. One thing I mentioned is having consistent variable names.
I would highly recommend taking a piece of code (any code) and then just start experimenting. Here's a few prompt ideas:
- make this a singleton
- use more classes
- use less classes
- create more functions
- use lambdas
- rewrite in a functional pipeline style
- extract higher order types
- use fluent APIs
- use a query builder
- transform to a state machine
- make it async
- add cancellation
- use a work queue
- turn it into a microservice pipeline
- turn it into a text adventure
- create a declarative DSL to simplify the core logic
- list the edge cases
- write unit tests for each edge case
- transform the unit tests into table-driven tests
- create a fuzzing harness
- transform into a REST API
- write a CLI tool
- write a websocket server to stream updates into a graph
- generate a HTML frontend
- add structured logging
- create a CPU architecture to execute this in hardware
- create a config file
- generate test data
- generate a bayesian model to generate test data
- generate a HTML frontend to generate a bayesian model to generate test data and download as a csv
- etc...
If you are not feeling inspired, take a random computer science book, open at a random page, and literally just paste some jargon in there and see what happens. You don't need correct sentences or anything, just random words.
There really is nothing that can go wrong, in the worst case the result is gibberish. The code doesn't even need to build or be correct for it to be useful. These models are trained to be plausible, and even more importantly, self-consistent.
When prompted with code in-context, these things are amazing at figuring out consistent, plausible, elegant, mainstream APIs. Implementing them correctly is something I usually tend to do manually instead of bludgeoning the LLM.
Can you go on more about this, please? This sounds, frankly, heavenly, but the second sentence gives me pause. I guess it's not necessarily a question of how reliably it can "broadly" refactor but rather how broadly "broadly" is meant to be taken...
>- generate SQL queries at the speed of mouth
...and this? I'm not really a database guy, but I do keep hearing from them about how (eg, a database guy's) stateful knowledge of a database can result much, much more efficient queries than eg a sales guy with a query builder. Are the robut's queries more like the former or the latter?