Welcome, Guest. Please Login
 
  HomeHelpSearchLogin FAQ Radified Ghost.Classic Ghost.New Bootable CD Blog  
 
Page Index Toggle Pages: 1
Send Topic Print
Learning Python (Read 10573 times)
Rad
Radministrator
*****
Offline


Sufferin' succotash

Posts: 4090
Newport Beach, California


Back to top
Learning Python
Feb 14th, 2009 at 7:24pm
 
MrMagoo wrote on Feb 14th, 2009 at 6:44pm:
By the way, I'm on the fence about if I'd recommend Programming Python. It assumes zero experience with programing/scripting/computers and so moves slow for me, but I never did get a proper introduction to CS and still feel like it will be good for me to make sure I've got that foundation.

Slow is good, no? For someone who has no programming experience. Filling in all the gaps makes it easier to ramp up once the basics are absorbed. Is that what you mean?

Pls elaborate on your experience with the Zelle book, as I was thinking about that.

Is the Zelle book available here?

http://books.google.com/books?id=aJQILlLxRmAC&dq=john+zelle+python&printsec=fron...
 
WWW  
IP Logged
 

MrMagoo
Übermensch
*****
Offline


Resident Linux Guru

Posts: 1026
Phoenix, AZ (USA)


Back to top
Re: Learning Python
Reply #1 - Feb 14th, 2009 at 10:44pm
 
Rad wrote on Feb 14th, 2009 at 7:24pm:
Pls elaborate on your experience with the Zelle book, as I was thinking about that.

Is the Zelle book available here?

Yup, that's the book.

I'm only a few chapters in, so my current assessment isn't worth much, but I'll tell you what I know now and give you an update when I get further in.

Slow is good for someone who isn't familiar with the material, but I feel like he goes even slower than that.  It feels almost like it is aimed at someone who has never used a computer beyond browsing the web.  As an example, he spends a page or two explaining the difference between RAM and a HD.  So, as someone who is very familiar with computers and at least passingly familiar with programming, the book feels almost too slow.

Now, I think it will still be worth it for me if he does a good job of covering all the CS basics that I never had any formal instruction in.  So far, it looks like that is the direction he is headed.

What I meant when I said I was on the fence was that I think it is going to do a good job of covering CS basics, but that it may proceed too slowly for someone like you or me that has some solid computer experience and maybe has seen a script or two.  I'll let you know when I get through a little more of the material.
 
WWW  
IP Logged
 
MrMagoo
Übermensch
*****
Offline


Resident Linux Guru

Posts: 1026
Phoenix, AZ (USA)


Back to top
Learning Python
Reply #2 - Feb 18th, 2009 at 6:53pm
 
This Topic was moved here from The Water Cooler by MrMagoo.
 
WWW  
IP Logged
 
MrMagoo
Übermensch
*****
Offline


Resident Linux Guru

Posts: 1026
Phoenix, AZ (USA)


Back to top
Re: Learning Python
Reply #3 - Feb 18th, 2009 at 7:21pm
 
Our other thread just past the 5 page mark, and I remember we used to have problems with long posts, so I split this one out.  It may generate a little discussion.

I'm finished with chapter 9 of 13 in this book, so I'm a good way through the book.  At this point, I feel comfortable with making some general observations.

The first observation is that this book WILL NOT move too fast for ANYONE.  The author assumes you have no prior programing experience, very little prior computer experience, and at one point goes into a short explanation of integer division and remainders, just in case you didn't pass 4th grade.  He explains everything in simple terms and uses easy to follow examples.  I honestly think a 7th grader with no prior programing experience could learn python from this book.

So, if you want a gentle introduction to programing, this is your book.  If you like things to move a little faster or have any programing experience, you might want to look for a text that is going to be a better compliment to the knowledge you already have.

Chapter 9 wraps up the functional introduction to Python, and chapter 10 starts in on the objective programing.  So, at this point I am beginning to get an idea of what Python is capable of and if it is a good language for people to start with.  

The advantage of Python is that it is fairly clean to read and write and popular enough that there is a wide variety of code out there and lots of libraries available.  It is a high-level language, and takes care of memory allocation and garbage clean-up for you.

The disadvantage is that Python isn't as capable as Perl or Ruby.  It isn't very flexible about how information is passed between functions, like Perl is, and it doesn't allow you to pass functions as input or output to other functions (at least I haven't seen a way yet.)  

My feeling at this point is that Python would be a good replacement for Basic and other "starter" languages used in high school classes.  It would be a good stepping stone for a 10th grader who knows some HTML to get into programing.  It's also nice to know, just because of its popularity.  But, if you are really wanting to do interesting things, you will quickly need something more powerful.  

There's nothing in Perl or Ruby that make me think they wouldn't suit the a beginning programmer, and both have enough libraries and code examples out there that you won't be at any disadvantage.  Unix geeks have been pumping out Perl code for a long time, and you can find a module to do just about anything with a few tweaks.  For those who have done a little scripting but don't want to jump head-first into LISP, I'd say to start with Perl or Ruby and then go from there.  You can go back and learn Python afterwards and it will only take a week or two to learn the syntax if you need to read someone's code.
 
WWW  
IP Logged
 
Rad
Radministrator
*****
Offline


Sufferin' succotash

Posts: 4090
Newport Beach, California


Back to top
Re: Learning Python
Reply #4 - Feb 18th, 2009 at 11:50pm
 
Thanks for splitting out the thread.

MrMagoo wrote on Feb 18th, 2009 at 7:21pm:
My feeling at this point is that Python would be a good replacement for Basic and other "starter" languages used in high school classes.

Have you heard of Django? http://www.djangoproject.com/

MrMagoo wrote on Feb 18th, 2009 at 7:21pm:
There's nothing in Perl or Ruby that make me think they wouldn't suit the a beginning programmer

Kinda got me leaning toward Ruby, then.

MrMagoo wrote on Feb 18th, 2009 at 7:21pm:
Unix geeks have been pumping out Perl code for a long time

I keep seeing references to Perl as a replacement for the Unix shell scripting, but still haven't been able to understand the Perl/Unix connection and how they interrelate. What's the skinny there?
 
WWW  
IP Logged
 
MrMagoo
Übermensch
*****
Offline


Resident Linux Guru

Posts: 1026
Phoenix, AZ (USA)


Back to top
Re: Learning Python
Reply #5 - Feb 19th, 2009 at 1:15am
 
Rad wrote on Feb 18th, 2009 at 11:50pm:
keep seeing references to Perl as a replacement for the Unix shell scripting, but still haven't been able to understand the Perl/Unix connection and how they interrelate. What's the skinny there?  

I wouldn't call it a replacement.  It's more like the next step up.  Shells are not written as programming languages.  While they have basic support of loops and things like that, its fairly clumsy.  If you need to do something more serious than clearing out files on an automated schedule or starting a list of processes in a particular order, Perl does it more elegantly than a shell script and isn't all that hard to learn if you already understand control structures and such.

Perl has awesome support for Regx.  

http://en.wikipedia.org/wiki/Regular_expression

That makes it a favorite for admins who need to look through gigabytes of web logs looking for a particular referring URL, for example.  As popularity for Perl grew, its popularity meant that there was lots of code examples and snippets of code that people had already written, making the job of writing a script often a matter of taking something that's out there and tweaking it to fit your needs.  So, its popularity made it popular.  The trend continues, and huge repositories of Perl code (like CPAN) exist on the internet.

Perl is also very high-level - managing memory for you.  So, you can whip together a few quick scripts without having to rack your brain too hard looking for memory leaks.

The writers of Perl have also done a great job of keeping the language relevant.  They added support for classes several years ago, and continue to update the language.

Ruby has a lot of the same capabilities but is a newer language, so it lacks the huge existing code base.

Rad wrote on Feb 18th, 2009 at 11:50pm:
Kinda got me leaning toward Ruby, then.

My experience is limited, but I enjoyed the little bit of Ruby I wrote much more than a lot of code I've worked on.  I also enjoyed the teaching material more than any other:

http://whytheluckystiff.net/ruby/pickaxe/

That text balances tutorial and reference better than almost anything else I've read on any subject.  Most texts are meant either as a reference and you can't read them without your mind wandering off in the middle of the gory details, or they are meant to be read through and aren't dense enough to make you feel like you really know something at the end.

With that said, I had trouble following a few of the examples and it does little to teach you Computer Science.  It is meant to teach programmers how to use Ruby, so I don't think it is aimed at us beginners.

I'm really beginning to agree with Nigel that it doesn't matter what language you learn to start out with, as long as you learn something.  Python, Perl, and Ruby are all very similar syntactically, so its not hard to move between them.  Even the little bit of C that I know, while syntactically very different, is functionally similar to Perl in lots of ways.  You define procedures, feed them input, grab their output, pass that to another procedure.  

Even shell scripting is useful and gives you a good introduction to flow control, variables, boolean decisions, etc.

Rad wrote on Feb 18th, 2009 at 11:50pm:
Have you heard of Django?

No.  It looks interesting, but I think I'd rather learn Rails since I like Ruby better than Python.
 
WWW  
IP Logged
 

MrMagoo
Übermensch
*****
Offline


Resident Linux Guru

Posts: 1026
Phoenix, AZ (USA)


Back to top
Re: Learning Python
Reply #6 - Feb 20th, 2009 at 3:13am
 
Ok, I finished this book.  I'm glad to be done with it, if that says anything about its quality.

Chapter 10 actually gives a decent introduction to objects.  Objects are one of the tougher things (I've always felt) to get your head around just because they are so steeped in terminology.  The author does a good job at explaining them through an example that both shows their power and doesn't over complicate them.

Chapter 11 *finally* introduces lists and hashes (known as dictionaries in Python.)  Most other books would introduce them along with any other data type back in chapter 2 or 3, and I think that would have made a lot more sense.  He had to write some ugly code up to chapter 11 to get around the fact that he didn't introduce lists, and in doing so missed showing some good examples of the power of lists.

Chapter 12 is a few case studies in how to use objects and I think that he picks terrible examples.  His examples problems don't lend themselves easily to objects, so he sort of contrives how objects could be use to solve the problem.  It ends up making objects look clumsy when they can really be very elegant in the right situation.

Chapter 13 actually has some great discussions of recursion and sorting that finally touch on Computer Science rather than just programming in Python.  I was fully engaged in his writing for once and found it thought-provoking.  Unfortunately, he wraps up the chapter with a discussion of the Halting Problem.

http://en.wikipedia.org/wiki/Halting_problem

While I can reason in my own head why the Halting Problem would be impossible to solve, I think his example of why it is impossible uses completely inexplicable logic.  The reason his example code wouldn't work is because it's bad, contrived, and illogical code - not because the problem is impossible to solve (although I do believe the problem is impossible to solve.)

Over all, I do not recommend this book.  The writing isn't all that good, shows no creativity, and has a slightly condescending tone toward the reader (especially considering he was aiming at college freshmen.)  I could possibly recommend this book to a high-schooler due to its slow pace and lack of advanced concepts. Anyone with any coding, computer, or math experience at (or beyond) a college level should look for a book that they can get more out of.

One possible use of this text if you happen to find it in the library is to learn some programing basics somewhere else, then read chapters 10 and 13 to glean the few gold nuggets this author has managed to produce there.  

--------------------

On a related note, from the little bit I now know about Python, I'm not impressed with it as a language.  Then again, it could be because of where I learned it.
 
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print