mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-31 01:35:00 +00:00
Update 2024-08-14-code-in-json.md
This commit is contained in:
parent
9ab185a88f
commit
d0e716ea7d
1 changed files with 9 additions and 5 deletions
|
@ -100,7 +100,7 @@ def greeting():
|
||||||
|
|
||||||
People expect that it would be easier and more reliable
|
People expect that it would be easier and more reliable
|
||||||
for aider to parse a nicely formatted json
|
for aider to parse a nicely formatted json
|
||||||
response more like this:
|
response, like this:
|
||||||
|
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
|
@ -111,7 +111,8 @@ response more like this:
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
This seems even more tempting as LLMs get better tooling for reliably generating
|
This seems even more tempting as LLMs
|
||||||
|
get better tooling for reliably generating
|
||||||
valid json, or even enforcing that it meets a specific schema.
|
valid json, or even enforcing that it meets a specific schema.
|
||||||
For example, OpenAI recently announced
|
For example, OpenAI recently announced
|
||||||
[strict enforcement of json responses]().
|
[strict enforcement of json responses]().
|
||||||
|
@ -126,13 +127,16 @@ emit it wrapped in json.
|
||||||
In some sense this shouldn't be surprising.
|
In some sense this shouldn't be surprising.
|
||||||
Just look at the very simple
|
Just look at the very simple
|
||||||
json example above, with the escaped
|
json example above, with the escaped
|
||||||
quotes `\"` quotes
|
quotes `\"` and
|
||||||
newlines `\n`
|
newlines `\n`
|
||||||
mixed into the code.
|
mixed into the code.
|
||||||
Coding is complicated enough without having to escape all the special characters too.
|
Coding is complicated enough without having to escape all the special characters too.
|
||||||
|
|
||||||
If I asked you to write me a program, would you do a better job
|
If you tried to write a program,
|
||||||
typing it into a text file or hand typing it as a properly escaped json string?
|
would you do a better job
|
||||||
|
typing it normally
|
||||||
|
or as a properly escaped
|
||||||
|
json string?
|
||||||
|
|
||||||
## Quantifying the benefits of plain text
|
## Quantifying the benefits of plain text
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue