aspose file tools*
The moose likes Jython/Python and the fly likes why python ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Languages » Jython/Python
Bookmark "why python ?" Watch "why python ?" New topic
Author

why python ?

Hussein Baghdadi
clojure forum advocate
Bartender

Joined: Nov 08, 2003
Posts: 3476

Hi folks.
I have some questions about python.
I want to learn a scripting language and I am thinking about python or perl.
but as I know perl is not a clear language (or less well designed than as Eric Raymond said).
my questions are :
what are the capabilities of python ?
I mean, using java, I can write swing application or servlets or ejb or jdbc application or ........
what I can do with python ? what is the real usage of python ?
if you have any suggestions like : learn language X or ..... please let me know.
thanks.
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Originally posted by John Todd:
what are the capabilities of python ?
I mean, using java, I can write swing application or servlets or ejb or jdbc application or ...

You can't write a Swing application, nor servlets, nor EJBs, nor JDBC code with Python but you can write GUI applications, web applications, and database applications with Python.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Hussein Baghdadi
clojure forum advocate
Bartender

Joined: Nov 08, 2003
Posts: 3476

any suggestion like don't go by python learn perl or learn ......
Adrian Yan
Ranch Hand

Joined: Oct 02, 2000
Posts: 688
Perl 6 is supposely coming out with much better clean-room implementation. Python is a good scripting language. It really comes down to what you want to do. You can learn Tcl/Tk, Ruby.
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
Perl is a prime example of what happens when open source people go overboard to want to please everyone by adding everyone's pet features without any regard.
It's so large, so cumbersome and so convoluted that it's gotten to be completely useless.

Python is nice and small yet powerful. Same for Ruby.
I am slowly learning a bit of Python to get away from being too focussed on Java, choosing Python over Ruby because there are more books for it (that's indeed the reason, I went to the computer bookstore and they didn't have a Ruby book I liked but several good Python books so I got those).


42
Tim West
Ranch Hand

Joined: Mar 15, 2004
Posts: 539
Perl is indeed overblown. See this if you're not convinced

I'm gonna go Python myself.


--Tim
Karthik Guru
Ranch Hand

Joined: Mar 06, 2001
Posts: 1209
Originally posted by Lasse Koskela:

You can't write a Swing application, nor servlets, nor EJBs, nor JDBC code with Python


But Lasse does'nt jython allow us to write all of this?
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
Originally posted by karthik Guru:


But Lasse does'nt jython allow us to write all of this?


yes it does, by allowing the use of Java classes inside Python code much as cPython allows the use of GTK.

Problem is that jython is not very active, development lags several years behind Python.
Arjun Shastry
Ranch Hand

Joined: Mar 13, 2003
Posts: 1871
AFAIK Google search engine mainly consists of Python programs,right?Python is supposed to be powerul than Java interms of performance?I am not sure.


MH
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
Google indeed uses a lot of Python.
As to performance, I doubt it's faster.
The architectures of the runtimes are rather similar, but Python is untyped which may make it marginally slower as types need to be resolved runtime rather than compiletime.

Google also recently hired one of the core architects of Java itself, Joshua Bloch, away from Sun hinting that they may be thinking of moving (part of) their systems to Java.
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Originally posted by Arjun Shastry:
AFAIK Google search engine mainly consists of Python programs,right?
As far as I know, the actual search engine is implemented in C or C++ and Python is used to glue things together. Then again, this is just hear-say and I'd love to get some reliable information "from the source"...
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Originally posted by Jeroen Wenting:
Google also recently hired one of the core architects of Java itself, Joshua Bloch, away from Sun hinting that they may be thinking of moving (part of) their systems to Java.

And they're hiring more...
Jessica Sant
Sheriff

Joined: Oct 17, 2001
Posts: 4313

From what I understand, Python is 10x easier to learn than Perl. I took an Intro to Artificial Intelligence class and we did the whole thing in Python. He said in previous versions of the class when he'd had the students use perl, he couldn't give the first assignment til week 4, whereas with python, he could give us something to code the first week.

If you're interested in a few interesting programs you can code, check out the course website: http://plan.cs.drexel.edu/courses/intro-ai03/

I found it pretty easy to use, for loops are much simpler, and text manipulation is real quick. It took a while to get used to having code indenting MEAN something, but overall I liked it.


- Jess
Blog:KnitClimbJava | Twitter: jsant | Ravelry: wingedsheep
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Originally posted by Lasse Koskela:
As far as I know, the actual search engine is implemented in C or C++ and Python is used to glue things together. Then again, this is just hear-say and I'd love to get some reliable information "from the source"...

I just exchanged a couple of emails with someone who works for Google and he confirmed that they are indeed using C/C++ for performance critical components, Python for glueing things together, and Java for some front-ends like Google ads. Orkut is their first .NET experiment.
Derek Grey
Ranch Hand

Joined: Feb 09, 2002
Posts: 204
What about PHP 5?

Isn't that a better and easier option to learn than Python? ... and I think it is capable of doing all the things that Lasse pointed out with Python.
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Originally posted by San Tiruvan:
What about PHP 5?

Isn't that a better and easier option to learn than Python? ... and I think it is capable of doing all the things that Lasse pointed out with Python.

PHP 5 could be easier to learn than Python, but I doubt it. Apparently PHP has got classes these days (can you tell I haven't written a line of PHP code since PHP3?) and I'm sure that's not the only enhancement they've done so it might be just as "complex" as Python, for example, in terms of concepts one must understand.

Besides, PHP is still very much web application-oriented so you can't really write a desktop application with PHP -- something you can easily do with Python, Ruby, Java, Groovy, etc.
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24168
    
  30

Originally posted by Lasse Koskela:

Besides, PHP is still very much web application-oriented so you can't really write a desktop application with PHP -- something you can easily do with Python, Ruby, Java, Groovy, etc.


Are you sure about that? I'm pretty sure I remember reading something to the contrary.


[Jess in Action][AskingGoodQuestions]
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Originally posted by Ernest Friedman-Hill:
Are you sure about that? I'm pretty sure I remember reading something to the contrary.
Umm. Not really, but I did check out php.net before posting that and I couldn't find much evidence on the contrary. The front page says "PHP is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML" and the manual has only one module related to GUI development. I admit that you can do all sorts of file processing with PHP and that can indeed count as "non-webapp development"...
Marcus Green
arch rival
Rancher

Joined: Sep 14, 1999
Posts: 2813
I have done reasonably serious programming in

Java (of course)
Perl
PHP4

Of those I found Perl to be the least pleasant by a very, very wide margin.Possibly to the point the wild staring eyes and saying some very very unpleasent things about its creator Larry Wall.

PHP4 seems to have much of the class support I use in Java. Thus if you were to look at my code you would see the use of the new keyword with objects being passed around and the use of get/set methods. PHP5 extends on this with more features that would be familiar to a Java programmer.

I have never written a line of Python in my life but I have read endless very nice things about it. You might be able to find out about a fairly complex Python project by searching on chandler and python.

Marcus


SCWCD: Online Course, 50,000+ words and 200+ questions
http://www.examulator.com/moodle/course/view.php?id=5&topic=all
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: why python ?
 
Similar Threads
Jython?
Ruby vs other scripting languages
where will jython fit !
Is python threat for Java
which scripting language to learn?