Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Does Python compete with Java?

Reply
Thread Tools

Does Python compete with Java?

 
 
Chris Herborth
Guest
Posts: n/a
 
      04-06-2004
Harald Massa wrote:

> Roy Smith <(E-Mail Removed)> wrote in news:roy-094613.21022405042004
> @reader1.panix.com:
>
>>http://www-users.cs.york.ac.uk/~susan/joke/foot.htm

>
>>They don't have one for Python, but I expect it would be something like
>>this:

>
> I think the most common solution is:
>
>>How to Shoot Yourself In the Foot

>
> Python
> you discover that Guido used his time machine to shoot you in the foot
> years ago


My experience:

Post to comp.lang.python:

"I'm looking for a good scripting language, and Python's got some great
features, but that syntactically-relevant whitespace thing just seems wrong..."

Replies:

"Don't worry about it, in practice you'll see that you write code that way
anyway and it's very natural..."

Me:

"I don't know..."

[Wanders off for a few months. Returns.]

"Python rules! Best scripting language EVAR!"

--
Chris Herborth http://www.velocityreviews.com/forums/(E-Mail Removed)
Documentation Overlord, CRYPTOCard Corp. http://www.cryptocard.com/
Never send a monster to do the work of an evil scientist.
Postatem obscuri lateris nescitis.
 
Reply With Quote
 
 
 
 
Jacek Generowicz
Guest
Posts: n/a
 
      04-06-2004
Chris Herborth <(E-Mail Removed)> writes:

> One of Python's most awesome features (IMHO at least) is that you can
> fire up an interactive interpreter while you're writing your code, and
> try things out as you go... using this technique, I've unit tested
> methods and algorithms interactively and ended up with useful,
> non-trivial applications that run and work properly the first time.
>
>
> With compiled languages (Java, C#, C++), I find I'm writing a bit of

^^^^^^^^^^^^^^^^^^^^^^^
> code, taking a break to compile it, figuring out how to unit test the
> method... Python saves me a huge amount of time in the prototype and
> development cycles.


Please note that this has nothing to do with compilation per-se. There
are languages with to-native-binary compilers which give you all the
instant turnaround flexibility that Python does.

Indeed, there are even some development environments for the languages
you mention which try to provide a similar experience.
 
Reply With Quote
 
 
 
 
Roy Smith
Guest
Posts: n/a
 
      04-06-2004
Chris Herborth <(E-Mail Removed)> writes:
>> With compiled languages (Java, C#, C++), I find I'm writing a bit of
>> code, taking a break to compile it, figuring out how to unit test the
>> method... Python saves me a huge amount of time in the prototype and
>> development cycles.


Jacek Generowicz <(E-Mail Removed)> wrote:
> Please note that this has nothing to do with compilation per-se. There
> are languages with to-native-binary compilers which give you all the
> instant turnaround flexibility that Python does.


Even more interesting is the fact that Java and Python both have very
similar architectures (similar enough, in fact, that things like Jython
are possible). Both compile your source code text into an intermediate
"byte code" form, and both then run this intermediate form on a virtual
machine.

The difference is that Java exposes the compilation step to the user
while Python hides it. If you really wanted to, you could hack up a
"Python compiler" which takes .py files, imports them to force
generation of the corresponding .pyc files, and then exits without
executing anything. You could then execute the .pyc files in a distinct
"execute phase". Not sure why you would want to do that, though
 
Reply With Quote
 
Peter Hansen
Guest
Posts: n/a
 
      04-06-2004
Roy Smith wrote:
> The difference is that Java exposes the compilation step to the user
> while Python hides it. If you really wanted to, you could hack up a
> "Python compiler" which takes .py files, imports them to force
> generation of the corresponding .pyc files, and then exits without
> executing anything. You could then execute the .pyc files in a distinct
> "execute phase". Not sure why you would want to do that, though


python -c "import py_compile as p; p.compile('mymodule.py')"
 
Reply With Quote
 
A. Lloyd Flanagan
Guest
Posts: n/a
 
      04-07-2004
Greg Ewing <(E-Mail Removed)> wrote in message news:<c4taac$2lg0bc$(E-Mail Removed)-berlin.de>...
>
> I think it's a *good* thing. Python is succeeding very well
> by just existing and actually being well designed and useful,
> as opposed to having a large company's marketing machine trying
> to tell everyone that it is.
>


Very true. In addition, I think python will gain a lot of
"mind-share" as more and more popular applications are written in
python.
 
Reply With Quote
 
Dave Benjamin
Guest
Posts: n/a
 
      04-08-2004
In article <(E-Mail Removed) >, A. Lloyd Flanagan wrote:
> Greg Ewing <(E-Mail Removed)> wrote in message news:<c4taac$2lg0bc$(E-Mail Removed)-berlin.de>...
>>
>> I think it's a *good* thing. Python is succeeding very well
>> by just existing and actually being well designed and useful,
>> as opposed to having a large company's marketing machine trying
>> to tell everyone that it is.

>
> Very true. In addition, I think python will gain a lot of
> "mind-share" as more and more popular applications are written in
> python.


Over the long term, I think Python's biggest key to success will be that we
will still be able to read the programs that we are writing now.

--
..:[ dave benjamin: ramen/[sp00] -:- spoomusic.com -:- ramenfest.com ]:.
: please talk to your son or daughter about parametric polymorphism. :
 
Reply With Quote
 
A. Lloyd Flanagan
Guest
Posts: n/a
 
      04-13-2004
Dave Benjamin <(E-Mail Removed)> wrote in message news:<(E-Mail Removed)>...
>
> Over the long term, I think Python's biggest key to success will be that we
> will still be able to read the programs that we are writing now.


No argument here
 
Reply With Quote
 
Jakub Fast
Guest
Posts: n/a
 
      04-13-2004
>>Over the long term, I think Python's biggest key to success will be that we
>>will still be able to read the programs that we are writing now.

>
>
> No argument here


Hi,

I'm totally fresh to python, and i'm enjoying the language, and the
readability a lot, but i just bumped into something that -- from my
purely subjective perspective -- surprised me with pretty awful,
not-very-readable syntax: operator overloads and static methods. is this
an issue that is argued over? i just find these particular bits to be
10x more intuitive the way they are implemented in c++...

would having the possibility of using

def static mymethod():

instead of the standard = staticmethod(...) do anything bad to python as
it is? Same question goes for something along the lines of
__operator__['='] (self, etc).

On quite another note, is it possible to define your own operators in
python? you could argue that this might actually make the code _less_
transparent, but then, at least for some cases, my experience shows that
a few cleverly defined operators work magic in terms of bumping up the
ease-of-use of a library. what i'm thiniking about, exactly, are the
"--->"'s, "==>"'s, or "~~>"'s you'll see people using in prolog for
instance. Also, can "and", "or", "not" etc. be overloaded?

I've been pondering using python+NLTK to teach a computational semantics
class this summer (precisely because i think the basics of python would
be easy for the students to learn quickly, and, class aside, that
learning them actually might turn out useful for whatever they want to
do in the future -- more useful than, say, prolog) and nothing can beat
the intuitive appeal of

S ==> (NP and VP) or VP

over CFGProduction(S, NP, VP), CFGProduction(S, VP) for specifying your
simple cfg, dcg or ebnf rules if you're completely new to programming
and have just been given a programming assignment


Any comments, any answers?

Thanks in advance.

Kuba Fast



 
Reply With Quote
 
=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=
Guest
Posts: n/a
 
      04-13-2004
Jakub Fast wrote:
> would having the possibility of using
>
> def static mymethod():
>
> instead of the standard = staticmethod(...) do anything bad to python as
> it is?


In Python, people actually use static methods much less frequently than
in, say, Java - there is absolutely no problem with having global
functions (rather than class-static methods) most of the time. This is
partially due to the fact that static methods did not exist for a long
time.

However, this issue is being considered. Most likely, the new syntax
will read

[staticmethod]
def mymethod():
...

The debate is only about where the [staticmethod] should go. Solutions
introducing new keywords are not acceptable. See PEP 318 for details

> Same question goes for something along the lines of
> __operator__['='] (self, etc).


Overloading assignment will never happen, for two reasons:
- assignment is not an operator, but a statement
- assignment does not modify an object, atleast not in the
form

variable = value

(in the form object.variable=value, it does modify object,
and you can overload the assignment by implementing __setattr__
or using by using properties)

> On quite another note, is it possible to define your own operators in
> python?


No, it isn't. People would not like it because it looks like line noise.

> nothing can beat
> the intuitive appeal of
>
> S ==> (NP and VP) or VP
>
> over CFGProduction(S, NP, VP), CFGProduction(S, VP) for specifying your
> simple cfg, dcg or ebnf rules if you're completely new to programming
> and have just been given a programming assignment


With several years of computing experience, I cannot understand neither
notation without some background. They look like a logical implication
to me, but I'm uncertain whether you are aiming at an assertion to be
tested, or merely at the grammatical structure.

If it is the structure, you should be able to write this as

S.implies(NP.and_(VP).or_(VP))

(assuming I have the grouping of your logical notation right - I have
troubles guessing whether ==> or `orī should have higher precedence)

Regards,
Martin

 
Reply With Quote
 
Jakub Fast
Guest
Posts: n/a
 
      04-13-2004
> No, it isn't. People would not like it because it looks like line noise.

I guess that qualifies as a definite answer. Shame, though, in my
stubborn and incorrigible ways i still kind of think a well-constructed
operator saves the day, especially when exposing your language in a
"custom" environment, such as embedded scripting or a neatly defined
collection of 'special' tasks. Of course you can always resort to
getting the user to provide text files that you parse yourself according
to some custom grammar (which is what i'll probably end up doing), but
that has disadvantages in regards to a nice side effect of getting
people to pick up some python on the way and actually feel like they're
really programming.

and yes, i do think this is enough of a reason to look at other
languages that do permit op overloading for you embedded scripting in
some cases (like when you don't want to confuse the average user too
much and make typical tasks as easy as possible while retaining the
versatility of a full-fledged language).

of course custom operators (if they permit alphanumeric shapes for
instance...) can make one major mess of your code, but then, isn't the
zen of python more along the way of: "the master hits the student
repeatedly with a stick and the student experiences enlightenment"
rather than "the master takes the toys away from the student". Is just
the inclusion of a feature like this into the language considered evil,
especially taking into account that it does not intervene with whatever
else there is in the language?

>> S ==> (NP and VP) or VP

>
> If it is the structure, you should be able to write this as
>
> S.implies(NP.and_(VP).or_(VP))
>


This is completely fine and actually quite cool if you've had your OO
practice, but the point is that the parts you actually felt missing and
which made my formulation unreadable to you are absolutely obvious for
anyone who has had anything to do with linguistics -- which definitely
would be the case with whomever i'd show the module to -- and the
sample form i give would require 0.5 degrees of learning effort, as
opposed to 10.5 degrees or way more if you're completely new to programming.


Is there really no chance this goes into python on an "if you really
have to do this, be warned, but here are the tools" basis?

Anyway, hope i'm not boring you to death and thank you for your answers

Kuba

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can Cable (TV) Still Compete? tabernacle2002@hotmail.com DVD Video 2 11-23-2005 01:05 AM
Re: Does Python compete with Java? Jakub Fast Python 2 04-15-2004 02:16 AM
Need programmers? At Colance they compete for your business. M Brian Edwards HTML 0 12-11-2003 09:54 AM
Need programmers? At Colance they compete for your business. g0P Phillip Torres Perl 0 12-02-2003 11:07 AM
Make lenders compete for your loan mixxa zsg Jack Dwyer Python 0 09-07-2003 11:30 AM



Advertisments