[Tutor] << operator ? [left bitwise shifting]

Erik Price erikprice@mac.com
Thu, 11 Apr 2002 07:55:45 -0400


On Thursday, April 11, 2002, at 01:42  AM, Paul Sidorsky wrote:

> Searching the entire standard library for << produced only about 30
> hits.  So don't worry about it too much.  Odds are you probably won't
> need to shift bits, at least when working with Python.

That's good.  I understand now what it's for (sort of a way of 
"encoding/compressing" data like reducing an AIF file to MP3 for 
internet transmission, but without lossiness, but it's not really 
encoding is it).  But I don't think I ever want to use it.  Or maybe I 
would, but not anytime soon.  Thanks for the explanation Paul.

Incidentally,

> (Notice I didn't put spaces around the
> operators.  It's a a curious phenomenon that programmers writing some
> form of optimized code tend to optimize on whitespace as well; I've
> almost never seen the properly-spaced version in optimized code.)

have you ever looked at the source code for Google pages?  Very little 
whitespace, no verbosity at all.  It's like the opposite of XML 
(designed to be human-readable and where compactness is very 
deprioritized).  In fact, they don't use XHTML at all, like <br />, 
since <br /> has two more bytes than you really need and it can add up 
if you use a lot of <br />s.  (It's like the opposite of my code, I tend 
to overdo it with comments and I try to use XHTML over standard HTML.)