How to represent multiple files in a forum post?

Jonathan M Davis newsgroup.d at jmdavisprog.com
Mon Feb 19 01:26:43 UTC 2018


On Wednesday, February 14, 2018 18:33:23 Jonathan Marler via Digitalmars-d 
wrote:
> @timotheecour and I came up with a solution to a common problem:
>
> How to represent multiple files in a forum post?
>
> So we decided to take a stab at creating a standard! (queue links
> to https://xkcd.com/927)
>
> We're calling it "har" (inspired by the name tar). Here's the
> REPO: https://github.com/marler8997/har and here's what it looks
> like:
>
> --- file1.d
> module file1;
>
> --- file2.d
> module file2;
>
> // some cool stuff
>
> --- main.d
> import file1, file2;
> void main() { }
>
> --- Makefile
> main: main.d file1.d file2.d
>      dmd main.d file1.d file2.d
>
> The repo contains the standard in README.md and a reference
> implementation for extracting files from a har file (archiving
> not implemented yet).
>
> One of the great things is when someone creates a post with this
> format, you can simply copy paste it to "stuff.har" and then
> extract it with `har stuff.har`.  No need to create each
> individual file and copy/paste the contents to each one.
>
> Is this going to change the world? No...but seems like a nice
> solution to an minor annoyance :)

Okay. Maybe, I'm dumb, but what is the point of all of this? Why would any
kind of standard be necessary at all? Most newsgroup posts have snippets of
code at most, and those which need to have the contents of one or more files
are going to be showing short files where it's a human that's reading them,
not a computer. So, as long as the files are delimited in a way that's clear
to the reader, why would any kind of standard be needed? I could do

===== file1.d =====
...contents here...
===================

===== file2.d =====
...contents here...
===================

or

----- file1.d -----
...contents here...
___________________

----- file2.d -----
...contents here...
___________________

or

----- file1.d
...contents here...
-----

----- file2.d
...contents here...
-----

or anything else that was delimited fairly clearly, and the programmers
reading my post would be able to easily see where one file begins and
another ends. If a computer were interpreting the post and doing something
with the code, then that wouldn't cut it, because it's not going to just
"figure out" what the poster meant, but for a human, that's generally not a
problem, and forum posts are meant to be read by humans. So, what is this
proposal supposed to be solving? Was it just bugging you guys that people
aren't consistent?

- Jonathan M Davis



More information about the Digitalmars-d mailing list