4 ms·
Why would you use an LLM to format your code?
by thfuran 7mo ago
Why would you use an LLM to format your code?
- iainmerrick 7mo agoRight. The equivalent in handwritten code would be formatting your code by hand. That used to be the normal way to do it! For handwritten code, the evolution of best practices has tended to be: - just make your code look neat and tidy; - follow the style and conventions of existing code; - follow a strict formatting style guide; - format automatically using a tool. I don’t see why it should be any different with LLMs. Why format with an LLM each time, when you can use the LLM once to write the formatter? Maybe there’s a point at which neural nets replace conventional programming languages for low-level tasks. But I’m skeptical that natural language models will replace programming languages for low-level tasks any time soon.
- andrekandre 7mo ago> Why format with an LLM each time, when you can use the LLM once to write the formatter? the right way to use an llm imo (and same for end-user features as well)... no need to waste tokens and wait time on something that can be done at a fraction of the cost and time (and be deterministic on top of that)
- Kim_Bruning 7mo agoThat had me bogling too. But you know what? A local MoE model roughly equivalent to sonnet mid-2025? Totally possible. Just costs electricity to run, put it in your CI/CD pipeline. Have it apply a bit of intelligence to the thing as well. Uh.... if you've got a spare box, why not? (the fact that said spare box would cost an arm and a leg in 2026 is... a minor detail)
- thfuran 7mo agoWhy not? Because you can get stronger guarantees of correctness and consistency out of a typical code formatter, which will also probably run about a million times faster.
- deleted 7mo ago[deleted]
- deleted 7mo ago[deleted]
- Kim_Bruning 7mo agoYou're not wrong. Though now I am thinking of ways an LLM in CI might be useful, (dijkstra forgive me).