copypaster icon indicating copy to clipboard operation
copypaster copied to clipboard

Clarify advantages of using tree notation over other formats

Open lubieowoce opened this issue 4 years ago • 2 comments

making forms copy-pastable is a neat idea! but i feel like the same benefits could be achieved by simply making web forms serializable to any suitable format of choice, preferably a human-readable/editable one. i think this proposal would benefit from clarifying the unique advantages of using tree notation vs, say, JSON + a schema.

lubieowoce avatar Nov 13 '19 11:11 lubieowoce

This is a good point! There are lots of little details of why I think Tree Notation (or someone else's similarly minimal notation) would be the best solution for this.

One main reason is that you never need to escape anything (just indent blocks). For instance, let's say the form is for filing a bug report and has a textarea for including source code. Perhaps the form is:

Name [Mary]
SourceCode
[ print "Hello"
  print "World" ]

This could serialize to Tree Notation as:

Name Mary
SourceCode
 print "Hello"
 print "World"

While JSON would require lots of escaping into something like this:

{
"Name": "Mary",
 "SourceCode": [
  "print": "\"Hello\"\n",
  "print": "\"World\""
 ]

}

breck7 avatar Nov 13 '19 15:11 breck7

Thinking about it more, it seems the best approach would probably to allow the serialization to/from any format when possible as you suggested. I think Tree Notation would work best for most cases, for little detail reasons like the one above, but we could make a toggle or something to add support for other formats as well.

breck7 avatar Nov 13 '19 15:11 breck7