LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-13-2009, 04:41 AM   #1
nesrail
Member
 
Registered: Jan 2009
Distribution: Differs
Posts: 121

Rep: Reputation: 15
Why Python???


I just saw that Python is "the programming language of the year".
I study Java (for 2 weeks now) at my school and I think its good enough.
What makes python so good and popular?? Can it do all the thinks Java and C++ can??
 
Old 02-13-2009, 04:46 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
java and python are worlds apart and really for different things. Java is a programming language running a JIT compiler within it's own virtual machine, whilst python is a scripting language. Different languages suit different applications, it's not like there is one day going to be a vote for the "best" language to use and everyone uses it.
 
Old 02-13-2009, 05:10 AM   #3
nesrail
Member
 
Registered: Jan 2009
Distribution: Differs
Posts: 121

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by acid_kewpie View Post
java and python are worlds apart and really for different things. Java is a programming language running a JIT compiler within it's own virtual machine, whilst python is a scripting language. Different languages suit different applications, it's not like there is one day going to be a vote for the "best" language to use and everyone uses it.
I don't want to sound stupid(but probably will), what does it mean "a scripting language"??
 
Old 02-13-2009, 05:16 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
Well TBH, the differences can get a bit vague the way many scripting languages get used for outright app development, but a basic difference is discussed here http://www-xray.ast.cam.ac.uk/~jss/l...t/programming/

So much of it comes down to style and user preference. Java takes a lot of setting up for a simple hello world, whilst python can do it in a single line. So languages like python, perl and ruby are often nice and simple to prototype tools, especially those interacting with other programs / processes. There has been much more of a buzz around ruby / rails recently than python though...

Last edited by acid_kewpie; 02-13-2009 at 05:27 AM.
 
Old 02-13-2009, 05:25 AM   #5
JulianTosh
Member
 
Registered: Sep 2007
Location: Las Vegas, NV
Distribution: Fedora / CentOS
Posts: 674
Blog Entries: 3

Rep: Reputation: 90
generally speaking, a scripted language gets compiled to pseudo-code which is measurably slower than machine code (as generated by compiling C code). Scripting languages relatively high-level and usually best fited for administrative tasks because they can be written quickly and can be easy to read.
 
Old 02-13-2009, 05:30 AM   #6
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
I guess in a more hacker friendly environment, scripting languages are much more approachable and easier to modify and mess about with. Simpler to install for testing and the likes. Change a line, run it. Add a function, run it. much quicker than having to compile code all the time.
 
Old 02-13-2009, 05:36 AM   #7
JulianTosh
Member
 
Registered: Sep 2007
Location: Las Vegas, NV
Distribution: Fedora / CentOS
Posts: 674
Blog Entries: 3

Rep: Reputation: 90
yea! scripting languages are much more approachable... but just a little clarification... compilation still happens, it's just obfuscated from the user's point of view.
 
Old 02-13-2009, 05:42 AM   #8
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
of course. There was a serious thread on here the other day, asking why linux isn't completely ported to perl or ruby...
 
Old 02-13-2009, 05:51 AM   #9
nesrail
Member
 
Registered: Jan 2009
Distribution: Differs
Posts: 121

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by acid_kewpie View Post
of course. There was a serious thread on here the other day, asking why linux isn't completely ported to perl or ruby...
Now I'm asking. Why is Linux not ported to Python?
 
Old 02-13-2009, 05:59 AM   #10
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
I really do not understand hype around Python.

To me, after Perl, it's a language with missing features and a slowly catching up one - I see only recent Python version implement new language features which have been present in Perl for more than 10 years.

For example, here is an article on anonymous functions: http://en.wikipedia.org/wiki/Anonymous_function - just compare Perl and Python implementations.

For me Python looks like a language for those who failed to grasp the power and extent of, say, Perl.
 
Old 02-13-2009, 06:21 AM   #11
ghostdog74
Senior Member
 
Registered: Aug 2006
Posts: 2,697
Blog Entries: 5

Rep: Reputation: 244Reputation: 244Reputation: 244
please not again. Hype or no hype, one must really use and understand in depth the usage of these languages and really decide for oneself why its like that. Do not start to compare when one have insufficient knowledge of one or the other.
 
Old 02-13-2009, 06:34 AM   #12
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by ghostdog74 View Post
please not again. Hype or no hype, one must really use and understand in depth the usage of these languages and really decide for oneself why its like that. Do not start to compare when one have insufficient knowledge of one or the other.
Is the article in Wiki (link in post above) wrong ?

Is this wrong:

http://scipy.org/BaseArray :

Quote:
BaseArray was a proposed base multidimensional array type, ready-to-include in the Python core sometime in the future.
?

I mean, Perl has multidimensional arrays for ages (for more than 10 years), as well as "C" does.

Enlighten us, please.

As I have written many times, I used to work with a really nice guy who tried to convert my to Python in year 2000. There was really no incentive - Python offered me less than Perl at the time.

Maybe I'll start a separate thread on data export/import - from what I read/see around Python is behind Perl also in this area.
 
Old 02-13-2009, 06:49 AM   #13
ghostdog74
Senior Member
 
Registered: Aug 2006
Posts: 2,697
Blog Entries: 5

Rep: Reputation: 244Reputation: 244Reputation: 244
Quote:
Originally Posted by nesrail View Post
I just saw that Python is "the programming language of the year".
I study Java (for 2 weeks now) at my school and I think its good enough.
What makes python so good and popular?? Can it do all the thinks Java and C++ can??
the only relevant answer to this. Learn about Python for 2 weeks, and judge for yourself. For references to Java vs Python, google is your friend.
 
Old 02-13-2009, 08:27 AM   #14
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
One thing that bothers me about python is the move to 3.0, which is NOT backwards compatible. That really made me think twice before recommending python to anyone. It's true that it's a good language to learn programming with, and I think it's a very readable language much like ruby, it's almost as if you can speak it like a natural language. But, other than that, not too much benefit over Perl.

P.S. Java sucks !
 
Old 02-13-2009, 08:55 AM   #15
ghostdog74
Senior Member
 
Registered: Aug 2006
Posts: 2,697
Blog Entries: 5

Rep: Reputation: 244Reputation: 244Reputation: 244
Quote:
Originally Posted by H_TeXMeX_H View Post
One thing that bothers me about python is the move to 3.0, which is NOT backwards compatible.
they have reasons for this move. If you find in the internet, there are many discussions on this. What i see is, Python 2.x is still pretty much relevant in the long term. Most of the real world problems can be solved without using Python 3. If an environment doesn't yet have Python 3 and is considering using it and if one doesn't foresee using it to run older Python code, then one might go for it. Otherwise, sticking with Python 2.x is still alright.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Review: Programming in Python 3: A Complete Introduction to the Python Language LXer Syndicated Linux News 0 01-26-2009 04:50 AM
python update - Unable to load GTK2 Python bindings: No module named gtk itpedersen Linux - Software 2 10-03-2008 03:44 AM
LXer: Charming Python: Python elegance and warts, Part 2 LXer Syndicated Linux News 0 08-31-2007 08:40 AM
LXer: Move to python 2.4 / Changing the packaging style for python packages LXer Syndicated Linux News 0 06-13-2006 07:54 PM
python problem - compiled from source - python -V still showing old version txm123 Linux - Newbie 1 02-15-2006 11:05 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:24 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration