Greetings, My copy of the second edition of Chun's "Core Python Programming" just arrived from Amazon on Friday. What really jumped out at me is an interesting feature about how it sequences its topics, namely, (user-defined) functions are not introduced until chapter 11, fully 400 pages into the book. This contrasts strongly with a traditional "Introduction to language X" book which has a chapter sequence roughy like:
The exact details vary from book to book and language to language of course, but usually the above topics are covered in the first 100-150 pages since it is hard to do anything interesting until all of these tools are under your belt. Chun's book by contrast is able, on the strength of Python's built-in functions, to cover a fair amount of relatively interesting things (dictionaries, file IO, exception handling, etc.) before introducing user-defined functions.
I don't want to read too much into this, but the mere fact that it is possible to write a Python book in this fashion seems to confirm the "batteries are included" philosophy of Python. Perhaps there is less need to learn how to roll your own batteries as soon as possible.
I would consider that an omission. Functions are very important in Python. I think the user/reader should see the _def_ and _class_ statement fairly soon in the introduction. The name of the book is thus somewhat misleading, because functions are at the "core" of Python.
Functions should be right there with the integers, strings, files, lists and dictionaries. Another important point to stress, in my opinion, is that functions are first-class objects. In other words functions can be passes around just like strings and numbers!
John Coleman wrote: > Greetings, > My copy of the second edition of Chun's "Core Python Programming" > just arrived from Amazon on Friday. What really jumped out at me is an > interesting feature about how it sequences its topics, namely, > (user-defined) functions are not introduced until chapter 11, fully 400 > pages into the book. This contrasts strongly with a traditional > "Introduction to language X" book which has a chapter sequence roughy > like:
> The exact details vary from book to book and language to language of > course, but usually the above topics are covered in the first 100-150 > pages since it is hard to do anything interesting until all of these > tools are under your belt. Chun's book by contrast is able, on the > strength of Python's built-in functions, to cover a fair amount of > relatively interesting things (dictionaries, file IO, exception > handling, etc.) before introducing user-defined functions.
> I don't want to read too much into this, but the mere fact that it is > possible to write a Python book in this fashion seems to confirm the > "batteries are included" philosophy of Python. Perhaps there is less > need to learn how to roll your own batteries as soon as possible.
Nick Vatamaniuc wrote: > I would consider that an omission. Functions are very important in > Python. I think the user/reader should see the _def_ and _class_ > statement fairly soon in the introduction. The name of the book is > thus somewhat misleading, because functions are at the "core" of > Python.
A is not ommitted from DBECAFG - it just appears in a non-standard order. If the book simply ommitted functions then it would be a shocking ommission. As it is, it is just a curious way of sequencing topics. Functions are in chapter 11 out of 23 chapters - sounds like the "core" of the book to me.
Chun does emphasize the first-class status of functions in Python - something which is fairly important to me since I have dabbled on and off with functional programming the last few years (mostly SML) and am interested in seeing the extend to which Python is genuinely "multi-paradigm" - able to blend the functional and imperative (and OO) paradigms together.
Nick Vatamaniuc wrote: > I would consider that an omission. Functions are very important in > Python. I think the user/reader should see the _def_ and _class_ > statement fairly soon in the introduction. The name of the book is > thus somewhat misleading, because functions are at the "core" of > Python.
> Functions should be right there with the integers, strings, files, > lists and dictionaries. Another important point to stress, in my > opinion, is that functions are first-class objects. In other words > functions can be passes around just like strings and numbers!
> -Nick Vatamaniuc
> John Coleman wrote: > > Greetings, > > My copy of the second edition of Chun's "Core Python Programming" > > just arrived from Amazon on Friday. What really jumped out at me is an > > interesting feature about how it sequences its topics, namely, > > (user-defined) functions are not introduced until chapter 11, fully 400 > > pages into the book. This contrasts strongly with a traditional > > "Introduction to language X" book which has a chapter sequence roughy > > like:
> > The exact details vary from book to book and language to language of > > course, but usually the above topics are covered in the first 100-150 > > pages since it is hard to do anything interesting until all of these > > tools are under your belt. Chun's book by contrast is able, on the > > strength of Python's built-in functions, to cover a fair amount of > > relatively interesting things (dictionaries, file IO, exception > > handling, etc.) before introducing user-defined functions.
> > I don't want to read too much into this, but the mere fact that it is > > possible to write a Python book in this fashion seems to confirm the > > "batteries are included" philosophy of Python. Perhaps there is less > > need to learn how to roll your own batteries as soon as possible.
John Coleman wrote: > A is not ommitted from DBECAFG - it just appears in a non-standard > order. If the book simply ommitted functions then it would be a > shocking ommission. As it is, it is just a curious way of sequencing > topics. Functions are in chapter 11 out of 23 chapters - sounds like > the "core" of the book to me.
> Chun does emphasize the first-class status of functions in Python - > something which is fairly important to me since I have dabbled on and > off with functional programming the last few years (mostly SML) and am > interested in seeing the extend to which Python is genuinely > "multi-paradigm" - able to blend the functional and imperative (and OO) > paradigms together.
> -John Coleman
> Nick Vatamaniuc wrote: > > I would consider that an omission. Functions are very important in > > Python. I think the user/reader should see the _def_ and _class_ > > statement fairly soon in the introduction. The name of the book is > > thus somewhat misleading, because functions are at the "core" of > > Python.
> > Functions should be right there with the integers, strings, files, > > lists and dictionaries. Another important point to stress, in my > > opinion, is that functions are first-class objects. In other words > > functions can be passes around just like strings and numbers!
> > -Nick Vatamaniuc
> > John Coleman wrote: > > > Greetings, > > > My copy of the second edition of Chun's "Core Python Programming" > > > just arrived from Amazon on Friday. What really jumped out at me is an > > > interesting feature about how it sequences its topics, namely, > > > (user-defined) functions are not introduced until chapter 11, fully 400 > > > pages into the book. This contrasts strongly with a traditional > > > "Introduction to language X" book which has a chapter sequence roughy > > > like:
> > > The exact details vary from book to book and language to language of > > > course, but usually the above topics are covered in the first 100-150 > > > pages since it is hard to do anything interesting until all of these > > > tools are under your belt. Chun's book by contrast is able, on the > > > strength of Python's built-in functions, to cover a fair amount of > > > relatively interesting things (dictionaries, file IO, exception > > > handling, etc.) before introducing user-defined functions.
> > > I don't want to read too much into this, but the mere fact that it is > > > possible to write a Python book in this fashion seems to confirm the > > > "batteries are included" philosophy of Python. Perhaps there is less > > > need to learn how to roll your own batteries as soon as possible.
I don't normally read programming books -- just use the chapters that I need when I need them, unless of course there is a clever plot twist coming up ahead (for ex.: "Next: The revenge of lambdas. Will they stay or will they go?" ;-)
Why? Have you read it from beginning to end. What did you think about functions being introduced later than files and exceptions?
> > I would consider that an omission. Functions are very important in > > Python. I think the user/reader should see the _def_ and _class_ > > statement fairly soon in the introduction. The name of the book is > > thus somewhat misleading, because functions are at the "core" of > > Python.
I must say I find Wesley Chun's explanations to be most understandable. I cant' exactly figure out why yet, but he has a way of explaining something, like, say, decorators, that in minimal words elucidates for me the intent behind why they are useful. That helps me understand how they work. I just finished reading the chapter on Functions for the book, I guess I was partly prompted by this thread on the newsgroup. it was a *very* quick read, I could scan quickly but gain a better understanding of the whole topic of functions in Python, including inner functions, closures, decorators, continuations, and coroutines. Talk about bang for the buck, that half hour to 45 minutes of reading new chapter in Wesley Chun's new book was the best investment of time i have made in quite a while.
I really like this book. I really, really, really like it.
John Coleman wrote: > Greetings, > My copy of the second edition of Chun's "Core Python Programming" > just arrived from Amazon on Friday. What really jumped out at me is an > interesting feature about how it sequences its topics, namely, > (user-defined) functions are not introduced until chapter 11, fully 400 > pages into the book. This contrasts strongly with a traditional
<snip>
Pages 48-50 is a section titled: 'Functions' and he gives both a top level description and example. True he does not have a chapter devoted to functions still page 400, but he does give examples of usage along the way.
John Coleman wrote: > Greetings, > My copy of the second edition of Chun's "Core Python Programming" > just arrived from Amazon on Friday.
Who would you say the book is aimed at? Advanced programmers? I thought about getting it, but I'm not sure if it will be either 1) too much repetition of the basics I've already learned (which isn't necessarily a bad thing), or 2) too advanced for me right now.
John Salerno wrote: > John Coleman wrote: > > Greetings, > > My copy of the second edition of Chun's "Core Python Programming" > > just arrived from Amazon on Friday.
> Who would you say the book is aimed at? Advanced programmers? I thought > about getting it, but I'm not sure if it will be either 1) too much > repetition of the basics I've already learned (which isn't necessarily a > bad thing), or 2) too advanced for me right now.
> Thanks.
It strikes me as being aimed at intermediate programmers who don't have much familiarity with Python. I bought it since my only other book on Python ("Learning Python" by Lutz) is somewhat dated now and because I find that I'm a slow learner and it usually takes me a couple of books by independent authors to "get" a language. The publisher's page is more informative than what you see on Amazon. You can see the table of contents and read a sample chapter there to help you decide if the book is for you: http://vig.prenhall.com/catalog/academic/product/1,4096,0130260363,00...
John Coleman wrote: > John Salerno wrote: > > John Coleman wrote: > > > Greetings, > > > My copy of the second edition of Chun's "Core Python Programming" > > > just arrived from Amazon on Friday.
> > Who would you say the book is aimed at? Advanced programmers? I thought > > about getting it, but I'm not sure if it will be either 1) too much > > repetition of the basics I've already learned (which isn't necessarily a > > bad thing), or 2) too advanced for me right now.
> > Thanks.
> It strikes me as being aimed at intermediate programmers who don't have > much familiarity with Python. I bought it since my only other book on > Python ("Learning Python" by Lutz) is somewhat dated now and because I > find that I'm a slow learner and it usually takes me a couple of books > by independent authors to "get" a language. The publisher's page is > more informative than what you see on Amazon. You can see the table of > contents and read a sample chapter there to help you decide if the book > is for you: > http://vig.prenhall.com/catalog/academic/product/1,4096,0130260363,00...