Why learn Python ??

M

Miklós

As for AI, I would choose Prolog any time over Lisp. ;) I know either one
really but I had more fun with Prolog than with Lisp when playing with them.
You know the AI people are divided into two groups: 'the fuzzy' and 'the
tidy'. (Dunno these are the orginal phrases in English..)
The former ones are people of practice and little theory, the latter ones
are people of theory and more theory which works in practice. ;)
The former ones like Lisp and the latter ones use Prolog.
Lisp is prefered in the USA, Prolog is preferred in Europe and Japan.

Anyway, my point is that Python is very neat for doing AI:
http://www.cs.berkeley.edu/~russell/aima.html

This is the best AI textbook I've seen so far and their textbook code is
being put into Python...
Help them out.. ;)

Best,
Miklós
 
B

Bicho Verde

I have now free time and money to do what I want :)
I have some basic skills in programming (C, Pascal, Macromedia
Actionscript) but don't know exactly what to do in the world of programming.
And also I don't know exactly why would I learn Python rather than C#,
C++ or Perl. Basicaly I don't know where to start, if there is much to do or
if it is has it seems and there is software to everything nowadays and so
doesn't make sense to spend time in learning a programming language.
I just have this idea that I would like to contribute to the curve of
accelarated exponential progress (technological singularity), artificial
intelligence and so on. From that point of view there is much to do... But
can I stand for it and where to start?
Anyone would help me and give me some hints?

-BichoVerde
 
P

Paul Rubin

Bicho Verde said:
And also I don't know exactly why would I learn Python rather than C#,
C++ or Perl. Basicaly I don't know where to start, if there is much to do or
if it is has it seems and there is software to everything nowadays and so
doesn't make sense to spend time in learning a programming language.

I'd say don't bother with C++ unless you're working on a big
multi-person project. Its design will make no sense to you unless
you've faced the problems that come up in those projects. Otherwise
it's a big mess.

Perl has its fans and I can't promise you won't be one. It's built
like a natural (spoken) language, that is, it wasn't designed, it just
sort of evolved, and has all kinds of specialized rules and exceptions
and multiple ways of doing the same thing. Some people think that's
great. Others (most Python fans) think Perl is a big mess. The book
"Learning Perl" by Schwartz and Christiensen is definitely very good,
so you might look at it to decide if you like Perl. But note that the
book only scratches the surface, and Perl gets messier the deeper you go.

C# is mostly Microsoft-specific and not much serious is done with it, IMO.
I just have this idea that I would like to contribute to the curve of
accelarated exponential progress (technological singularity), artificial
intelligence and so on. From that point of view there is much to do... But
can I stand for it and where to start?
Anyone would help me and give me some hints?

Traditionally that kind of research has been done in Lisp. You could
look at Winston and Horn's book on Lisp, which is also a reasonably
good introduction to AI methods.
 
D

Derek

Bicho Verde said:
I have now free time and money to do what I want :)

I have some basic skills in programming (C, Pascal,
Macromedia Actionscript) but don't know exactly what to do
in the world of programming.

And also I don't know exactly why would I learn Python
rather than C#, C++ or Perl. Basicaly I don't know where
to start, if there is much to do or if it is has it seems
and there is software to everything nowadays and so
doesn't make sense to spend time in learning a programming
language.

I just have this idea that I would like to contribute
to the curve of accelarated exponential progress
(technological singularity), artificial intelligence and so
on. From that point of view there is much to do... But can
I stand for it and where to start?

Anyone would help me and give me some hints?

I agree in large part with Paul's comments.

C# is Microsoft's baby though it's technically an open standard --
don't go there unless you have a reason.

Perl is pretty cool but I definitely found it harder to use and less
intuitive than Python.

I would not dismiss C++ (or even vanilla C) outright. I strongly
suggest starting in Python and looking to C and C++ when you have good
reason -- that is, when those languages will let you do something that
Python is less than than stellar at: large applications, system
software, performance-critical applications, embedded programming,
etc.

I would also add that while Lisp has been a favorite in the AI
community, you will find that most AI techniques generalize to most
any programming language. I spent a good deal of time in grad school
and on my first job doing AI programming in C++. The only time I used
Lisp was in introductory classes, mostly to write elegant -- but
toy -- programs.
 
D

Derek

I guess I didn't really answer the main question: Why learn Python
over Perl, C/C++, C#, etc.

In short, because it's easier to program, isn't tied to a platform,
and has lots of high-level functionality right out of the box.
 
J

Jacek Generowicz

Derek said:
I would also add that while Lisp has been a favorite in the AI
community, you will find that most AI techniques generalize to most
any programming language. I spent a good deal of time in grad school
and on my first job doing AI programming in C++. The only time I used
Lisp was in introductory classes, mostly to write elegant -- but
toy -- programs.

Lest Derek give the impression that Lisp is in any way a "toy"
language, or that it somehow sacrifices practicality for elegance, I
feel honour bound to point out that it is actually the most powerful
and expressive programming language known to man, and excells in
solving problems which are often considered too hard to be solved in
other languages.

If you want to perform miracles, then learn Lisp. If you
merely want to write programs that rock, then learn Python.

:)

If, however, masochism is more you bent, then I thoroughly recommend C++.

--
Greenspun's Tenth Rule of Programming:

Greenspun's Tenth Rule of Programming: "Any sufficiently complicated
C or Fortran program contains an ad-hoc, informally-specified,
bug-ridden, slow implementation of half of Common Lisp."
 
V

Ville Vainio

Bicho> I have now free time and money to do what I want :) I have
Bicho> some basic skills in programming (C, Pascal, Macromedia
Bicho> Actionscript) but don't know exactly what to do in the
Bicho> world of programming. And also I don't know exactly why
Bicho> would I learn Python rather than C#, C++ or Perl. Basicaly

Well, I assume you want to have fun programming, and that kinda rules
out C# and (especially) C++. They don't really have the favourable
effort/gratification ratio of Python. If you want to get something
done, choose Python. If covering your ass if/when your project fails
is more important than actually succeeding, choose more
conservatively, which means Java/C++/C#. Since you are on your own in
this, Python is an excellent choice.

If you choose Perl, you will at some regret your choice and consider
porting the app to Python. You save a lot of time/frustration by not
going there in the first place.

Bicho> I don't know where to start, if there is much to do or if
Bicho> it is has it seems and there is software to everything
Bicho> nowadays and so doesn't make sense to spend time in
Bicho> learning a programming language. I just have this idea

There really isn't software to do all those little script-level tasks
you need to do every now and then, so learning Python is still not a
lost cause even if you never get anything bigger done. Also, writing a
Python script is often faster than searching for a program to do the
thing and then learning how to use that program. It's also more fun.

Bicho> that I would like to contribute to the curve of accelarated
Bicho> exponential progress (technological singularity),
Bicho> artificial intelligence and so on. From that point of view
Bicho> there is much to do... But can I stand for it and where to
Bicho> start? Anyone would help me and give me some hints?

Learn Python first, the ease of programming can quite possibly inspire
you to create something interesting.
 
V

Ville Vainio

Jacek> Lest Derek give the impression that Lisp is in any way a
Jacek> "toy" language, or that it somehow sacrifices practicality
Jacek> for elegance, I feel honour bound to point out that it is
Jacek> actually the most powerful and expressive programming
Jacek> language known to man, and excells in solving problems
Jacek> which are often considered too hard to be solved in other
Jacek> languages.

Python will catch up Real Soon Now - there are so many Python+Lisp
projects in the works, soon we can implement all the impossible tasks
in the world by combining development speed of Python with macro magic
of Lisp for that final, "impossible" leap :).

Jacek> -- Greenspun's Tenth Rule of Programming:

Jacek> Greenspun's Tenth Rule of Programming: "Any sufficiently
Jacek> complicated C or Fortran program contains an ad-hoc,
Jacek> informally-specified, bug-ridden, slow implementation of
Jacek> half of Common Lisp."

At least they should have implemented scheme instead.
 
B

Bart Nessux

Ville said:
Learn Python first, the ease of programming can quite possibly inspire
you to create something interesting.

This is true. Learn Python and *then* learn other languages. Learn as
many languages as you like. Python will teach you how to think when
writing programs. This thought process will be the same for C, C++,
Perl, etc. As a bonus, Python can be applied to solving real-world
problems as well. So, you get the best of both worlds:

1. A theorhetical language that easily teaches the concepts of modern
computer programming.

2. A practical language that is actually useful for doing things.

Python is also easy to read compared to other languages. It's much
easier to learn. Its syntax doesn't get in the way of learning like C
++, or other language's syntax can. It's fun too.

Best of luck,

Bart
 
P

Peter Hansen

Ville said:
If you choose Perl, you will at some regret your choice and consider
porting the app to Python. You save a lot of time/frustration by not
going there in the first place.

This is only true if you actually know Python. If you carefully avoid
acquiring any knowledge of or ability in Python, you will rarely regret
the decision not to use Python for your project. <wink>

-Peter
 
R

Rony

Group : comp.lang.python
I have now free time and money to do what I want :)
.....

If I would have enough money and free time to do what I want, I would
*stop* programming....
But if you insist on wanting to write software, Python is a **very**
good choice.


--
Rony

/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
/ (e-mail address removed) (delete _no_spam)
/
| www.bucodi.com - My work
\ www.ifrance/karamusic -- My hobby
\_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
 
D

Derek

Jacek Generowicz said:
Lest Derek give the impression that Lisp is in any way a
"toy" language, or that it somehow sacrifices practicality
for elegance, I feel honour bound to point out that it
is actually the most powerful and expressive programming
language known to man, and excells in solving problems
which are often considered too hard to be solved in other
languages.

I meant no disrespect to Lisp. My intention was only to point out
that it's quite possible to carry out AI programming in other
languages, albeit less miraculously. :)
 
N

Nicolas Fleury

Bicho said:
Anyone would help me and give me some hints?

- C# is like a MS-specific Java.
- C++ is for system programming where performance is important. I love
C++ but I think it was Herb Sutter (a C++ guru) who described C++ as a
"last resort language" and I must agree.
- Perl is also a very nice language, but I would suggest to basically
see it as a parsing language and Perl 6 will make perl even better in
that domain with built-in support for grammars. And knowing a parsing
language is a very good thing. However, for other than that, even if
Perl has all the functionality, Python is cleaner, simpler and more
structured and elegant.

If you're interested in AI, I strongly suggest to look at functional
languages like Lisp dialects.

Don't be afraid to learn many languages, that's the way you will learn
what is strong about each of them, and that we basically need them all;)

Regards,

Nicolas
 
S

Samuel Walters

|Thus Spake Bicho Verde On the now historical date of Mon, 12 Jan 2004
13:05:19 +0000|
I have now free time and money to do what I want :)
Go to the Bahamas. You'll enjoy it more.

[chop]
Anyone would help me and give me some hints?

Here's my two cents on which languages to learn, why and in what order.

Python:
Python is probably the best language from which to branch out to other
languages. If you learn it well, you will have all the major concepts of
programming as part of your mental toolkit. Luckily, Python's learning
curve is not at all steep, there's a great and wonderful community that
gladly answers questions and helps you through the confusing parts. As a
bonus, you'll find that it's terribly, dastardly useful.

C:
In my opinion, this is where a student should move next. At some point or
another, every serious programmer has to dig into some C code. It's
important to learn C before C++ because many of the conveniences of C++
make one lazy about learning C. Because of it's vast popularity, you can
often find resources that give algorithms and outlines of processes in C,
and those ideas can then be applied to your language of choice. Be sure
to investigate linked lists, trees, hashing and memory allocation methods
and other such "not quite basic" constructs in C. From those, you will
understand a lot more of what goes on behind the scenes in other
languages.

C++:
If you've learned C, It's good to move onto C++ if only for the sake of
completeness. When I first learned C++, I was completely enamored of it,
but that crush has since died. It's important in GUI based applications
and gives you a fair grounding in Object Oriented programming. I strongly
recommend Bruce Eckel's "Thinking in C++" as a guide to the language
*after* you've gotten the basics down. It is available for free online,
but I'm glad I bought the dead tree version of it. There is some debate
as to how useful C++ is, but I think it's at least useful enough to take
some time learning well.

Lisp/Scheme:
Lisp and Scheme are two languages that people claim will give you
Jedi-like powers as a programmer. I'm learning them right now, so I can't
give you advice on why one would learn them. I'm learning Scheme first,
because there seem to be many more introductory tutorials and a lot of
advice that one should learn Scheme, then move to Common Lisp. YMMV. If
you like AI, at some point you will run across Lisp code, so it should be
of particular interest to you. In short, the consensus is that Lisp, like
milk, does a body good.

It is my philosophy that one should at least learn enough of a lot of
languages that you can at least browse some code without feeling lost.
Each new language gives you some new ideas that make you better at other
languages.

What follows is the minimum I would suggest you familiarize yourself with.

Sed/Awk/Bash shell Scripting:
Sed, Awk and bash shell scripting get tossed around enough that you should
be able to read them. Sed and Awk are confusing at first, and take some
measure of work to develop even a minimum competency in. Don't give up
easily here. It pays off in the long run.

Perl:
I don't like perl, but you shouldn't judge a language on my opinion of it.
Perl is very popular and is worthy understanding the basics of. Even if
you don't like it, learn enough of it to read programs written in it. It
is a very important language. Perl is easier to learn once you have
mastered Sed and Awk. (and vice versa) In many ways Perl is a souped up
combination of the two languages that's been imbued with mutant
super-powers.

Java:
Once you have learned C++, it's almost trivial to learn Java. The hardest
part is keeping separate in your head what applies to C++ and what applies
to Java. Besides, it's not a bad thing to be able to put on your resume.

C# and .Net:
I fear that C# is just another Microsoft misadventure, but for now it's
worth gaining a cursory knowledge of. If nothing else, it's a buzzword
compliant way to build your resume. Though, Microsoft can be a tricky
devil, so think carefully before you bank a career on something they
control.

PHP:
PHP has it's fair share of warts, but reading a couple of books on it
gives you a strong grounding in the issues a dynamic web-based application
faces.

Assembly:
Research carefully, and find a good book on assembly language programming.
Spend some time wrestling with it. It's hard and confusing. You may
never again touch a lick of assembly in your life, but you will always be
glad for the knowledge it gave you. Assembly is more of a long term
project than any of the other languages I've mentioned, so go slow here.

And always remember:

Programming is not a spectator sport.

Close the book often and try to write code from memory.

HTH

Good Luck!

Sam Walters.
 
C

Cameron Laird

.
.
.
I'd say don't bother with C++ unless you're working on a big
multi-person project. Its design will make no sense to you unless
you've faced the problems that come up in those projects. Otherwise
it's a big mess.
.
.
.
And if you *are* working on a big multi-person project, and you
choose C++, you're likely to end up with ... a big mess.

I get to say so. I'm fond of C++, and have seen plenty of pro-
jects which rely on it. I've also seen the teams assigned to
such projects ...
 
C

Cameron Laird

.
.
.
I would not dismiss C++ (or even vanilla C) outright. I strongly
suggest starting in Python and looking to C and C++ when you have good
reason -- that is, when those languages will let you do something that
Python is less than than stellar at: large applications, system
software, performance-critical applications, embedded programming,
etc.
.
.
.
I contest the proposition that "Python is less than stellar at
large applications ...", and, in particular, that C++ is super-
ior there. I recognize you're not alone in that; for me, though,
large-scale programming is one of Python's *strengths*.

I don't have a good decision mechanism to propose. Trial by
ordeal (and most large-team projects fit in that category) seems
as apt as any.
 
P

Paul Rubin

And if you *are* working on a big multi-person project, and you
choose C++, you're likely to end up with ... a big mess.

C++ was motivated by the problems faced by big projects written in C.
I'm talking about stuff like telephone switches with hundreds of
programmers and millions of lines of code. Even with very competent
designers and managers, those projects usually ran amuck. C++ gives
some real help in keeping projects like that functioning, if the
programmers and managers know what they're doing. If they don't know
what they're doing (as is the case in most projects), C++ isn't that
likely to help and may make the problems worse.

But if you've lived through the multitudinous nightmares of projects
like that, and you then read Stroustrup's book about C++, on just
about every page you'll see some feature described and you'll
recognize the specific nightmare that inspired it. If you haven't
experienced those nightmares yourself, I can't be sure but I think the
feature descriptions will just seem like feature descriptions and
you won't understand the real reasons why they're there.

I think the OP's list should also have included Java, which is sort of
a modernized, "discount" version of C++.
 
D

Derek

"Cameron Laird" in message:
I contest the proposition that "Python is less than stellar
at large applications ...", and, in particular, that C++ is
super- ior there. I recognize you're not alone in that;
for me, though, large-scale programming is one of Python's
*strengths*.

I don't have a good decision mechanism to propose. Trial by
ordeal (and most large-team projects fit in that category)
seems as apt as any.

All I know is that there are thousands of extremely large projects
written in C++, some consisting of millions of lines of code written
by hundreds of developers. C++, while far from perfect, has proven
its worth on a huge scale. Python, at the very least, has yet to do
so.
 
J

John J. Lee

Paul Rubin said:
C++ was motivated by the problems faced by big projects written in C.
I'm talking about stuff like telephone switches with hundreds of
programmers and millions of lines of code. Even with very competent
[...]

If you're doing a comparative study of C and C++, that's true.

But many, many other languages that don't suffer from C++'s absurd
baggage also provide that kind of scalability (in terms of function
points -- nobody cares about lines of code). The consensus seems to
be that the root causes of C++'s baggage are C-compatibility and
efficiency, not primarily the demands of large projects.


John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,175
Messages
2,570,946
Members
47,498
Latest member
yelene6679

Latest Threads

Top