ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
Oh yeah, Perl moved from 4 to 5 more than 10 (15 ?) years ago.
I'm not 100% sure, but it looks like Python 2 -> 3 transition is approximately as Perl 4.5 (there was no Perl 4.5 in reality) to Perl 5 transition.
Well, as I wrote above, Python is finally catching up.
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??
Use programming language you like. Period. Polls about "programming language of the year" are waste of time.
In this topic I join the OP in my inability to understand why Python was called "language of the year".
It was nicely said that "community polls doesn't replace thinking".
Python was called "language of the year" because most people that voted selected this option (for whatever reason). Which in reality doesn't mean anything, especially if you take into account small number of voters.
P.S. "Member choice award" is the only feature on LQ I seriously dislike right now.
One thing that bothers me about python is the move to 3.0, which is NOT backwards compatible.
I consider that a pro for python. The python developers do not hesitate to improve things and make it more future-proof, just because it would break backwards compatibility. They do that in a major release and announce it and document it very well. Why leave out improvements (or even fail to fix historic mistakes) just for the sake of backwards compatibility and drag the burden till the end? Also note that 2.x code will still be runnable for years to come.
Quote:
Originally Posted by H_TeXMeX_H
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.
Other than that? "That" is already quite some benefit IMO!
In this topic I join the OP in my inability to understand why Python was called "language of the year".
I am also trying to show that Python is slowly getting features Perl (for example) already has - for more than 10 years.
As well as, say, much newer Lua, i.e. Lua has the features, Python is on the way.
People compare languages, so the thread has some links to info on them.
well seriously, if i want to compare Python with Perl i can tell you many things which Perl is "inferior" as far as to a human being concerned but that's not my intention. if you can sit and spend even 1 day seriously learning about Python, you can find out the answer yourself on why its "popular" nowadays.
I consider that a pro for python. The python developers do not hesitate to improve things and make it more future-proof, just because it would break backwards compatibility. They do that in a major release and announce it and document it very well. Why leave out improvements (or even fail to fix historic mistakes) just for the sake of backwards compatibility and drag the burden till the end? Also note that 2.x code will still be runnable for years to come.
Well, I realize that once in a while it has to be done, that backwards compatibility has to be broken in order to move ahead. But, I hope they don't do it too often otherwise it'll be a nightmare for devs constantly worrying about having to port python programs to the next version which will not be backwards-compatible. So, I mean, they can do it, but try not to do it too often.
Interestingly, Perl is having almost the opposite problem of Python in terms of backwards compatability. There are some rumblings about legacy features that continue to be supported in Perl and whether they should be phased out. Take a look for example at many of the posts here: http://www.modernperlbooks.com/mt/
well seriously, if i want to compare Python with Perl i can tell you many things which Perl is "inferior" as far as to a human being concerned but that's not my intention. if you can sit and spend even 1 day seriously learning about Python, you can find out the answer yourself on why its "popular" nowadays.
Well, Perl quite well implements "do what I mean" principle.
So, for starters, please translate the following into Python:
Code:
sergei@amdam2:~/junk> cat -n md_array.pl
1 #!/usr/bin/perl -w
2
3 use strict;
4
5 my @array;
6
7 $array[0][1][2] = 123;
8 $array[3][4][5] = 456;
9
10 warn "\$array[0][1][2]=$array[0][1][2]";
11 warn "\$array[3][4][5]=$array[3][4][5]";
12
13 warn "\$array[3][4]=$array[3][4]";
sergei@amdam2:~/junk> ./md_array.pl
$array[0][1][2]=123 at ./md_array.pl line 10.
$array[3][4][5]=456 at ./md_array.pl line 11.
$array[3][4]=ARRAY(0x8194ddc) at ./md_array.pl line 13.
sergei@amdam2:~/junk> cat -n md_hash.pl
1 #!/usr/bin/perl -w
2
3 use strict;
4
5 my %hash;
6
7 $hash{foo}{bar}{doo} = 123;
8 $hash{goo}{dah}{bah} = 456;
9
10 warn "\$hash{foo}{bar}{doo}=$hash{foo}{bar}{doo}";
11 warn "\$hash{goo}{dah}{bah}=$hash{goo}{dah}{bah}";
12
13 warn "\$hash{goo}{dah}=$hash{goo}{dah}";
sergei@amdam2:~/junk> ./md_hash.pl
$hash{foo}{bar}{doo}=123 at ./md_hash.pl line 10.
$hash{goo}{dah}{bah}=456 at ./md_hash.pl line 11.
$hash{goo}{dah}=HASH(0x8194e04) at ./md_hash.pl line 13.
sergei@amdam2:~/junk>
, and then we'll talk about human being concerned.
Yes, it is known python lacks sparse arrays while perl does support them.
Are the python and perl supporters now going to exchange pieces of code that is awkward, ugly, or difficult in the other language in turn? Hope not.
It wasn't only about sparse arrays specifically, it was about presence/absence of references autovivification, and, as a consequence, the need to write extra code.
So, "as far as to a human being concerned", in Python I need to write more code - which doesn't make it a more attractive language for me.
The point is presence/absence of features.
I'm interested to see a feature in Python Perl lacks.
It all depends on what you want to do, some projects require the use of a real programming language, some others can be done using some scripting language. Python is extremely easy to use, let alone to talk about the flexibility of its data structures. Its useless to start a war Perl VS Python or Java vs Python, first cause Java, Python and Perl have something than the other lacks, they have their own advantages. Programming/Scripting Languages are just tools. As a programmer you have to be able to recognize who is good for what, and not to get sticked to a single concept, because that is just in my opinion being stubborn.
It all depends on what you want to do, some projects require the use of a real programming language, some others can be done using some scripting language. Python is extremely easy to use, let alone to talk about the flexibility of its data structures. Its useless to start a war Perl VS Python or Java vs Python, first cause Java, Python and Perl have something than the other lacks, they have their own advantages. Programming/Scripting Languages are just tools. As a programmer you have to be able to recognize who is good for what, and not to get sticked to a single concept, because that is just in my opinion being stubborn.
OK, then what about Lua ? What does Python have Lua lacks ?
I do not write in Lua, I just read about it here and there - seems to be a nice languagse - it has closures and anonymity, as well as an OO model.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.