
I am looking for some thoughts/opinions on the merits of these two languages. Over the years I book a few books on Java including Java in Nutshell Java Foundation Class Java for Scientist and Engineers The latter being the most useful to me. However, I've never really got the hang of how it all works. I don't have a formal programming background In recent times, I've come across Python and lately stumbled upon SciPy,ipython, NumPy and matplotlib.sourceforge.net. I've also noticed that Python has PyQt that enables you to use the Qt and poss KDE for widgets and gui interface. KDE is the desktop of choice for me and QT Designer are all "sudo apt-get install " away. Both Python and Java are cross platform which a plus. What I would like to do is put together small applications often using complex numbers and array for the engineering work that I do. Sometimes importing csv text files containing data from measurment devices. I have always thought Java was the tool for this but lately, I've noticed how easy it is to make things work with Python. especially the interactive "try a line of code, did it do what you wanted?, no, try this, ah, that works" I'm thinking that Python might provide the fast feed back approach that gets you enthused about actually coding than the steper learning curve of a more comprehensive language and not actually knowing where to start with a gui or even just how to get the IDE to use the classpath you want. I'd be interested if people had thoughts or comments on the merits. Cheers

Hi Chris. I would be interested in discussing this at length. I've tended to specialise in Java and like yourself, have a passion for mathematics. Perhaps we should get together sometime - perhaps over a beer or coffee or something similar? I also have a close friend who is a maths wiz and has used Java extensively who may also be interested in the discussion. J On Dec 5, 2007 11:02 AM, Chris O'Halloran <cmoman(a)gmail.com> wrote:
I am looking for some thoughts/opinions on the merits of these two languages.
Over the years I book a few books on Java including Java in Nutshell Java Foundation Class Java for Scientist and Engineers
The latter being the most useful to me. However, I've never really got the hang of how it all works. I don't have a formal programming background
In recent times, I've come across Python and lately stumbled upon SciPy,ipython, NumPy and matplotlib.sourceforge.net. I've also noticed that Python has PyQt that enables you to use the Qt and poss KDE for widgets and gui interface. KDE is the desktop of choice for me and QT Designer are all "sudo apt-get install " away.
Both Python and Java are cross platform which a plus.
What I would like to do is put together small applications often using complex numbers and array for the engineering work that I do. Sometimes importing csv text files containing data from measurment devices.
I have always thought Java was the tool for this but lately, I've noticed how easy it is to make things work with Python. especially the interactive "try a line of code, did it do what you wanted?, no, try this, ah, that works"
I'm thinking that Python might provide the fast feed back approach that gets you enthused about actually coding than the steper learning curve of a more comprehensive language and not actually knowing where to start with a gui or even just how to get the IDE to use the classpath you want.
I'd be interested if people had thoughts or comments on the merits.
Cheers _______________________________________________ wlug mailing list | wlug(a)list.waikato.ac.nz Unsubscribe: http://list.waikato.ac.nz/mailman/listinfo/wlug
-- James Pluck PalmOS Ergo Sum "Dear IRS: I would like to cancel my subscription. Please remove my name from your mailing list..."

Hi Chris, Python is more of a scripting language, i.e. if you want to get something done quickly. It is not meant to do large scale projects. As an example, it is not strongly typed so the same variable can hold strings, ints, chars etc. This might look cool at the beginning but once the program size gets larger it becomes too difficult to debug/maintain. Also, if there are more than one developers than unless your Python program is documented well, it will be difficult for a third person to easily follow what you have done. Now lets come to your application. Both languages can easily handle complex numbers but what is the scale of your computation? If you want to multiply two large matrices then none are suitable (go for C/C++) but for small application both are fine. Both languages are good for handling small amounts of texts but struggle when you have a few hundred thousand lines of text. What are your integration requirements? Where do you want to deploy your application? Python is easy to learn. Since the concepts are quite similar, may be you want to develop your application in Python and then port it to Java depending upon the requirements. Hope this helps. Cheers, Usama Chris O'Halloran wrote:
I am looking for some thoughts/opinions on the merits of these two languages.
Over the years I book a few books on Java including Java in Nutshell Java Foundation Class Java for Scientist and Engineers
The latter being the most useful to me. However, I've never really got the hang of how it all works. I don't have a formal programming background
In recent times, I've come across Python and lately stumbled upon SciPy,ipython, NumPy and matplotlib.sourceforge.net. I've also noticed that Python has PyQt that enables you to use the Qt and poss KDE for widgets and gui interface. KDE is the desktop of choice for me and QT Designer are all "sudo apt-get install " away.
Both Python and Java are cross platform which a plus.
What I would like to do is put together small applications often using complex numbers and array for the engineering work that I do. Sometimes importing csv text files containing data from measurment devices.
I have always thought Java was the tool for this but lately, I've noticed how easy it is to make things work with Python. especially the interactive "try a line of code, did it do what you wanted?, no, try this, ah, that works"
I'm thinking that Python might provide the fast feed back approach that gets you enthused about actually coding than the steper learning curve of a more comprehensive language and not actually knowing where to start with a gui or even just how to get the IDE to use the classpath you want.
I'd be interested if people had thoughts or comments on the merits.
Cheers _______________________________________________ wlug mailing list | wlug(a)list.waikato.ac.nz Unsubscribe: http://list.waikato.ac.nz/mailman/listinfo/wlug

On Wed, 2007-12-05 at 11:56 +1300, Usama Malik wrote:
Python is easy to learn. Since the concepts are quite similar, may be you want to develop your application in Python and then port it to Java depending upon the requirements.
Alternatively, you may want to prototype your application in Python, then compile it in Cython (most pure-python programs compile and work just fine in cython with few or no mods) and incrementally transition it to use static types. Cython makes it very easy to evolve a program in small manageable steps from quick'n'dirty hacked-up dynamic python script into something formal, robust and maintainable that runs almost as fast as native C[++]. I'm doing just that right now with a project, and it's working out great. The options offered by Cython make for a sublime, relatively painfree and highly satisfying programming experience. Definitely worth a try. Cheers David

I'm currently working on a scientific project with a client-server architecture, which includes clients in Java and Python at the moment (server-side is Java). The motivation behind those two languages were, that they're both cross-platform. Python was also chosen, due to the popularity of NumPy and SciPy in the scientific community. A note before I start to rant: I'm still relatively new to Python, but with experience in other OO languages for 10+ years. Yes, the most appealing thing about Python is, that it is really easy to hack something together that works. The development time in Java (especially thinking of the pain in the ... that Swing is) is definitely longer. But, having no compiler that checks for syntactic errors, you just end up with really old bugs further down the road that you just never came across. Code coverage is a real problem here and unit tests can only test a certain amount of your code as well. Also, multi-threading seems to be more mature in Java, where it is an integral part of the language. It may not be a perfect implementation, but at least it seems easier to me (forget about acquiring locks and releasing them, ending in potential dead-locks, etc.). Java on the other hand doesn't come with any scientific libraries bundled. Though COLT (http://dsd.lbl.gov/~hoschek/colt/) or the simple JAMA (http://math.nist.gov/javanumerics/jama/) can help there. Coming from strongly-typed languages (http://en.wikipedia.org/wiki/Strongly-typed_programming_language) like Pascal and Java, I really don't like this uncertainty about parameter types (which disallows the overloading of methods, of course). It makes it really hard, what types are expected. If the documentation is not good, well, have fun trying things! As a closing remark: I quite like certain aspects of Python, but there are also others that I hate. Cheers, Peter -- Peter Reutemann, Dept. of Computer Science, University of Waikato, NZ http://www.cs.waikato.ac.nz/~fracpete/ +64 (7) 838-4466 Ext. 5174

Yes, the most appealing thing about Python is, that it is really easy to hack something together that works. The development time in Java (especially thinking of the pain in the ... that Swing is) is definitely longer. But, having no compiler that checks for syntactic errors, you just end up with really old bugs further down the road that you just never came across. Code coverage is a real problem here and unit tests can only test a certain amount of your code as well.
As a follow-up... The PyDev Eclipse plugin (http://pydev.sourceforge.net/) in conjunction with Pylint (static checker, http://www.logilab.org/projects/pylint) helps keeping the code relatively bug-free. And if you're already using Eclipse for Java projects, it makes it even easier, since you don't have to switch IDEs. Cheers, Peter -- Peter Reutemann, Dept. of Computer Science, University of Waikato, NZ http://www.cs.waikato.ac.nz/~fracpete/ Ph. +64 (7) 858-5174

Quoting Chris O'Halloran <cmoman(a)gmail.com>:
I am looking for some thoughts/opinions on the merits of these two languages.
I can't really comment having only seriously programmed in Java (I've dabbled with Python) and for the last couple of years I've exclusively used Perl. However, I've "heard good things" about jython. Potentially the best of both worlds? Program in python with access to the extensive Java libraries. http://www.jython.org/ http://jnumerical.sourceforge.net/ Also, I quick google turned up this: http://www.ferg.org/projects/python_java_side-by-side.html Cheers, Trev

I am looking for some thoughts/opinions on the merits of these two languages.
I can't really comment having only seriously programmed in Java (I've dabbled with Python) and for the last couple of years I've exclusively used Perl. However, I've "heard good things" about jython. Potentially the best of both worlds? Program in python with access to the extensive Java libraries.
I had a go at Jython as well once. Since Jython is a complete re-write of CPython (what you normally use as python) in Java, you can't use any other libraries than the ones Jython provides. No SciPy or NumPy... And JNumeric(al) seems to be dead (and broken) since 2002... Cheers, Peter -- Peter Reutemann, Dept. of Computer Science, University of Waikato, NZ http://www.cs.waikato.ac.nz/~fracpete/ +64 (7) 838-4466 Ext. 5174

Chris O'Halloran wrote:
I am looking for some thoughts/opinions on the merits of these two languages.
Over the years I book a few books on Java including Java in Nutshell Java Foundation Class Java for Scientist and Engineers
The latter being the most useful to me. However, I've never really got the hang of how it all works. I don't have a formal programming background
In recent times, I've come across Python and lately stumbled upon SciPy,ipython, NumPy and matplotlib.sourceforge.net. I've also noticed that Python has PyQt that enables you to use the Qt and poss KDE for widgets and gui interface. KDE is the desktop of choice for me and QT Designer are all "sudo apt-get install " away.
Both Python and Java are cross platform which a plus.
What I would like to do is put together small applications often using complex numbers and array for the engineering work that I do. Sometimes importing csv text files containing data from measurment devices.
I have always thought Java was the tool for this but lately, I've noticed how easy it is to make things work with Python. especially the interactive "try a line of code, did it do what you wanted?, no, try this, ah, that works"
I'm thinking that Python might provide the fast feed back approach that gets you enthused about actually coding than the steper learning curve of a more comprehensive language and not actually knowing where to start with a gui or even just how to get the IDE to use the classpath you want.
I'd be interested if people had thoughts or comments on the merits.
Hi Chris, Are the applications you are writing for just you to use or are they for others too? The reason I ask is that if they are just for you then it would probably be far less effort to use a higher level language/system like Octave or Maxima. However those don't lend themselves easily to creating a gui. If you really need a gui then you will probably end up spending the majority of your programming time wrestling with it rather than getting the answers you need. For a cross platform gui FLTK might also meet your needs, it is pretty easy to learn and has a Python wrapper, but I've only used it in C++ so I can't comment on how easy that is. Glenn -- Glenn Ramsey <glenn(a)componic.co.nz> 07 8627077 http://www.componic.co.nz

Having been a Java (and more recently C#) coder with a degree in Computer Science I think you will be happier and more productive with Python. I don't use Python myself but your need for quick and dirty prototyping and fast code to test turn around are the key points in Python's favour. Regards Chris O'Halloran wrote:
I am looking for some thoughts/opinions on the merits of these two languages.
Over the years I book a few books on Java including Java in Nutshell Java Foundation Class Java for Scientist and Engineers
The latter being the most useful to me. However, I've never really got the hang of how it all works. I don't have a formal programming background
In recent times, I've come across Python and lately stumbled upon SciPy,ipython, NumPy and matplotlib.sourceforge.net. I've also noticed that Python has PyQt that enables you to use the Qt and poss KDE for widgets and gui interface. KDE is the desktop of choice for me and QT Designer are all "sudo apt-get install " away.
Both Python and Java are cross platform which a plus.
What I would like to do is put together small applications often using complex numbers and array for the engineering work that I do. Sometimes importing csv text files containing data from measurment devices.
I have always thought Java was the tool for this but lately, I've noticed how easy it is to make things work with Python. especially the interactive "try a line of code, did it do what you wanted?, no, try this, ah, that works"
I'm thinking that Python might provide the fast feed back approach that gets you enthused about actually coding than the steper learning curve of a more comprehensive language and not actually knowing where to start with a gui or even just how to get the IDE to use the classpath you want.
I'd be interested if people had thoughts or comments on the merits.
Cheers _______________________________________________ wlug mailing list | wlug(a)list.waikato.ac.nz Unsubscribe: http://list.waikato.ac.nz/mailman/listinfo/wlug

Thanks a lot for your feedback. I really appreciate the comments back. The more I delve into Python, the more resources I keep finding on the web. There are libraries, videos on setting stuff up. books on the net about python and qt. I think Python might be quite good for what I am looking to do. Not huge number crunching exercises but arrays doing some vector calculations and plotting and maybe a gui if/when it come times to make is useable for colleagues. Thanks all for the feedback. Cheers Chris On Wednesday 05 December 2007 13:03:29 Oliver Jones wrote:
Having been a Java (and more recently C#) coder with a degree in Computer Science I think you will be happier and more productive with Python. I don't use Python myself but your need for quick and dirty prototyping and fast code to test turn around are the key points in Python's favour.
Regards
Chris O'Halloran wrote:
I am looking for some thoughts/opinions on the merits of these two languages.
Over the years I book a few books on Java including Java in Nutshell Java Foundation Class Java for Scientist and Engineers
The latter being the most useful to me. However, I've never really got the hang of how it all works. I don't have a formal programming background
In recent times, I've come across Python and lately stumbled upon SciPy,ipython, NumPy and matplotlib.sourceforge.net. I've also noticed that Python has PyQt that enables you to use the Qt and poss KDE for widgets and gui interface. KDE is the desktop of choice for me and QT Designer are all "sudo apt-get install " away.
Both Python and Java are cross platform which a plus.
What I would like to do is put together small applications often using complex numbers and array for the engineering work that I do. Sometimes importing csv text files containing data from measurment devices.
I have always thought Java was the tool for this but lately, I've noticed how easy it is to make things work with Python. especially the interactive "try a line of code, did it do what you wanted?, no, try this, ah, that works"
I'm thinking that Python might provide the fast feed back approach that gets you enthused about actually coding than the steper learning curve of a more comprehensive language and not actually knowing where to start with a gui or even just how to get the IDE to use the classpath you want.
I'd be interested if people had thoughts or comments on the merits.
Cheers _______________________________________________ wlug mailing list | wlug(a)list.waikato.ac.nz Unsubscribe: http://list.waikato.ac.nz/mailman/listinfo/wlug
_______________________________________________ wlug mailing list | wlug(a)list.waikato.ac.nz Unsubscribe: http://list.waikato.ac.nz/mailman/listinfo/wlug

Chris O'Halloran wrote:
Thanks a lot for your feedback. I really appreciate the comments back.
The more I delve into Python, the more resources I keep finding on the web. There are libraries, videos on setting stuff up. books on the net about python and qt.
I think Python might be quite good for what I am looking to do. Not huge number crunching exercises but arrays doing some vector calculations and plotting and maybe a gui if/when it come times to make is useable for colleagues.
Thanks all for the feedback.
Cheers Chris
http://xkcd.com/353/ -- Glenn Ramsey <glenn(a)componic.co.nz> 07 8627077 http://www.componic.co.nz
participants (9)
-
Chris O'Halloran
-
David McNab
-
Glenn Ramsey
-
James Pluck
-
Oliver Jones
-
Peter Reutemann
-
Peter Reutemann
-
trev@trev.co.nz
-
Usama Malik