Frédéric Delanoy frederic.delanoy@gmail.com wrote:
- cab_ULONG window_size; /* window size (1Kb through 2Mb) */
- cab_ULONG window_size; /* window size (1 KB through 2 MB) */
This is not the typos, that's a common way of writing sizes by programmers, personally I prefer the old form (and will keep using it in future) and hate the "fixed" variant.
Please avoid this kind of "fixes".
On 16 February 2014 12:19, Dmitry Timoshkov dmitry@baikal.ru wrote:
Frédéric Delanoy frederic.delanoy@gmail.com wrote:
- cab_ULONG window_size; /* window size (1Kb through 2Mb) */
- cab_ULONG window_size; /* window size (1 KB through 2 MB) */
This is not the typos, that's a common way of writing sizes by programmers, personally I prefer the old form (and will keep using it in future) and hate the "fixed" variant.
I can't say I'm much of a fan of this kind of change either, but if we really wanted to be strict about this as a project, I'd prefer either "kB" or "KiB" (etc.), depending on what's meant.
Henri Verbeet hverbeet@gmail.com wrote:
On 16 February 2014 12:19, Dmitry Timoshkov dmitry@baikal.ru wrote:
Frédéric Delanoy frederic.delanoy@gmail.com wrote:
- cab_ULONG window_size; /* window size (1Kb through 2Mb) */
- cab_ULONG window_size; /* window size (1 KB through 2 MB) */
This is not the typos, that's a common way of writing sizes by programmers, personally I prefer the old form (and will keep using it in future) and hate the "fixed" variant.
I can't say I'm much of a fan of this kind of change either, but if we really wanted to be strict about this as a project, I'd prefer either "kB" or "KiB" (etc.), depending on what's meant.
In my years of University the students were told to remember that 1Kb == 1024 bytes, 1Mb == 1024Kb and size prefixes should be written as a capital letter to emphasize its meaning. I'm very reluctant to change this practice to something else regardless of explanations and intents. I understand that for not technical people 1K == 1000, but I'd assume programmers are not of that kind.
On 16 February 2014 09:57, Dmitry Timoshkov dmitry@baikal.ru wrote:
In my years of University the students were told to remember that 1Kb == 1024 bytes, 1Mb == 1024Kb and size prefixes should be written as a capital letter to emphasize its meaning. I'm very reluctant to change this practice to something else regardless of explanations and intents. I understand that for not technical people 1K == 1000, but I'd assume programmers are not of that kind.
Strictly speaking the SI units are kB, etc. for 1000 bytes, and IEC KiB, etc. for 1024 bytes. For memory sizes, it's usually obvious enough from context which one is meant, so there's not much of a point to change it. It's more ambiguous for e.g. file or disk sizes where drive vendors often use 1000 based units, and transfer speeds where "b" usually means bits.
But as I said, in most cases it's obvious enough from context, and "KB" instead of "Kb" isn't really much clearer.
On Sun, 16 Feb 2014, Henri Verbeet wrote: [...]
It's more ambiguous for e.g. file or disk sizes where drive vendors often use 1000 based units,
<offtopic>
And it's getting even more confusing. Some time ago I bought a 60 GB SSD which was really 60 * 1024 * 1024 KB. That makes sense since SSDs are after all more like DIMMS than hard drives. But more recently I bought a 240 GB SSD which turned out to be 240,000,000 KB.
So for SSDs there's no telling what GB means anymore :-(
</offtopic>
Francois Gouget fgouget@free.fr wrote:
It's more ambiguous for e.g. file or disk sizes where drive vendors often use 1000 based units,
<offtopic>
And it's getting even more confusing. Some time ago I bought a 60 GB SSD which was really 60 * 1024 * 1024 KB. That makes sense since SSDs are after all more like DIMMS than hard drives. But more recently I bought a 240 GB SSD which turned out to be 240,000,000 KB.
So for SSDs there's no telling what GB means anymore :-(
That's been always a trick HDD vendors were playing for decades to fool the users, and it has nothing todo with the actual mening of those abbrevations.
On Sun, Feb 16, 2014 at 10:14 AM, Henri Verbeet hverbeet@gmail.com wrote:
On 16 February 2014 09:57, Dmitry Timoshkov dmitry@baikal.ru wrote:
In my years of University the students were told to remember that 1Kb == 1024 bytes, 1Mb == 1024Kb and size prefixes should be written as a capital letter to emphasize its meaning. I'm very reluctant to change this practice to something else regardless of explanations and intents. I understand that for not technical people 1K == 1000, but I'd assume programmers are not of that kind.
Strictly speaking the SI units are kB, etc. for 1000 bytes, and IEC KiB, etc. for 1024 bytes. For memory sizes, it's usually obvious enough from context which one is meant, so there's not much of a point to change it. It's more ambiguous for e.g. file or disk sizes where drive vendors often use 1000 based units, and transfer speeds where "b" usually means bits.
But as I said, in most cases it's obvious enough from context, and "KB" instead of "Kb" isn't really much clearer.
Well, as François pointed out, b stands for bit, and not bytes.
Basically the rationale for this patch was to fix spacing (space between number and unit name), and standardize the units abbreviations while doing that. k is SI, and is 1000, while K is 1024, unambiguously. KiB and MiB could have been used instead of KB/MB, but those aren't broadly used, albeit standardized now, while KB is much more used than kB (which isn't correct IMO; see above).
Frédéric
On Sun, 16 Feb 2014, Dmitry Timoshkov wrote: [...]
- cab_ULONG window_size; /* window size (1Kb through 2Mb) */
- cab_ULONG window_size; /* window size (1 KB through 2 MB) */
[...]
In my years of University the students were told to remember that 1Kb == 1024 bytes, 1Mb == 1024Kb and size prefixes should be written as a capital letter to emphasize its meaning.
'1Kb' is some number of bits, not bytes and is nowhere close to 1024 bytes. So that's one thing that really needed fixing in the old comment.
Now as for the always confusing 1000 vs 1024 ambiguity and kB vs. KB vs. KiB aspect I don't care.
Reference: * https://en.wikipedia.org/wiki/Bit The symbol for bit, as a unit of information, is either simply bit (recommended by the ISO/IEC standard 80000-13 (2008)) or lowercase b (recommended by the IEEE 1541 Standard (2002)).
* https://en.wikipedia.org/wiki/Byte#Unit_symbol The unit symbol for the byte is specified in IEC 80000-13, IEEE 1541 and the Metric Interchange Format as the upper-case character B.
The unit symbol kB is commonly used for kilobyte, but may be confused with the still often-used abbreviation of kb for kilobit. IEEE 1541 specifies the lower case character b as the symbol for bit; however, IEC 80000-13 and Metric-Interchange-Format specify the abbreviation bit (e.g., Mbit for megabit) for the symbol, providing disambiguation from B for byte.
* https://en.wikipedia.org/wiki/Kilobyte All existing recommendations prefer to use the uppercase letter B for byte, because b is used for the bit.
Just as a note, in the GUI we seem to be using 'k' (*), 'kB', 'MB' and 'GB'. If anyone wants to change the first two to 'KB' I'm fine with that. The 'KiB' variants may prove too confusing for non technical users however.
(*) Look for '64k'.