On Thu, May 7, 2015 at 10:41 PM, Marko Rauhamaa <ma...@pacujo.net> wrote: > Chris Angelico <ros...@gmail.com>: > >> I was specifically disagreeing with the notion that it's right and >> normal to write a bunch of platform-specific code in Python. That >> should be the rarity. > > Why is that? > > Code is written for a specific need and environment. Often trying to > write generic solutions leads to cumbersome and clunky results on *all* > platforms. > > A software system is defined through its interfaces.
And the most important interface is with a human. Humans are the same whether you're running under Windows, Linux, or anything else. If you want to write single-platform code, go for it; but if you want to write cross-platform code, the best way is to let someone else take care of the differences, abstracting them away into a nice tidy thing that we call a high-level language. I don't need forking, file descriptors, or process IDs, to describe how a person uses my code. Those are *implementation details*. Now, it might be that I have to concern myself with some of them. Maybe I want to get optimal performance out of something, and that means using multiple processes and managing them properly. Maybe I need to interface with systemd, respond to dozens of different process-level signals, use directory notifications, and do a bunch of other Linux-only things, so maybe it's just completely impractical to consider supporting even BSD-based Unixes, much less Windows. So be it. But to the greatest extent possible, Python should let me write code that doesn't care about any of that. ChrisA -- https://mail.python.org/mailman/listinfo/python-list