Re: Want to learn a language - is Python right?

2005-06-22 Thread Aziz McTang
Hi Everyone,
Thanks for all the helpful advice. Downloaded 2.4.1 and already have an
inkling of some of the things it can do. Time to start learning!
ATB
Aziz

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Want to learn a language - is Python right?

2005-06-21 Thread Steven D'Aprano
On Mon, 20 Jun 2005 17:23:27 -0700, James Stroud wrote:

 By the way, ignore any posts talking about speed of execution. This is 
 generally a non-issue for new programmers. If you want your code to run 
 faster, buy a faster computer.

Oooh, red rag to a bull.

Not everybody can afford to buy a faster computer to try to make their
sort function run as quickly as Python's built-in sort.

def newbie_sort(s):
Sort lines of string s, considering that speed of 
execution is a non-issue.

# split s into lines
L = []
while \n in s:
p = s.find(\n)
L = L + [s[0:p]]
s = s[p+1:]
L = L + [s]
# sort the lines
for passes_remaining in range(len(L)-1, 0, -1):
for p in range(passes_remaining):
if L[p]  L[p+1]:
temp = L[p]
L[p] = L[p+1]
L[p+1] = temp
# re-join the lines back into a single string
s = L[0]
del L[0]
for line in L:
s = s + \n + line
return s


def better_sort(s):
Sort lines of string s the right way.

L = s.split(\n)
L.sort()
return \n.join(L)


The first function, newbie_sort, is good for only one thing: to be a
horrible example of how inefficient and slow Python can be. It is also
remarkably similar to a lot of my early Python programs.

I think a better way of putting what James tried to get across is, don't
be too concerned about writing fast code until you have learnt the
basics of the language. Get the code WORKING first, and FAST second.

(And frequently, the best way to get it working is also the best way to
have it run fast.)



-- 
Steven.



-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Want to learn a language - is Python right?

2005-06-21 Thread sjmsoft
Aziz McTang wrote:
 What I'm looking for is more to learn one good, comprehensive
 programming language well than several approximately on an ad hoc
 basis. What I also failed to mention is the desire to develop my
 presently limited computer skills a lot further.

I've programmed in perhaps 20 languages ranging from the famous to the
obscure, from 1950s to 1990s design.  Python is my favorite.  It's a
great language for beginners but advanced programmers do not outgrow
it.  It has powerful features but simple, sensible syntax, so you spend
little time fighting the language itself and more time fighting the
problem you're trying to solve.  It's open source so cost of entry is
zero, it runs on many platforms, and it has a active, helpful user
community.  And coding in Python is fun!

Python is a great first lanuguage but keep an open mind to _someday_
learning more languages.  As someone else mentioned in this thread, no
language is right for all jobs.  And knowing languages built on
different paradigms (e.g., Prolog, Lisp, assembly languages) provides
new insights into the art of programming.

Cheers,
  Steve

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Want to learn a language - is Python right?

2005-06-20 Thread Paul Rubin
Aziz McTang [EMAIL PROTECTED] writes:
 1) Generate web pages
 This one's fairly obvious maybe.

You might find this easier to do with PHP.  Python is better in a deep
way, but for web pages, that advantage only becomes real when you're
doing complicated sites.  Simple stuff is easier to do with PHP
despite that language's flaws.

 2) Create a simplified translation package specific to my line of work:

This is a lot harder than it sounds and you're better off using a
canned program for it.

 3) Help me learn Estonian.
 I wrote a couple of rules in Excel. ...
 Is Python the sort of language that will let me do this sort of thing
 (whether *I* can actually do it is another question :) )?

Yes, Python is a good choice for that type of program, though whether
that's a good way to learn a natural language (like Estonian) is a
different matter.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Want to learn a language - is Python right?

2005-06-20 Thread Aziz McTang
Hi Paul,

Thanks for your input.

As usual, hearing some answers helps formulate the question...

What I'm looking for is more to learn one good, comprehensive
programming language well than several approximately on an ad hoc
basis. What I also failed to mention is the desire to develop my
presently limited computer skills a lot further.

So although your answer to 1 suggests I'd be using a steam-roller to
kill a fly, if I do need to go further (or ask other people to help and
still understand what's going on: one site I may want to develop later
involves a number of languages including Japanese as well as audio) I
won't have to re-learn another program. Is this right?

As to 2, I have yet to find a canned program that does what I want, and
so far every programmer I've asked to write it has said hey that's
easy then escaped, never to be heard of again.

And 3: good! Actually, having learned half a dozen languages, I can
vouch for it being an excellent way to acquire and consolidate
vocabulary. Talking to (or, rather, understanding) the natives is
another kettle of fish!

Thanks again!

Any new slants from yourself or others are welcome.

Aziz

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Want to learn a language - is Python right?

2005-06-20 Thread Harlin Seritt
Aziz McTang wrote:

 Hi Paul,
 
 Thanks for your input.
 
 As usual, hearing some answers helps formulate the question...
 
 What I'm looking for is more to learn one good, comprehensive
 programming language well than several approximately on an ad hoc
 basis. What I also failed to mention is the desire to develop my
 presently limited computer skills a lot further.
 
 So although your answer to 1 suggests I'd be using a steam-roller to
 kill a fly, if I do need to go further (or ask other people to help and
 still understand what's going on: one site I may want to develop later
 involves a number of languages including Japanese as well as audio) I
 won't have to re-learn another program. Is this right?
 
 As to 2, I have yet to find a canned program that does what I want, and
 so far every programmer I've asked to write it has said hey that's
 easy then escaped, never to be heard of again.
 
 And 3: good! Actually, having learned half a dozen languages, I can
 vouch for it being an excellent way to acquire and consolidate
 vocabulary. Talking to (or, rather, understanding) the natives is
 another kettle of fish!
 
 Thanks again!
 
 Any new slants from yourself or others are welcome.
 
 Aziz

You can use CherryPy for creating a Python-esque web application. Never buy
into the fluff that says Python is not as good as PHP for web apps! PHP is
still too Perl-Like (meaning old and useless)! Python is the choice of a
new generation baby!!! :) JK... 

For your vocab program, Python is actually perfect. This could even go for
apps that require some Unicode and other Internationalization snafus (like
right-to-left characters and Cyrillic typesets). 

If you're looking for one programming language then you should consider the
idea that no one language can do it all (although Python comes close in my
biased opinion). Python is not for memory management, writing device
drivers and the like. 

As far as needing something for web apps, CherryPy is great -- just learn
Python first. PHP is good but it has fallen out of favor with me though
there are a ton of people out there who think it is the greatest thing
since sliced bread.

Take a look at the Python tutorial: http://docs.python.org/tut/tut.html. 

Good luck,

Harlin Seritt 
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Want to learn a language - is Python right?

2005-06-20 Thread Paul Watson
Aziz McTang [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 Hi Paul,

 Thanks for your input.

 As usual, hearing some answers helps formulate the question...

 What I'm looking for is more to learn one good, comprehensive
 programming language well than several approximately on an ad hoc
 basis. What I also failed to mention is the desire to develop my
 presently limited computer skills a lot further.

You have received some good advice.  There are strong tools to support 
localization, but they are not inexpensive.  They might be lower cost than 
developing your own.  However, your goal to develop your programming skills 
is also a cost to be considered.  Are you interested in developing an open 
source localization tool?

A consideration for web applications is who will be maintaining the code. 
If these are all your own and no one else will ever work on them, then use 
any tool you like.  Coding them in x86 assembly language would increase your 
computer knowledge, but we both know that is not the right tool for this 
task. 


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Want to learn a language - is Python right?

2005-06-20 Thread James Stroud
Python will help you as a novice for these reasons:

1. Help you to learn programming concepts and develop good habits.
2. Powerful Standard Library to help you do more advanced things.
3. Smooth, shallow learning curve, e.g. hello world is:

 print Hello World

   So you can do simple things in python with minimal learning.

4. Excellent, friendly, patient, helpful user base.
5. Code is inherently more maintainable than other languages.
6. comp.lang.python

In short, you have come to the right place. I have used many programming 
languages (C, Java, Fortran, Python, Perl, just to name the more famous ones) 
and python takes the cake as a general purpose programming language.

By the way, ignore any posts talking about speed of execution. This is 
generally a non-issue for new programmers. If you want your code to run 
faster, buy a faster computer.

James

On Monday 20 June 2005 07:47 am, Aziz McTang wrote:
 What I'm looking for is more to learn one good, comprehensive
 programming language well than several approximately on an ad hoc
 basis. What I also failed to mention is the desire to develop my
 presently limited computer skills a lot further.

-- 
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095

http://www.jamesstroud.com/
-- 
http://mail.python.org/mailman/listinfo/python-list