4 ms·
> It just doesn't compete with the ease-of-use of data / declarative configuration of VSCode's JSON approach What‽ S-expressions are head-and-shoulders better
by eadmund 4y ago
> It just doesn't compete with the ease-of-use of data / declarative configuration of VSCode's JSON approach
What‽ S-expressions are head-and-shoulders better at declarative configuration than JSON. Compare these two options (the JSON is from https://cloud.google.com/appengine/docs/admin-api/creating-config-files https://cloud.google.com/appengine/docs/admin-api/creating-c...):
{
"deployment": {
"files": {
"example-resource-file1": {
"sourceUrl": "https://storage.googleapis.com/[MY_BUCKET_ID]/example-application/example-resource-file1"
},
"images/example-resource-file2": {
"sourceUrl": "https://storage.googleapis.com/[MY_BUCKET_ID]/example-application/images/example-resource-file2"
},
}
},
"id": "v1",
"handlers": [
{
"urlRegex": "/.*",
"script": {
"scriptPath": "example-python-app.py"
}
},
],
"runtime": "python27",
"threadsafe": true,
}
vs.
(app (deployment
(files (example-resource-file-1 "https://storage.googleapis.com/[MY_BUCKET_ID]/example-application/example-resource-file1")
(images/example-resource-file2 "https://storage.googleapis.com/[MY_BUCKET_ID]/example-application/images/example-resource-file2")))
(id v1)
(handlers ("/.*" (script "example-python-app.py")))
(runtime python27)
(threadsafe true))
And that's just a naïve translation — a more diligent reinterpretation would be even better. Still, even the relatively-thoughtless translation is demonstrably better, easier to grok and think about.
- oxff 4y agoI might just be legitimately stupid. I find the JSON immediately readable.
- ParetoOptimal 4y agoIts just familiarity. Given equal experience with reading json data and lisp data you'd almost certainly prefer the much shorter (but lossless) lisp data.