Live data from Hacker News

Naming things (2015) [pdf]

www2.stat.duke.edu

31–40 of 60 posts

Re: Naming things (2015) [pdf]

#31
post #25

If you look at the filename examples, there seems to be an implicit suggestion of naming a group of related files using a common prefix. If one needs to distinguish groups of files, why not just put them in directories ? That's the reason directories exist, no? I can somewhat understand if some (bad) software is written to look for files only in a single directory and you have to put everything there. But otherwise,…

You loose the information in the directory title if the file is downloaded or from viewing the title in an application title bar.

yeah, thinking along these lines filenames themselves are the easiest way to display the contents of a file, and that data travels with each and every file no matter where they're mv'd to, uploaded, deployed, shared, etc.

It's like brand name packaging, all the information including nutrition packed neatly on the outside. You don't go to the store and buy 'bread' you buy '2017-08-18-00-natures-own-dbl-fiber-wheat'.

This whole pdf resonated with me because it made me realize I'd developed these almost identical practices without knowing it. Mostly over time, trial and error, and a kind of natural selection, when it comes to sake of ease.

Cool stuff.

Re: Naming things (2015) [pdf]

#32
The real lesson of this discussion seems to be: metadata has failed our expectations.

All this ancillary stuff that we'd like attached to files, like dates, client names and projects, versions and so on, are metadata. Some systems keep metadata in files: EXIF, Word, PDF. Some systems have conventions for this instead: header blocks in source code. But if neither of those applies? Only place you can put it reliably is the filename :(

Re: Naming things (2015) [pdf]

#33
post #9

Considered that most of the world uses "little-endian" format for date writing ( https://en.wikipedia.org/wiki/File:Date_format_by_country_(n... ) how comes ISO 8601 was set on "big-endian"? Not so practical for anything else but file naming IMHO...

Given that we use "big-endian" Arabic numerals, the ISO date format using those numerals makes the most sense.

Of course, when we remember that Arabic is right-to-left, we realise that in the original Arabic the least significant digit was read first ...

Re: Naming things (2015) [pdf]

#34
For those who don't know Jenny Bryan, she is a wonderful force for good in the R community. It seems like these filenames are a little contentious here on HN, but IMO this will always be a big improvement over the file-naming practices of someone who has given little or no thought to the topic. Which I am guessing was her intended audience.

If you're getting into R or data analysis, check out http://stat545.com/topics.html. She has put a lot of thought into the project management aspects of carrying out a data science project that don't get discussed as often as other, sexier topics.

Re: Naming things (2015) [pdf]

#35
post #32

The real lesson of this discussion seems to be: metadata has failed our expectations. All this ancillary stuff that we'd like attached to files, like dates, client names and projects, versions and so on, are metadata. Some systems keep metadata in files: EXIF, Word, PDF. Some systems have conventions for this instead: header blocks in source code. But if neither of those applies? Only place you can put it reliably is…

If OS vendors could get over their "not invented here" syndrome with respect to default file systems we might see something a little bit more sane than FAT as the one interchangeable format. This is necessary but not sufficient to make decent file systems widely available. Then we can start hoping for such trivial features to become available.

Re: Naming things (2015) [pdf]

#36
post #32

The real lesson of this discussion seems to be: metadata has failed our expectations. All this ancillary stuff that we'd like attached to files, like dates, client names and projects, versions and so on, are metadata. Some systems keep metadata in files: EXIF, Word, PDF. Some systems have conventions for this instead: header blocks in source code. But if neither of those applies? Only place you can put it reliably is…

>lesson of this discussion seems to be: metadata has failed our expectations.

I've written several "disk and file catalog" utilities over the years so I inevitably spent a lot of time thinking about the "metadata" problem.

I think the issue is that it's impossible to solve metadata in a universal way that satisfies all scenarios. This is why metadata often ends up being inscribed into the filename. It's the "least worse" solution.

Let's take one example of the scientific data of csv files. Typical Comma-Separated-Value files do not have metadata fields such as author, measuring device, timestamp of readings, GPS coordinates. (Yes, csv files sometimes have a first line for "column names" which is arguably metadata but that's not the higher-level metadata I'm talking about.)

Exactly where does one put that high-level metadata?

1) If one makes a new pseudo-standard that signifies any lines at the top the csv beginning with "//" as metadata, that means that modifying any metadata of a 100GB csv file (e.g. change author from "John Doe" to "Jacob Doe" is rewriting the whole 100GB file to add 1 byte.) As a related issue, let's say you have hash of "e1bb76e7391b93eb12" for the csv file. You really want a stable hash that represents the actual "raw data" of the csv file. You don't necessarily want the hash to change just because the metadata changed. In this case, embedding metadata into the file itself makes certain operations worse since typical hash utilities don't have "intelligence" about which parts of the file is "important" for hashing. (A similar problem is scanning mp3 files for duplicates. If 2 mp3 files have bit-identical audio output but the metadata tags are different, are they the same or different?!? It depends.)

2) if you put metadata at the end, typical utilities won't know about about it. (UNIX has "tail" command but standard MS Windows does not. The tail command is also unstructured and read-only which makes it a non-solution for managing end-of-file metadata fields. Also, the "quick" view of GUI file managers show the top of the file and not the bottom of it.)

3) If you put metadata in a separate file, it easily gets lost. File managers like MacOS Finder and MS Windows Explorer don't know when 2 files are supposed to be "treated as one unit" vs separately.

4) If you try to put metadata in a separate special area using os file system features suchs MS "NTFS alternate data streams" or Mac OSX "resource forks", they will get lost when transferring across incompatible filesystems or uploading to Amazon S3.

If one is feeling uncharitabe, one could say the MS WinFS[1] was a spectacular failed attempt at unifying metadata. (A relational database that makes metadata more of a 1st class concept.) Nobody has tried it on that level since. Even Apple's new file APFS system didn't have the same metadata ambitions as WinFS.

The combination of tradeoffs leads everybody to re-invent the idea of embedding metadata (including namespacing hierarchies) into filenames. The article's suggestions for scientific data filenames looks very similar to filenames that companies end up using for ETL pipelines.[2]

[1] https://en.wikipedia.org/wiki/WinFS

[2] https://en.wikipedia.org/wiki/Extract,_transform,_load

Re: Naming things (2015) [pdf]

#37
I name my files like this:

  2017-04-04 #S4907 #Choir List of names.pdf
  2017-04-05 #EXCITE #S=5005 Notes on Data Repositories.pdf
  2017-04-06 #ARAG #S=5031 #Amount=14.2 #CUR=EUR Invoice.pdf
with the following semantic:

* date. Every file name is prefixed with the ISO date to facilitate sorting

* tags. The syntax # to categorize documents with tags.

* key-value pairs. The syntax $=value let's us attach structured information to the document name.

and keep them in a single large folder.

On top of this, I have written some shell tooling to normalize, view, and shuffle around those documents: https://github.com/HeinrichHartmann/pile

E.g. `pile extract EXCITE` will extract all files with tag #EXCITE to a separate folder named #EXCITE. There is also a HTML form that helps with proper naming of new files.

File management is still a pain for me, but this at least gives me some confidence that I can retrieve stored documents reasonably well. I hope, that one day I'll be able to auto-generate expense reports and tax filings, from properly tagged up filenames.

Re: Naming things (2015) [pdf]

#38

I name my files like this: 2017-04-04 #S4907 #Choir List of names.pdf 2017-04-05 #EXCITE #S=5005 Notes on Data Repositories.pdf 2017-04-06 #ARAG #S=5031 #Amount=14.2 #CUR=EUR Invoice.pdf with the following semantic: * date. Every file name is prefixed with the ISO date to facilitate sorting * tags. The syntax # to categorize documents with tags. * key-value pairs. The syntax $ =value let's us attach structured inform…

You are suggesting a file name format with spaces in it?

Re: Naming things (2015) [pdf]

#39
post #25

If you look at the filename examples, there seems to be an implicit suggestion of naming a group of related files using a common prefix. If one needs to distinguish groups of files, why not just put them in directories ? That's the reason directories exist, no? I can somewhat understand if some (bad) software is written to look for files only in a single directory and you have to put everything there. But otherwise,…

Because you might want to group files in an order other than first element to last element. Putting them in directories bakes in a single specific organization, rather than letting them be organized as desired on the fly.

Re: Naming things (2015) [pdf]

#40
post #36
post #32

The real lesson of this discussion seems to be: metadata has failed our expectations. All this ancillary stuff that we'd like attached to files, like dates, client names and projects, versions and so on, are metadata. Some systems keep metadata in files: EXIF, Word, PDF. Some systems have conventions for this instead: header blocks in source code. But if neither of those applies? Only place you can put it reliably is…

>lesson of this discussion seems to be: metadata has failed our expectations. I've written several "disk and file catalog" utilities over the years so I inevitably spent a lot of time thinking about the "metadata" problem. I think the issue is that it's impossible to solve metadata in a universal way that satisfies all scenarios. This is why metadata often ends up being inscribed into the filename. It's the "least wo…

Couldn't we just come up with some convention for "expanded filenames" where the meta-data is included in the file name itself? In the UI portion, you see what you see now, no difference, but say anything after the // delimiter in the file name is considered meta data and not shown in the windows/terminal UI.

Not sure if it's a good solution but if I were to put the meta data somewhere I would somehow try to put it in the identifier of the file (the name) as it is data that would help me identify the file AND it's content!

Post reply on HN