[Python-3000] AtheOS?

Guido van Rossum guido at python.org
Fri Aug 17 23:44:56 CEST 2007


On 8/17/07, "Martin v. Löwis" <martin at v.loewis.de> wrote:
> > Perhaps, it would be a good idea to take Plan9's approach to
> > portability -- i.e., you develop an extreme allergy to code filled
> > with #if, #ifdef, #else, #elseif; localize system dependencies in
> > separate files and hide them behind interfaces.
> >
> > By the way, there is a great chapter about portability in The Practice
> > of Programming, by Brian W. Kernighan and Rob Pike
> > (http://plan9.bell-labs.com/cm/cs/tpop/). That is where I first
> > learned about this approach.
>
> I'm doubtful whether that makes the code more readable, as you need
> to go through layers of indirections to find the place where something
> is actually implemented. In any case, contributions to apply this
> strategy to selected places are welcome, assuming they don't slow down
> the code too much.

We already do this, e.g. pyport.h contains lots of stuff like that,
and sometimes thinking about it some more makes it possible to move
more stuff there (or to another platform-specific file). It just
doesn't make sense to turn *every* silly little #ifdef into a system
API, no matter what my esteemed colleagues say. ;-)

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-3000 mailing list