Prompts producing Python programs.
12votes
0answers
1.3kviews

Measure-before-optimize prompt so the model stops tuning cold code

I asked a local Llama-3 70B to "make this data pipeline faster" and it micro-optimized a list comprehension that runs once at startup while ignoring the O(n^2) join in the hot loop. Textbook: it optim
5votes
0answers
968views

Splitting a 600-line god function into pure units without behavior drift

The worst function in our codebase does input parsing, three network calls, retry logic, formatting, and logging in one 600-line block. I wanted GPT to carve it into small pure functions plus a thin o
8votes
1answers
893views

Turning a messy matplotlib notebook into one reproducible plotting script

I had a research notebook with 40 cells of exploratory plots, half of them relying on variables defined three cells up and a global rcParams tweak that only worked if you ran things in order. Sharing
13votes
0answers
1.5kviews

Making the model generate a config loader with validation instead of raw os.environ reads

Half our incidents traced back to config: an env var typo'd to an empty string, a port that was actually the literal text "8080" compared against an int, a feature flag that was the string "false" (wh
12votes
1answers
1.4kviews

Prompt for a bulk file-rename CLI with a regex, a dry-run, and collision detection

Batch renaming is exactly the kind of task where a model gives you a confident three-liner that renames files in a loop and, halfway through, renames a.txt to b.txt on top of an existing b.txt, or ren