ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> pyxpcom
pyxpcom
Re: [pyxpcom] Using Python methods vs. Using Mozilla methods
by Todd Whiteman other posts by this author
Nov 26 2009 10:57AM messages near this date
view in the new Beta List Site
[pyxpcom] Using Python methods vs. Using Mozilla methods | [pyxpcom] pyxpcom chokes on NULL pointers as out params
Jonathan Morgan wrote:
>  I'm curious to know if there are there any strong opinions on whether
>  it is better to:
>  1. Use Mozilla libraries wherever they support what you want.  This
>  would mean you are trying to write a Mozilla application, but just
>  happen to prefer Python to Javascript.  It would also mean you can
>  theoretically change your implementation language if you want to so
>  long as you stay with Mozilla.
>  
>  2. Use Python libraries wherever they support what you want.  Probably
>  more attractive to Python libraries, more "Pythonic", and in a lot of
>  cases easier to use (for example, I can't even imagine wanting to use
>  Mozilla file handling and mess about with XPCOM and interfaces and so
>  forth when I can just use standard Python functions and libraries).
>  
>  3. Use some blend, based on your judgement as to which is better for
>  the particular problem.  This sounds sensible in theory, but could end
>  up in you having the worst of both worlds, where you are tied both to
>  using Mozilla as a platform and Python as an implementation language,
>  and where no-one can really understand your application who doesn't
>  know both the Mozilla platform and Python (this is probably true with
>  (2) anyway, since you are going to have to be using XUL and so forth
>  which I don't think a huge number of people know).

Hi Jon,

You'll generally end up using a blend (3), utilizing XUL, JavaScript and 
Python. Komodo is a good example of this mix:
[http://grok.openkomodo.com/source/xref/openkomodo/trunk/src/]

Some things are simpler to do in Python (like threading, file handling, 
sockets, process launching) and some are easier in (or require) Mozilla 
XPCOM (URI management, event handling, notifications, DOM manipulation).

It really comes down to your own personal preference and judgment for 
the one that works best for you :)

Cheers,
Todd
_______________________________________________
pyxpcom mailing list
pyxpcom@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Thread:
Jonathan Morgan
Todd Whiteman

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved