Hi Toby,

Antoine Martin <[email protected]> wrote on 25/03/2009 02:31:04 PM:
Nathaniel Smith wrote:
(In general, I want to avoid having different code paths for different
platforms when possible; it's just more chances for bugs to creep in,
and makes testing harder.)
Indeed, I am more used to writing server side Java code. So writing code
that knows and even cares and branches based on what platform it is
running on is a new and completely alien concept to me... and it makes
me cringe!

I work on multiplatform code day-in, day-out. Identify all the areas which
need platform-specific handling, abstract them and stick all the
platform-specific code into it's own folder. That way at least you have
some hope of maintaining sanity in the main line.
I am well versed in handling platform-specific using abstraction (dealing with JDBC/SQL variations in my case rather than OSes - and in Java rather than python - but still...) I think that in this case we should try to keep the code in the same file(s), changing the code if needed (as Nathaniel did with the socket code) rather than splitting the flow into separate code-paths/files. (note that I didn't even attempt to do that with my first cut... I'm not exactly leading by example here!) It may not be possible to do this cleanly in all cases... For example, I think the clipboard stuff will need some abstraction before we can handle both platforms. One thing is for sure: the use of statements like "if.platform == win32" should be kept to a minimum. (yuk)

Cheers
Antoine

_______________________________________________
Parti-discuss mailing list
[email protected]
http://lists.partiwm.org/cgi-bin/mailman/listinfo/parti-discuss

Reply via email to