Joe Schmoe
Posts: 4277
Joined: Sun Jan 15, 2012 1:11 pm

Re: Why Python?

Wed Apr 11, 2012 12:14 pm

First, two comments:

1) This may sound like flame-bait, but that is not my intent.  I really want to know the answers to a couple of key questions.

2) This is entirely for my own benefit - in terms of whether or not it is worth the trouble to take up Python.

Now, my question is: Why are the people in this forum so ga-ga about Python?  Is it (as I suspect) primarily due to the usual two factors:

a) The Foundation people like it - probably having arrived at it as we all do in terms of the programming languages we end up liking, by random walk.

b) Because the fundamental and primary law of computer languages is that programmers like what they know.

Or, am I wrong?  Is there something truly revolutionary and fundamentally great about Python that I am not aware of?

Some more background: I have never written a line of code in Python - don't even know how to write "Hello, world" - but I've looked at some Python code  and looked at the kind of problems that it can be used to solve, and my impression is that it is pretty much the same as Perl or Ruby and probably a few others in that class.  As an aside: Some time ago, a friend of mine was all ga-ga about Ruby and suggested I look into it.  I did, and the first thing I noticed was a lot of propaganda of the "Ruby is the greatest thing since sex itself!" form - telling how wonderful and revolutionary it was and so on.  But the conclusion I quickly reached upon looking it over was "If I want Perl, I know where to find it."

And, in fact, that is pretty much my take on Python at this point.  Couple of other notes: I'm familiar with a couple of applications written in Python - the first is the "youtube-dl.py" program, a very nice tool for downloading from YouTube.  It is non-GUI, and although I admire it, it looks to me like it could have been written in anything - anything that has access to the necessary basic networking operations.

The other is "PySol", which I haven't seen in a while, but is (or at least was) a very nice collection of Solotaire (card) games  written in Python.  The graphics were very nice and I have to admit that (particularly at the time - several years ago), I was very impressed that all that could be done in a scripting language.  Of course, the fact is that somewhere along the way, the rubicon is crossed in terms of what is a "scripting language" and what is a standard 3GL programming language.

Anyway, those are my thoughts.  Feel free to correct any misapprehensions  and/or convince me that Python really is the greatest thing since, well, you know...
And some folks need to stop being fanboys and see the forest behind the trees.

(One of the best lines I've seen on this board lately)

Nr90
Posts: 216
Joined: Sat Nov 26, 2011 12:39 pm

Re: Why Python?

Wed Apr 11, 2012 1:01 pm

Python has been discussed in many topics, try a search.

Regarding your comment that you could"ve made a program in another language; isn"t this true for every program and language out there?

Joe Schmoe
Posts: 4277
Joined: Sun Jan 15, 2012 1:11 pm

Re: Why Python?

Wed Apr 11, 2012 1:06 pm

@NR90: I will send you a PM regarding your points.  I don't think either are relevant to the discussion.
And some folks need to stop being fanboys and see the forest behind the trees.

(One of the best lines I've seen on this board lately)

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23709
Joined: Sat Jul 30, 2011 7:41 pm

Re: Why Python?

Wed Apr 11, 2012 1:16 pm

I suggest Python, but until the Pi came along I had never programmed a single line in it (I'm C and C++). Some code I have written in Python since makes me aware that its pretty easy to use, has a much more sensible syntax than, for example, Perl, and is used more than something like Ruby.

Like any language, it's horses for courses. Python, in my limited experience, appears to cover the bases between learning to program, and programming something serious. It can do both.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

User avatar
scep
Posts: 1062
Joined: Sun Nov 20, 2011 8:53 am

Re: Why Python?

Wed Apr 11, 2012 2:45 pm

Joe Schmoe said:


Now, my question is: Why are the people in this forum so ga-ga about Python?


They aren't. It's discussed a lot around here as it's the official language and the people who discuss it most are ones who like it and are preparing tutorials, learning it etc. But there are also lots of people who don't like it or who think that there there are "better" languages.

You seem to have already made you mind up about Python (without even trying it) and then posted some straw men and accompanying anecdotes to support your feelings, challenging people to prove you wrong. Which I find odd. In the circumstances, my advice would be: don't learn Python

jacklang
Posts: 166
Joined: Thu Aug 04, 2011 10:59 am

Re: Why Python?

Wed Apr 11, 2012 3:33 pm

All languages have some drawbacks for those starting to program. Python seems to fewer than most, and there is good support, libraries and teaching materials available.

It can be compiled or directly interpreted

The usual objection to Python is the use of whitespace as syntax - indenting blocks is compulsory, but that is good discipline.

Of course many languages run on the RPi, and are only an apt-get away.

antiloquax
Posts: 406
Joined: Sun Nov 20, 2011 11:37 am
Contact: Website

Re: Why Python?

Wed Apr 11, 2012 4:39 pm

I think that the foundation "chose" Python for several reasons:

1. It's known to be quite easy to learn.

2. It's popular (winning many Linux user magazines' "best programming language award" regularly).

3. You can do OOP in Python, but you don't have to.

4. Many Computer Science Undergrad Courses get their students to learn Python, followed by Java (and remember the Foundation's initial goal was to improve the number and preparedness of applicants to CSc degrees at Cambridge Uni.)

I'd echo what others have said - there are plenty of other languages around that Pi users will no doubt learn (Ruby, Lua, C++, Java and QT will all be popular I'd guess - and maybe even BBC Basic!).

You can take Python or leave it!

I don't have a lot of experience with programming, but I like Python. I'd like to learn some others too, but there's only so much I can take in at one time, so I am happy to focus on Python (with occasional forays int Java, which I really like too!).

User avatar
scep
Posts: 1062
Joined: Sun Nov 20, 2011 8:53 am

Re: Why Python?

Wed Apr 11, 2012 4:41 pm

jacklang said:


It can be compiled or directly interpreted


The interpretated bit is hugely useful for schools where the system is often locked down so you can't run executables.

Feedback I have from young people starting to program is that they like the clear syntax compared to e.g. the C family of languages.

User avatar
rurwin
Forum Moderator
Forum Moderator
Posts: 4258
Joined: Mon Jan 09, 2012 3:16 pm
Contact: Website

Re: Why Python?

Wed Apr 11, 2012 7:44 pm

Joe Schmoe said:


b) Because the fundamental and primary law of computer languages is that programmers like what they know.


When I decided I wanted a programming language for my spare time I looked at a few of the others on offer, and I chose to learn Python. Its syntax is clear, its semantics are uncluttered, it is cross-platform, it has rich built-in types and its standard library is insanely powerful.

Its sole disadvantage is that, being interpreted, it can't be mixed with other languages easily.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23709
Joined: Sat Jul 30, 2011 7:41 pm

Re: Why Python?

Wed Apr 11, 2012 8:14 pm

In my albeit very limited experience, C interfacing didn't seem that difficult.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

Return to “Python”