Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Perhaps we should someday have length delimited text formats, and editors should recalculate the length on the fly.

Something like:

5:hello

2:pi

Maybe with one blank line with no delimiter as a record separator.

All fields on the same line could work, and would be more greppable, but harder to read for humans.



1966 called and wants its idea back

https://en.wikipedia.org/wiki/Hollerith_constant

As soon as DJB pays up:

http://cr.yp.to/proto/netstrings.txt


> but harder to read for humans

harder to write too - very easy to get the length wrong, and tiresome to have to count the length


There are several formats like this, the most well-known is probably canonical S-expressions. Or, if I'm being sadistic, PDF is somewhat like this, too.


That is the annoying format that Wordpress uses to store text. It does not lend itself for search and replace very well.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: