473,840 Members | 1,444 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Python development time is faster.

I've seen a few posts, columns and articles which state that one of the
advantages of Python is that code can be developed x times faster than
languages such as <<Insert popular language name here>>.

Does anyone have any comments on that statement from personal
experience?
How is this comparison measured?
Thanks
Chris

Nov 13 '06 #1
19 2331
Chris Brat wrote:
I've seen a few posts, columns and articles which state that one of the
advantages of Python is that code can be developed x times faster than
languages such as <<Insert popular language name here>>.

Does anyone have any comments on that statement from personal
experience?
have you tried writing something in Python, or are you just asking around to
see if it's worth the effort to download it and play with it a little?

</F>

Nov 13 '06 #2

Chris Brat wrote:
I've seen a few posts, columns and articles which state that one of the
advantages of Python is that code can be developed x times faster than
languages such as <<Insert popular language name here>>.

Does anyone have any comments on that statement from personal
experience?
How is this comparison measured?
Thanks
Chris
Here's a start:
http://www.tcl.tk/doc/scripting.html

Go Googling. There's a paper out their that compares error rates and
time to program, lines of code, for several languages and is often
cited in defence of scripting languages. (Scripting languages have
however moved on and now like to be called dynamic languages).

- Pad.

Nov 13 '06 #3
I work full time with Java, but downloaded python about a year ago and
started playing.

I've used it quite a few times in my working environment.

Nov 13 '06 #4
"Chris Brat" <ch*******@gmai l.comwrites:
I've seen a few posts, columns and articles which state that one of the
advantages of Python is that code can be developed x times faster than
languages such as <<Insert popular language name here>>.

Does anyone have any comments on that statement from personal
experience?
How is this comparison measured?
Thanks
Chris
Personal experience takes two forms.

1. Broad experience with languages, such that doing a single project
in a new language gives a sense of the relative power and
ease-of-use. Everyone I know who is a strong Python supporter took
that route. There was an Ahh-Ha experience part way into the first
project. This includes folks who could charitably be called
curmudgeons, and people who are truely fluent in, say, C++ or Lisp.

For these people the main success factor is that "it just works".
You spend time on new functionality, or experimenting with
alternative algorithms, not on debugging. Of course, we work in a
regression-test-driven world, so we don't pile up a lot of untested
code and then hope for the best. Python facilitates that
test-early-test-often approach with its modularity and fast
edit-run cycle.

2. Write the same thing in 2 or more languages. Due to machine
migrations and project redirections I have done that with
perl-and-python, java-and-python, modula3-and-python,
lisp-and-python. In all cases, python was the second language, so
there is some learning curve to be adjusted for (i.e., I understood
the semantics better). However, since I've done some
perl-and-perl, and lisp-and-lisp, I can maybe make that adjustment.

The result was that python was relatively faster-to-develop. I
can't give a specific speedup factor, but I sure can say Python is
now my default language. The success factors were:

a) Once you get the hang of the language (a weekend?), you can
write without reference to the manuals. Or if you do reference, it
is a quick lookup. No struggling to figure out how to code
something. Or to decypher what a line of code actually does.

b) The project doesn't bog down as you add features. The language
can accomodate new paradigms, patterns, or major functionality. If
you do need to refactor, that is easy too.

c) Peer code reviews are easy -- both you and the reviewers can
understand the code's intent at a glance.
--
Harry George
PLM Engineering Architecture
Nov 13 '06 #5
Chris Brat wrote:
I've seen a few posts, columns and articles which state that one of the
advantages of Python is that code can be developed x times faster than
languages such as <<Insert popular language name here>>.

Does anyone have any comments on that statement from personal
experience?
I had to work at a laboratory a few years ago which used Java
exclusively. I was coming from several years as a graduate student
using Python almost exclusively for my own work. (But I used to teach
introductory Java classes at my previous university, so I had plenty of
Java experience.)

My own work and the work that I did for the lab were quite similar,
mainly focused on training machine learning models on natural language
processing tasks. I estimated that the Java code took me about 5x as
long. Part of this is the verbosity of Java, e.g. where you have to
write an anonymous inner class instead of using a function or a class
object directly. But probably a larger part of this was using the Java
libraries, which tend to be way over-engineered, and more complicated to
use than they need to be.

A simple example from document indexing. Using Java Lucene to index
some documents, you'd write code something like::

Analyzer analyzer = new StandardAnalyze r()
IndexWriter writer = new IndexWriter(sto re_dir, analyzer, true)
for (Value value: values) {
Document document = Document()
Field title = new Field("title", value.title,
Field.Store.YES ,
Field.Index.TOK ENIZED)
Field text = new Field("text", value.text,
Field.Store.YES ,
Field.Index.TOK ENIZED)
document.add(ti tle)
document.add(te xt)
}

Why is this code so verbose? Because the Lucene Java APIs don't like
useful defaults. So for example, even though StandardAnalyze r is
supposedly *Standard*, there's no IndexWriter constructor that includes
it automatically. Similarly, if you create a Field with a string name
and value (as above), you must specify both a Field.Store and a
Field.Index - there's no way to let them default to something reasonable.

Compare this to Python code. Unfortunately, PyLucene wraps the Lucene
APIs pretty directly, but I've wrapped PyLucene with my own wrapper that
adds useful defaults (and takes advantages of things like Python's
**kwargs). Here's what the same code looks like with my Python wrapper
to Lucene::

writer = IndexWriter(sto re_dir)
for value in values:
document = Document(title= value.title, text=value.text )
writer.addDocum ent(document)
writer.close()

Gee, and I wonder why it took me so much longer to write things in Java. ;-)
STeVe
Nov 13 '06 #6
Steven Bethard wrote:
A simple example from document indexing. Using Java Lucene to index
some documents, you'd write code something like::

Analyzer analyzer = new StandardAnalyze r()
IndexWriter writer = new IndexWriter(sto re_dir, analyzer, true)
for (Value value: values) {
Document document = Document()
Field title = new Field("title", value.title,
Field.Store.YES ,
Field.Index.TOK ENIZED)
Field text = new Field("text", value.text,
Field.Store.YES ,
Field.Index.TOK ENIZED)
document.add(ti tle)
document.add(te xt)
}

Why is this code so verbose? Because the Lucene Java APIs don't like
useful defaults. So for example, even though StandardAnalyze r is
supposedly *Standard*, there's no IndexWriter constructor that includes
it automatically. Similarly, if you create a Field with a string name
and value (as above), you must specify both a Field.Store and a
Field.Index - there's no way to let them default to something reasonable.

Compare this to Python code. Unfortunately, PyLucene wraps the Lucene
APIs pretty directly, but I've wrapped PyLucene with my own wrapper that
adds useful defaults (and takes advantages of things like Python's
**kwargs). Here's what the same code looks like with my Python wrapper
to Lucene::

writer = IndexWriter(sto re_dir)
for value in values:
document = Document(title= value.title, text=value.text )out two
writer.addDocum ent(document)
writer.close()

Gee, and I wonder why it took me so much longer to write things in Java. ;-)
Oh, the memories... I went down the same road about two years ago,
though I didn't know about PyLucene at the time and wrapped in jython
the parts of Lucene I used... never bothered to deal with java's
verbosity after that. It's a pity that jython resembles abandon-ware
these days, when jRuby showed up pretty recently and is gaining in
penetration with the java crowd. It will be a non-trivial loss for
python if it is left behind in the JVM world (at least if the latter is
not swallowed by the .NET dark forces, which doesn't seem to happen any
time soon ;-).

George

Nov 13 '06 #7
Oh, the memories... I went down the same road about two years ago,
though I didn't know about PyLucene at the time and wrapped in jython
the parts of Lucene I used... never bothered to deal with java's
verbosity after that. It's a pity that jython resembles abandon-ware
these days, when jRuby showed up pretty recently and is gaining in
penetration with the java crowd. It will be a non-trivial loss for
python if it is left behind in the JVM world (at least if the latter is
not swallowed by the .NET dark forces, which doesn't seem to happen any
time soon ;-).
I wouldn't consider jython abandonware. It is under active development, and
I'm using a 2.2 alpha successful for quite a while now - which usually
serves my needs.

The problem is/was that new-style classes were a major hurdle to take, and
this now seems to be conquered. So lets hope (or contribute code....:P)
that jython will see a 2.4 version ASAP.

diez
Nov 13 '06 #8
Chris Brat schrieb:
I've seen a few posts, columns and articles which state that one of the
advantages of Python is that code can be developed x times faster than
languages such as <<Insert popular language name here>>.

Does anyone have any comments on that statement from personal
experience?
How is this comparison measured?
Thanks
Chris

Have a lookl at
http://wwwipd.ira.uka.de/EIR/otherwork/index.html
Nov 13 '06 #9
One thing I really like, is making "prototypes " on python.
Just to test some algorithm or procedure.
It is very fast and easy to debug.
So after, I make it in c++ (but not too much often, I leave it in
python today.)

Chris Brat wrote:
I've seen a few posts, columns and articles which state that one of the
advantages of Python is that code can be developed x times faster than
languages such as <<Insert popular language name here>>.

Does anyone have any comments on that statement from personal
experience?
How is this comparison measured?
Thanks
Chris
Nov 13 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

38
3756
by: kbass | last post by:
In different articles that I have read, persons have constantly eluded to the productivity gains of Python. One person stated that Python's productivity gain was 5 to 10 times over Java in some in some cases. The strange thing that I have noticed is that there were no examples of this productivity gain (i.e., projects, programs, etc.,...). Can someone give me some real life examples of productivity gains using Python as opposed other...
47
3686
by: Michael Scarlett | last post by:
There is an amazing article by paul graham about python, and an even better discussion about it on slashdot. The reason I point this out, is the more I read both articles, the more I realised how we would be mutilating the language with that god forsaken @ decorator. I don't know about the rest of you, but I learned python and fell in love with its syntax and simplicity. Python - just works. So please GVR. Don't complicate it. Leave it as...
36
6423
by: Andrea Griffini | last post by:
I did it. I proposed python as the main language for our next CAD/CAM software because I think that it has all the potential needed for it. I'm not sure yet if the decision will get through, but something I'll need in this case is some experience-based set of rules about how to use python in this context. For example... is defining readonly attributes in classes worth the hassle ? Does duck-typing scale well in complex
114
9909
by: Maurice LING | last post by:
This may be a dumb thing to ask, but besides the penalty for dynamic typing, is there any other real reasons that Python is slower than Java? maurice
30
2804
by: Stuart Turner | last post by:
Hi Everyone, I'm working hard trying to get Python 'accepted' in the organisation I work for. I'm making some good in-roads. One chap sent me the text below on his views of Python. I wondered if anyone from the group could give me some advice on how to respond / if they had been in a similar position. Any help appreciated, Thanks in advance,
86
4119
by: Matthias Kaeppler | last post by:
Hi, sorry for my ignorance, but after reading the Python tutorial on python.org, I'm sort of, well surprised about the lack of OOP capabilities in python. Honestly, I don't even see the point at all of how OO actually works in Python. For one, is there any good reason why I should ever inherit from a class? ^^ There is no functionality to check if a subclass correctly implements an inherited interface and polymorphism seems to be...
0
10916
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10657
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10299
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9436
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7836
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7022
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5872
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4495
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4071
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.