Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Gregory Ewing Newsgroups: comp.lang.python Subject: Re: The end to all language wars and the great unity API to come! Date: Sun, 03 Jul 2011 15:57:03 +1200 Lines: 36 Message-ID: <97a7kiFsn7U1@mid.individual.net> References: <1bf8cf87-b173-470a-a05e-a65616c988a0@d22g2000yqn.googlegroups.com> <41f31477-48ee-4a8a-ab2d-87073a918996@r18g2000vbs.googlegroups.com> <6dd92755-c8e9-47ef-aa08-ffffbc3d1893@5g2000yqb.googlegroups.com> <0ebac153-0e0d-49fd-96c0-af9f40fbf222@q1g2000vbj.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net 47T4vRzSNCPAt2YCf+KYOA+i+AOAuTLDPEHHAwzHAvq5WAOjSi Cancel-Lock: sha1:draRtp63P5qROPmNEGCcEKrJl2E= User-Agent: Mozilla Thunderbird 1.0.5 (Macintosh/20050711) X-Accept-Language: en-us, en In-Reply-To: <0ebac153-0e0d-49fd-96c0-af9f40fbf222@q1g2000vbj.googlegroups.com> Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:8718 The place where this "Unity API" idea of yours falls down is that an API is only truly easy to use when it's designed to closely match the characteristics of the language it's being used from. For example, Python has a very powerful feature that most other languages don't have anything remotely like: very flexible keyword arguments. A truly Pythonic API will take advantage of them wherever it makes sense. An extreme example is PyGUI, where you can write things like win = Window(title = "Fred", width = 300, height = 100, position = (30, 50), movable = True, resizable = True) In fact, almost *any* attribute of any PyGUI object can be specified using keyword arguments in the constructor. In your typical C or C++ based API, either you have a constructor taking a zillion positional parameters that all have to be in the right order, or you have to set all the attributes individually afterwards: win = Window() win.title = "Fred" win.width = 300 win.height = 100 win.position = (30, 50) win.movable = True win.resizable = True Either way you end up with an API that feels very awkward when used from Python. -- Greg