[Python-3000] sizeof(size_t) < sizeof(long)

Mike Meyer mwm at mired.org
Thu Apr 17 07:19:24 CEST 2008


On Thu, 17 Apr 2008 16:32:41 +1200
Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:

> David Cournapeau wrote:
> 
> > Maybe everyone understands it as 8 bits, but it has always been wrong.
> 
> It may not be officially written down anywhere, but
> almost everyone in the world understands a byte to mean
> 8 bits. When you go into a computer store and ask for
> 256MB of RAM, you don't expect to be asked "What size
> bytes would that be, then, sir?"

The key word is *almost*. And actually, the reason it's almost is
because it the context is *almost* always hardware with 8 bit
bytes. If the computer store in question exclusively sold hardware
that used 9-bit bytes, then they wouldn't ask what size the bytes
should be - they'd just give you 9-bit bytes. If they sold
heterogeneous hardware, they might well ask.

> So it's a de facto standard, and one that works perfectly
> well. Going against it is both futile and unnecessary,
> as far as I can see.

Yup, it's probably futile - most people don't care about portability
or precision, and will use "byte" to mean "8-bit byte". On the other
hand, trying to redefine "byte" to mean "8-bit byte" is also futile,
because any company that builds hardware (or software for bit-slice
processors, or ...) that manipulates subword units that hold single
characters is going to call those things bytes, no matter what length
they are.

Standards can't get away with the sloppy usage that's common
practice. So they wind up providing definitions for words that may
seem to contradict or repeat common usage, or using uncommon words
with a precise meaning in place of a common word that usually, but not
always, has that meaning.

You could make pretty much the same case that "computer" means
"machine running Windows". That is what almost everyone in the world
understands "computer" to mean. If I go into a computer store and ask
for a "computer", I expect them to offer me a machine running Windows
without asking "What operating system would that haven, then, sir?"

      <mike
-- 
Mike Meyer <mwm at mired.org>		http://www.mired.org/consulting.html
Independent Network/Unix/Perforce consultant, email for more information.


More information about the Python-3000 mailing list