I needed to download the Ruby Source recently from here and it says, "available in three formats" which are .tar.bz2, .tar.gz and .zip. Is there any reason that we need all three formats? At least on Linux and OSX I can do any of the three easily. On Windows, only zip is built-in, I think. Is there anything behind these preferences or is this just a religious battle?


.tar.gz files are (still, after some years in that position) the most common archive format for archives intended for unix-a-like systems. Users on any unix-a-like system will be able to open these without installing additional software, but users running Windows can not. They are sometimes called .tgz instead though this is less common now (the convention was started to get around Windows file naming limitations that were removed in Windows NT and Windows 95).

.zip files are accessible by default on modern Windows variants without any extra software being installed. They are generally usable on any other systems too, but support is not always included by default in minimal installations.

So the above two formats are given to achieve near 100% coverage of what people will be able to open even from a freshly installed system with not extra tools added.

.tar.bz2 files are similar to .tar.gz but use the bzip2 format instead of gzip. These will be smaller, sometimes considerably smaller, so quicker to download - but support on Windows is less common and like .zip support is not always present by default on minimal installs of other OSs.

This is offered as a convenience to those users that have the extra utility installed (and possibly to save a little bandwidth for the provider), though for small files the difference is not worth the hassle of creating/offering/supporting (in install/build documentation for instance) the extra format.

.7z files are starting to be seen more these days too. These are files produced+read by 7-zip and compatible tools, and are generally much smaller than ziped or gziped archives (and often smaller than bzip2ed archives too). For instance, I regularly compress MSSQL database backups for transfer up an ADSL based internet connection - 7zip tends to produce files less than half the size of those produced in the standard zip format which makes a significant difference in transfer time (more than making up for the fact that the 7zip compression algorithm is much slower then the standard zip algorithm). The use of 7-zip format is not particularly common at the moment as the relevant tools are less commonly installed than the other options.

As with bzip2 archives, 7-zip archives are, where available, offered as a convenience to those users that have the extra utility installed (and to save a little bandwidth for the provider), though for small files the difference is not worth the hassle of creating/offering/supporting (in install/build documentation for instance) the extra format.

(if you want to see a religious battle on the subject of archive file formats, take a short trip into what is left of Usenet or pirate (sorry "scene") territory and dare to suggest that something might be more suitable than .rar archives - it is almost as incendiary as suggesting an emacs user try vim or vice-versa)