Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #8718

Re: The end to all language wars and the great unity API to come!

From Gregory Ewing <greg.ewing@canterbury.ac.nz>
Newsgroups comp.lang.python
Subject Re: The end to all language wars and the great unity API to come!
Date 2011-07-03 15:57 +1200
Message-ID <97a7kiFsn7U1@mid.individual.net> (permalink)
References (2 earlier) <f6c4263c-60c7-488e-9f6f-254f8bd0711d@m18g2000vbl.googlegroups.com> <41f31477-48ee-4a8a-ab2d-87073a918996@r18g2000vbs.googlegroups.com> <mailman.574.1309655550.1164.python-list@python.org> <6dd92755-c8e9-47ef-aa08-ffffbc3d1893@5g2000yqb.googlegroups.com> <0ebac153-0e0d-49fd-96c0-af9f40fbf222@q1g2000vbj.googlegroups.com>

Show all headers | View raw


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

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

The end to all language wars and the great unity API to come! rantingrick <rantingrick@gmail.com> - 2011-07-02 15:59 -0700
  Re: The end to all language wars and the great unity API to come! Chris Angelico <rosuav@gmail.com> - 2011-07-03 09:38 +1000
    Re: The end to all language wars and the great unity API to come! rantingrick <rantingrick@gmail.com> - 2011-07-02 16:46 -0700
      Re: The end to all language wars and the great unity API to come! Tim Chase <python.list@tim.thechases.com> - 2011-07-02 20:09 -0500
    Re: The end to all language wars and the great unity API to come! rantingrick <rantingrick@gmail.com> - 2011-07-02 17:21 -0700
      Re: The end to all language wars and the great unity API to come! Chris Angelico <rosuav@gmail.com> - 2011-07-03 10:36 +1000
        Re: The end to all language wars and the great unity API to come! Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2011-07-03 16:06 +1200
      Re: The end to all language wars and the great unity API to come! rantingrick <rantingrick@gmail.com> - 2011-07-02 17:58 -0700
        Re: The end to all language wars and the great unity API to come! Chris Angelico <rosuav@gmail.com> - 2011-07-03 11:12 +1000
          Re: The end to all language wars and the great unity API to come! rantingrick <rantingrick@gmail.com> - 2011-07-02 18:43 -0700
            Re: The end to all language wars and the great unity API to come! Chris Angelico <rosuav@gmail.com> - 2011-07-03 11:49 +1000
              Re: The end to all language wars and the great unity API to come! rantingrick <rantingrick@gmail.com> - 2011-07-02 19:24 -0700
                Re: The end to all language wars and the great unity API to come! Chris Angelico <rosuav@gmail.com> - 2011-07-03 13:14 +1000
                Re: The end to all language wars and the great unity API to come! rantingrick <rantingrick@gmail.com> - 2011-07-02 21:13 -0700
            Re: The end to all language wars and the great unity API to come! rantingrick <rantingrick@gmail.com> - 2011-07-02 19:08 -0700
              Re: The end to all language wars and the great unity API to come! Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2011-07-03 15:57 +1200
                Re: The end to all language wars and the great unity API to come! rantingrick <rantingrick@gmail.com> - 2011-07-02 21:34 -0700
                Re: The end to all language wars and the great unity API to come! Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-07-03 14:46 +1000
                Re: The end to all language wars and the great unity API to come! Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2011-07-03 02:59 -0700
            Re: The end to all language wars and the great unity API to come! Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2011-07-03 16:00 +1200
              Re: The end to all language wars and the great unity API to come! rantingrick <rantingrick@gmail.com> - 2011-07-02 21:42 -0700
                Re: The end to all language wars and the great unity API to come! alex23 <wuwei23@gmail.com> - 2011-07-03 22:06 -0700
                Re: The end to all language wars and the great unity API to come! rantingrick <rantingrick@gmail.com> - 2011-07-04 09:35 -0700
                Re: The end to all language wars and the great unity API to come! Chris Angelico <rosuav@gmail.com> - 2011-07-05 03:19 +1000
                Re: The end to all language wars and the great unity API to come! Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-07-05 09:24 +1000
                Re: The end to all language wars and the great unity API to come! Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2011-07-04 19:09 -0700
                Re: The end to all language wars and the great unity API to come! rantingrick <rantingrick@gmail.com> - 2011-07-05 18:07 -0700
                Re: The end to all language wars and the great unity API to come! Chris Angelico <rosuav@gmail.com> - 2011-07-06 12:31 +1000
                Microsoft GUIs (was: The end to all language wars and the great unity API to come!) (OT) Andrew Berg <bahamutzero8825@gmail.com> - 2011-07-05 23:13 -0500
                Re: Microsoft GUIs (was: The end to all language wars and the great unity API to come!) (OT) Chris Angelico <rosuav@gmail.com> - 2011-07-06 14:25 +1000
                Re: Microsoft GUIs Andrew Berg <bahamutzero8825@gmail.com> - 2011-07-05 23:53 -0500
                Re: Microsoft GUIs Andrew Berg <bahamutzero8825@gmail.com> - 2011-07-06 00:29 -0500
                Re: The end to all language wars and the great unity API to come! Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2011-07-05 22:26 -0700
                Re: Microsoft GUIs Chris Angelico <rosuav@gmail.com> - 2011-07-06 15:43 +1000
                Re: The end to all language wars and the great unity API to come! Chris Angelico <rosuav@gmail.com> - 2011-07-06 15:47 +1000
                Re: The end to all language wars and the great unity API to come! Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2011-07-06 19:15 +1200
                Re: The end to all language wars and the great unity API to come! Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-07-06 21:46 +1000
                Re: The end to all language wars and the great unity API to come! Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2011-07-06 09:55 -0700
                Re: The end to all language wars and the great unity API to come! alex23 <wuwei23@gmail.com> - 2011-07-04 19:31 -0700
                Re: The end to all language wars and the great unity API to come! sal migondis <salmig99@gmail.com> - 2011-07-05 11:14 -0700
                Re: The end to all language wars and the great unity API to come! Andrew Berg <bahamutzero8825@gmail.com> - 2011-07-05 16:01 -0500
                Re: The end to all language wars and the great unity API to come! Chris Angelico <rosuav@gmail.com> - 2011-07-06 08:36 +1000
                Re: The end to all language wars and the great unity API to come! Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2011-07-05 22:26 -0700
                Re: The end to all language wars and the great unity API to come! Ben Finney <ben+python@benfinney.id.au> - 2011-07-07 15:10 +1000
                Re: The end to all language wars and the great unity API to come! Andrew Berg <bahamutzero8825@gmail.com> - 2011-07-06 00:37 -0500
                Re: The end to all language wars and the great unity API to come! Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-07-06 21:45 +1000
                Re: The end to all language wars and the great unity API to come! sal migondis <salmig99@gmail.com> - 2011-07-08 12:05 -0700
                Re: The end to all language wars and the great unity API to come! Ian Kelly <ian.g.kelly@gmail.com> - 2011-07-08 13:21 -0600
                Re: The end to all language wars and the great unity API to come! alex23 <wuwei23@gmail.com> - 2011-07-04 19:36 -0700
                Re: The end to all language wars and the great unity API to come! Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2011-07-04 19:36 +1200
                Re: The end to all language wars and the great unity API to come! rantingrick <rantingrick@gmail.com> - 2011-07-05 04:42 -0700
                Re: The end to all language wars and the great unity API to come! Corey Richardson <kb1pkl@aim.com> - 2011-07-05 12:04 -0400
                Re: The end to all language wars and the great unity API to come! rantingrick <rantingrick@gmail.com> - 2011-07-05 15:35 -0700
                Re: The end to all language wars and the great unity API to come! Chris Angelico <rosuav@gmail.com> - 2011-07-06 08:49 +1000
                Re: The end to all language wars and the great unity API to come! Tim Chase <python.list@tim.thechases.com> - 2011-07-05 18:21 -0500
                Re: The end to all language wars and the great unity API to come! Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-07-06 21:44 +1000
                Re: The end to all language wars and the great unity API to come! rantingrick <rantingrick@gmail.com> - 2011-07-06 06:41 -0700
                Re: The end to all language wars and the great unity API to come! Chris Angelico <rosuav@gmail.com> - 2011-07-06 23:52 +1000
                Re: The end to all language wars and the great unity API to come! Neil Cerutti <neilc@norwich.edu> - 2011-07-06 15:13 +0000
                Re: The end to all language wars and the great unity API to come! Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-07-07 00:55 +1000
                Re: The end to all language wars and the great unity API to come! rantingrick <rantingrick@gmail.com> - 2011-07-06 08:33 -0700
                Re: The end to all language wars and the great unity API to come! Teemu Likonen <tlikonen@iki.fi> - 2011-07-06 19:55 +0300
                Re: The end to all language wars and the great unity API to come! Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2011-07-06 19:05 +1200
  Re: The end to all language wars and the great unity API to come! Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-07-03 13:21 +1000

csiph-web