Changes between Version 2 and Version 3 of faq/files/choosing-names
- Timestamp:
- Nov 1, 2007, 11:47:43 PM (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
faq/files/choosing-names
v2 v3 4 4 As an author of a web site, you'll be uploading files for other people to view, download, and link to. Choosing good names for your files helps to make them more accessible to people. 5 5 6 == good characters ==6 == Use Simple Characters == 7 7 8 8 It's a good idea to choose your file names so that they only contain lower-case letters (a-z), digits (0-9), underscores (_), hyphens (-), and periods (.). … … 12 12 It would be better to call the file `colorbrochure.pdf` or `color-brochure.pdf`. 13 13 14 == specific names ==14 == Choose Content-Specific Names == 15 15 16 16 When choosing a name, think about how to make the name not only relevant to the content of the file, but also how to make it distinct from other files that it might get confused with. For example, even if you currently only have one color brochure for your organization, `color-brochure.pdf` might not be as good a file name as `campaign-color-brochure.pdf`, because next week you might make a color brochure about some other aspect of your organization. 17 17 18 == versioned names ==18 == Handling Versioned Names == 19 19 20 20 Say you plan to upload a new version of `campaign-color-brochure.pdf`. It's tempting to call the file something like "`new-campaign-color-brochure.pdf`". While this makes sense in the short term (to keep the versions apart), the next time you decide to change the order form, the name will be pretty confusing. (e.g. "should i replace the old `new-campaign-color-brochure.pdf` with the new `new-campaign-color-brochure.pdf`?") … … 24 24 So what should you do? In general, you should provide files with names that only describe the resource, not the version. If you really need to keep a version history around, and you want to keep track of it by differently-named files (there are other methods you could use too!), you should either use explicit version numbers (e.g. `campaign-color-brochure.v4.pdf`) or timestamps (e.g. `campaign-color-brochure.2007-11-01.pdf`). And you'll often want to provide a versionless alias to the resource as well, so that people who don't care about the version will get the latest one (e.g. `campaign-color-brochure.pdf` should point back to `campaign-color-brochure.2007-11-01.pdf`, if that's the latest version of the file). 25 25 26 == durability of names ==26 == Durability of Names == 27 27 28 28 Note that once you change the name of a resource, you'll need to go back and change anywhere that links to it. For a public resource (e.g. a webpage, or a file offered by your web site), you don't actually have control over everywhere that links to it. For example, Jane might have bookmarked your order form in her web browser, and Alicia might have linked directly to it on her web page about alternate media sources. You might not even know that she's done so, so you won't be able to make those changes. This makes it doubly important to choose the right name early on. 29 29 30 = = other resources ==30 = Other Resources = 31 31 32 32 * [http://www.w3.org/Provider/Style/URI Cool URIs Don't Change] by Tim Berners-Lee talks about choosing good, permanent names for resources on the 'net