Plain text is the best

The more I've been working on things, things being stored in plain text, or at least in a human readable format such as xml or json are mostly the best way to deal with saving things.

Well it's a truth with modifications

Of course there are situations where it will be better to use something like a RDBMS or something a bit lighter like SQLite, but for most usecases plain text will be more than adequate, and it has a lot of other benefits as well.

Choice of representation

What is written in plain text can be shown everywhere, you could use a pager, a web browser or something else entirely, and as long as you're using a reasonably structured format, such as markdown, restructured text or something like it it will be easy to convert it to another format, such as a PDF.

Also accessability is always going to be better with plain text, being able to use a screen reader or change the font if you're having dyslexia to something that is easier to read is a lot easier if what you're dealing with is plain text.

Archiving and automation

Using plain text rather than a binary format will make sure that what you do will be accessible in the future, there will always be a program to read plain text, for any given binary format however that might or might not be the case. Also storing plain text will also be easier because it's usually quite small in the first place, and it also usually compresses really well.

For using automated tools, and searching for something using tools such as grep or doing replacements with sed, or anything else really, using a plain text format is going to be much easier and problem free to work with, and in the worst case if something gets broken you're not going to have a completely garbled file, but you'll be able to read the parts of the file that saved correctly.

Freedom of tools

With a binary format you're more than likely being forced into using one specific tool, while a plain text file is portable, you can use it in almost every operating system, and you can use the tool that you're the most comfortable with to edit or view it.

Also writing a specified tool to help you or to interface between eachother is bound to be a lot easier with a plain text kind of format than with anything else, your usecase might be something that the developer of a program didn't think of, and a binary format might make difficult or even impossible to deal with.

All in all

All in all, like most of my posts lately I feel like I've been endorsing a special kind of minimalism, and again this is the case, by doing something in a more minimal way you're more likely than not to actually help yourself in the long run, things that are easier to understand is easier to maintain, and things that are easier to maintain are bound to be better and more stable. Tomorrows post might as well be water is wet :p

Addendum versioning

@fedops@fosstodon.org reminded me about versioning, something that is another thing that is so important to textfiles, it's great as a way to backing up things, and having something stored in plain text means that you can then follow your whole history through software such as git. Because of the nature of text only documents it makes it easy to show what has changed, and what has been added when and so on. Of course you could do versioning with binary files as well, but the whole process will be a lot more painful than working with plain text.

Second addendum security

Which made me think about security, something being plain text is making it something it's easier to trust, without macros or executables, other than the ones you've chosen yourself opening a plain text file is very rarely going to be dangerous to your system, since it can't execute code on your system.