[OPINION] - does language really matter if they all do the samething?

Dietrich Epp dietrich at zdome.net
Fri Jan 23 19:05:25 EST 2004


On Jan 23, 2004, at 10:59 AM, Christian Wilcox wrote:

> You might find this http://www.artima.com/intv/craft.html artima.com 
> interview (especially the section "Learning Languages") with Yukihiro 
> Matsumoto, creator of Ruby, interesting.  He discusses how certain 
> programming languages focus on specific paradigms, which could allow a 
> programmer to think in ways they may not otherwise.
>
> Python doesn't necessarily force any specific paradigm, which is one 
> of it's selling points, IMO.

I've been programming a lot of different things lately, and sometimes I 
do feel constrained by Python.  The only way that I can program so I 
don't feel constrained is to use multiple languages.  Sometimes I 
really just want to curry my functions in Python or Lisp, sometimes I 
really want to have Python's or Ruby's objects in Lisp or C, sometimes 
I want to write a macro in languages other than Lisp, and sometimes I 
even want to be able to do pointer arithmetic in Python.

Python's strength is that it encourages paradigms that are relatively 
concise and easy to read and write, and the paradigms it uses coincide 
very nicely with many programming projects.  But there are many 
projects which are just not nice to write in Python.

Example: I wrote a project in Python which reads some data files and 
uses them to make a decision (sort of).  I got it to about 90% 
functionality, and realized that the last 10% was extremely difficult 
to do with Python.  After writing one Lisp macro of exactly 13 lines, I 
rewrote the entire program, incorporating the data into Lisp files 
which were not only much shorter, but much clearer, easier to read, 
etc.  I just couldn't think of a way to write this program in Python 
without a lot of code replication.

Similarly, most scripting and many other projects I'd never consider 
doing in anything but Python, except the occasional hardcore text 
processor which causes physical pain to write in anything but Perl or 
Ruby.

<abestos>
Python seems to take the middle ground.  It's build from a procedural 
standpoint, in an environment where most things are objects and some 
are functions.  It's not what I'd choose as an example of an object 
oriented language.  There are no messages, only function calls, so you 
can't capture them.  The plus side is that methods behave exactly the 
same as functions, this makes the language simple and the two ideas 
interchangeable.  You can set an object's method to a function.  The 
minus side is that the paradigm of sending a message "to" an object 
doesn't exist, and anyone coming from Smalltalk or even Objective-C 
might miss that and feel constrained (I did).  But if Python were 
really object-oriented like that, then it wouldn't have Python's 
simplicity any more.
</abestos>





More information about the Python-list mailing list