Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×

Comment Re:Apartheid (Score 1) 591

I'm sick and tired of hearing these ignorant generalizations. Surely /. readership is composed of many geeks who get offended if you criticize their text editor, but can't they for once just pick up a book that has nothing to do with computers or Star Trek, so they become nuansed enough to not generalize the actions of some people in Saudi Arabia (yes, not all Saudis agree with their leaders actions), a couple of millions even, to the billion others who don't take that line and don't consider it a part of "sharia law"? When I lived in Iraq, women were fully involved in society and didn't suffer from these draconian rules. Of course, that was before the born-again-Christian leaders of the US and other "free" western nations destroyed it. In short, stop the hypocrisy, Saudi Arabia's leadership deserves our criticism. But if you're gonna make statement such as "Islam is terrible", you would have a better chance explaining your bigotry if you were to say "Christianity is terrible" or "the West is terrible" with which I'd take offense as much. It's not Islam that is terrible; It's this line of thinking no matter what religion or non-religion its supporters happens to profess.

Comment Re:sounds like a good "next step" book (Score 1) 65

...

I'm assuming the chapters are written so that you can "jump-in" without having to follow up the preceding material. I only question this point because the reviewer states: "His ideas flow logically from one to the next, incrementally building a story-like chain of problems and Python solutions."

Your assumption is correct. Naturally, in this class of literature, you expect the ability to random-access what you need. The logical flow refers to cohesive units of text that mostly span one chapter.

Book Reviews

Submission + - Core Python Applications Programming, 3rd Edition

thatpythonguy writes: "Prentice Hall publishers bring you a new book for the intermediate Python programmer, authored by a veteran engineer, author, and trainer. The book promises to answer the question "Now what?" of the budding programmer how has learned the language and is looking for avenues to apply that knowledge!

Review Text:
==========
Core Python Application Programming is the latest addition to a growing corpus of literature serving a growing number of Python programmers and engineers. This Prentice Hall book of 800+ pages covers some traditional areas and touches upon some new ones.

I typically do not spend much time speaking about the author of the books that I review; however, this occasion warrants an exception! And it is not because Wesley Chun used Python over a decade ago to build the address book and spell-checker for Yahoo! Mail nor is it because he holds a minor degree in music from UC Berkeley in classical piano. Rather, it is because he is both an engineer and an instructor. In other words, he was not pulled from his geek duties and asked to become a pseudo-writer; he already does that for his consulting practice, authoring (or co-authoring) several books and articles on Python (including "Python Web Development with Django") as well as starring in his own training video (entitled "Python Fundamentals"). The result of that experience is a writing style that is technically sound, yet accessible.

The book followed the normal evolutionary path of other books in its class. It started out as the second part of "Core Python Programming" and ended up being split into its own volume in its third edition. The first part became "Core Python Language Fundamentals" which covers the core language. This volume covers the natural successor topics of "now what?" that the first raises: the use of Python in various applications. It is for this reason that the book recommends that the reader be an intermediate Python programmer. I think "intermediate" here refers to anyone who has read an introductory book or followed a tutorial on the core language.

The book covers the two main lines of python development: 2.x and 3.x. Despite the slow adoption of the 3.x line due to its backward incompatibility, there are already popular third-party libraries that have been ported to that line and that occurrence will only increase moving forward. Chun does a very good job balancing the two by providing concurrent examples (i.e., code snippets) in both flavours. He also has numerous references and side notes indicating that certain features/libraries are only available for certain versions of the language.

There are three parts to the book: General Application Topics, Web Development, Supplemental/Experimental. The first includes the usual dosage of general chapters including regular expressions (regex), network programming (including an intro to the Twisted framework), Internet client programming, threading and multi-processing, GUI, and databases (including a taste of NoSQL). It is peculiar that it also includes chapters on Microsoft Office programming and writing Python extensions which are not general in my opinion. It is probably because these two chapters do not fit anywhere else! The second part is probably the core of Chun's own experience as he is a self-described "web guy". He certainly goes into details in that domain covering web clients/servers (yes, he writes a small web server!), general web programming (i.e., CGI and WSGI), the Django framework, cloud computing (mostly Google App Engine; GAE), and web services. Finally, the last part has two chapters on text processing and miscellaneous topics (basically, Jython and Google+). I find the naming of the text processing chapter rather poor given that it is about processing comma-separated values (CSV), JavaScript Object Notation (JSON), and Extensible Markup Language (XML). Arguably, "text processing" is more descriptive of regex, transcoding, and Unicode! Two appendices at the end of the book provide some background and a guide to Python 3.x migration.

Chun spends some time delving into a problem domain in addition to providing the Python solution. For example, he describes the regular expression syntax in detail and spends time explaining the client-server architecture using real-life analogies to drive his points home. His code examples are well-structured, object-oriented solutions that range from the demonstrative to the practical. For example, in the Django chapter, he builds a practical Twitter application that uses third-party libraries and some advanced features. However, do not expect a cookbook-style coverage nor production-ready code from a book of this nature. Do expect many exercises with partial solutions at the end of the book.

I find Chun's approach to be pedagogically sound. His ideas flow logically from one to the next, incrementally building a story-like chain of problems and Python solutions. He highlights architectural patterns that are shared by disparate problem domains (e.g., the event-driven nature of SocketServer and Tkinter), leading to a better understanding of both. However, he does leave out many topics from his coverage for applications in compression, cryptography, and date handling (among others). Maybe he considers these to be ancillary or simple enough to be looked up in Python's own standard library documentation. Also, as a Developer Advocate for Google, it is not surprising to see him cover the GAE in depth. Specifically, I think for anyone who is interested in running Django on the GAE, he can be an excellent (and accessible, by his own admission) resource. Google him (no pun intended!) to see his presentation on "porting" Django applications to the GAE.

Finally, the book is aesthetically type-set and is well-structured. I think that it has a wealth of well-written information that cover key areas of Python application development that will be useful to a broad spectrum of readers.

Ahmed Al-Saadi is a software consultant based in Montreal, Canada. He mainly speaks Python, Erlang, and Objective-C these days."
Book Reviews

Submission + - Core Python Applications Programming, 3rd Edition

thatpythonguy writes: "Prentice Hall publishers bring you a new book for the intermediate Python programmer, authored by a veteran engineer, author, and trainer. The book promises to answer the question "Now what?" of the budding programmer how has learned the language and is looking for avenues to apply that knowledge!"

Comment Re:serious factual inaccuracy (Score 1) 33

Granted, the choice of words is vague and the concept of coverage needs elaboration. Despite the distinction that is often made between the 2.x and 3.x branches, some features appear in minor versions belonging to each of them. Specifically, many of the features that were originally intended for 3.0 were back-ported to 2.6 as described in What's New in Python 3.0. In fact, there are library components in 3.0 that were later deprecated in 3.1!

I suppose I was paraphrasing the author's statement about his attempt to write future-proof code (as much as possible), so that most of the code could run unmodified or with minimal modifications. If you understand coverage as such, then there will be no confusion. However, if you understand coverage as the ability to write code that will readily run on both versions (having been tested on both), then you are right in pointing out the discrepancy.

As to the last comment, I surely did not go through an exhaustive proof-reading of the book à la peer review! I don't know about you, but I don't have that much free time to spare on such an adventure, so no, I didn't go through the 1300-page book, looking closely at the statements and library calls to know which versions of Python it covers (2.5, 2.6, 2.7, 3.0, 3.1, or a subset). My aim was to describe the structure of the book and overall place within the literature as well as the benefits that it may endow a programmer to carry out development activities.

Python

Submission + - The Python Standard Library by Example (solea-research.com)

thatpythonguy writes: "Addison-Wesley publishers bring you another Python book that strategically fits in between programming cookbooks and library reference manuals. It brings the Python standard library that much closer to Python programmers and helps make them more proficient in their trade.

There has been an explosion in the availability of published titles for the Python programming language in the past few years. This has been driven by the rising popularity of this multi-paradigm language that has proven useful in domains spanning web, games, graphics, financial, science, automation and others. Many large and small corporations, universities and governmental organizations are using Python in their respective fields with seeming success.

One of the main reasons for the success of Python is the quality, breadth, and depth of its standard library. Unfortunately, this library is not documented sufficiently in titles that serve as introductory or reference material due to the nature of introductory texts that deal with the basics; on the other hand, reference texts are often too concise and lack sufficient examples. The title at hand is a library-centric tutorial/reference that can be a great tool when you need to learn how to solve certain problems using Python.

The book addresses itself to intermediate Python programmers and covers versions 2.7 and 3.x of the language. Although an experienced programmer coming from another language can learn a lot about Python by reading this book, I personally favor the traditional top-down, gradual method of learning a new language which involves an introductory, tutorial-style, and verbose introductory book. However, realizing that others might not like my cup of tea, I can envision, for example, someone familiar with socket programming picking up this book and writing a network application without prior Python experience. He or she might still need to look up language features on the way, but that should not be too hard as the language is easy to understand and there is a rich library of on-line (and printed) content for basic language constructs.

This title comes in a hefty 1300-plus-page, soft-cover book (or eBook) that is organized around thematic grouping of library modules. The groups are: text, data structures, algorithms, dates and times, mathematics, file system, data persistence and exchange, data compression and archiving, cryptography, processes and threads, networking, the Internet, email, application building blocks, internationalization and localization, developer tools, runtime features, language tools, modules and packages.

Each group contains the relevant modules from the standard library. For example, the text group contains the string, textwrap, re and difflib modules. Each of these modules is briefly described first and then its use is demonstrated in various ways under an appropriate heading. For example, the socket module (networking group) has sections covering addressing, TCP/IP client/Server, UDP clients/servers, UNIX domain sockets and multicast, among others. The code is written in such a way as to focus on the topic being discussed while not overlooking good practices such as wrapping a socket connection call with a try/finally block to ensure that the connection is closed in case of error.

A more advanced module, that is also described in the networking group, is SocketServer. This is a higher-level (on top of the socket layer) facility that enables the creation of network servers (e.g., HTTP or AMQP). It is nice to see that the book demonstrates the creation of an echo server using this module while incorporating more advanced topics such as threading and asynchronous I/O which are necessities in real-life, production code.

Although the content covers quite a bit of ground that surpasses many other sources in terms of coverage, the Python standard library is so vast that any one-volume book attempting to provide comprehensive coverage will necessarily fail! Nonetheless, you will find at the end of each section pointers to other material such as on-line resources, RFCs, and related books that can be used for a deeper study of the relevant topics.

I think that the text could use some typographical features to enhance the clarity of the content. These include highlighting the code using indents or an alternative font to set it apart from the text that surrounds it as I found it hard to visually distinguish the two. The code should also have the name of the file at the top of the listing so that when that name is used subsequently to invoke the code, it would be easy to reference the file contents. Also,I find the general typesetting not as pleasing nor as easy to read as titles from certain other publishers. This latter point is somewhat subjective and, in any case, does not detract from the utility of the content.

Despite the caveat above, I have to say that I like this class of documentation that is between a cookbook and a reference manual. I find it useful that the examples are not so terse nor overly verbose. I also appreciate the quality of the code and the references for further readings. I think that this book fills a void that will make many Python programmers more proficient.

Ahmed Al-Saadi is the Principal Software Consultant for Solea Research, a software consultancy and development company based in Montreal, Canada. He spends his free time writing, contemplating software architecture and playing his Flamenco guitar.

"

Comment Re:beautifully type-set book? (Score 1) 163

Maybe I need to clarify the meaning of beauty here. It is not that the book is elaborate in its ornamentation. It's the beauty that stems from clarity. I find O'Reilly books to be the most readable due to their clear typesetting, so to speak. Furthermore, beauty is subjective to an extent that it is hard to call someone on his aesthetic preferences in the same way you can call him on facts.

Comment Re:Question: Who's making a living coding Python? (Score 2, Interesting) 163

I (the author of this review) use Python exclusively (if you don't count specialized and supporting languages). If you are looking for high-profile users, try Google. Python is one of three "officially supported languages" (the others being C++ and Java; "official" does not mean that other languages are not used!). I would guess that all other large software houses use Python somehow. Besides being a great language in its own right, it is a great systems/prototyping language! Also, it is perfect if you like to code without undue pain ;)

Comment Re:Monty (Score 1) 163

Why is there a rat on the cover of a snake book anyway? Perhaps O'Reilly already used a snake picture on the cover of some other book and they didn't wanted to confuse people by having 2 snake books?

Correct! O'Reily's Programming Python already has a snake! I suppose they decided to go with the snake's food.

Books

Submission + - Learning Python, 4th Edition

thatpythonguy writes: Learning Python is a well-written book by an experienced Python trainer that has served the Python
community well since the first edition was published in 1999. Now, at its fourth edition, this book by
Mark Lutz continues to arguably be Python's bible. This article reviews this edition of the book by
discussing the target audience, scope, content, and pedagogical features. It concludes by a
recommendation.

AUDIENCE
This book is addressed as an introductory text to programmers new to Python. Although people with no
programming experience are not discouraged from reading it, they are warned that time is mostly spent
teaching Python, not programming fundamentals. I agree with this picture, though from my own
experience and those of others, the book is equally valuable to more experienced Python programmers
both as a pseudo-reference and as an introduction to more advanced topics. The critical point here is
that the book does not make assumptions about educational or vocational experiences and provides many examples; this renders the book approachable by a large audience.

SCOPE
Both Python 2.6 and 3.x are covered in this edition. However, the latest 3.x line is considered the
reference from which variations in 2.6 are discussed when appropriate. This approach is logical; the
new Python 3.x presents a major change to the language, but is not sufficiently dominant to warrant
exclusive treatment.

This book discusses the Python language and excludes the
Python standard and non-standard libraries. The latter are discussed in other places including Lutz's
own Programming Python which stands at its third edition at the time of writing of this article. I
find this division necessary because of size considerations and, in fact, this division did not exist
in the first edition of the book! However, there is one topic that does not seem to fit the
language/libraries divide, and that topic is packaging and deployment.

I will argue that there are not many (if any) books that discuss packaging and deployment of Python
programs well. I will also argue that this topic should be included in the book being reviewed here
since it is so essential to real Python programming. Since Lutz discusses the Python runtime
environment, I do not think it detracts from the book's coherence to include a chapter on packaging.
It is possible that the proliferation of various packaging and deployment options such as distutils,
setuptools, pip, buildout, virtualenv, paver, fabric and others, is the reason for this exclusion. Or
it could be that these tools are in a state of major flux that any text will become quickly outdated.
If size is the reason for this exclusion, maybe Lutz or someone else can publish "Packaing and
Deploying Python" as a separate volume.

CONTENT
The book starts by building a case for the use of Python. Both the features of the language and its
prominent users are discussed to build credibility. Then, the runtime environment is discussed: how to
run programs in various ways on various operating systems and language interpreters.

Types and statements, which are at the core of any language, are discussed next. Notably, there is an
excellent discussion of the topic of iterators and generators (also discussed in a later chapter).
Functions, modules and classes are then introduced. The text also includes a discussion of general
object-oriented programming (OOP) principles which I find to be invaluable as it brings the topic of
classes to life.

Exceptions are introduced and discussed in detail. The placement here is appropriate since exceptions
are now objects in Python so classes had to be discussed first. This chapter should prove to be
especially useful for people migrating from other languages that do not have simple, yet effective,
exception-handling constructs.

Finally, four advanced topics are covered: decorators, Unicode, managed attributes, meta-classes. I
find the first two to be absolutely necessary for almost any system nowadays, even small ones! The
latter two are not as ubiquitous, but should be useful to more experienced programmers.

I should mention here that the discussion of the topics discussed above does not stop at the basics
but provides comprehensive coverage. This is evident in the discussion of concepts such as dynamic
typing, inheritance order, iterators, generators, comprehensions, and functional programming, among
many others. There is even an interlude on documentation and the pydoc library.

PEDAGOGICAL FEATURES
Like many programming texts, the book uses small programming examples (appropriately executed in the Python interactive shell). The small examples hope to capture the essence of the topic at hand, and
that, it does well within the limitations of a small-scale context. But this fourth edition adds a new
chapter on classes (Chapter 27) that contains a more realistic code example presented in a tutorial
format.

In addition to examples, each chapter ends with a summary of the chapter's content as well as a quiz
on that content. The quiz is immediately followed by its answers for easy reference. I have to admit
that I do not use any of these two features, so I will not be able to comment on their efficacy.

CONCLUSION
Like many O'Reilly books, this is a well-written, coherent, and beautifully type-set book. I highly
recommend it to anyone who wants to, or already does, program using python. It should help the novice in the transition to an excellent programming language or, otherwise, make an already familiar environment more powerful in the hands of veterans.

About the author: Ahmed Al-Saadi is a Software Analyst who works for a Montreal Python house. He wrote his first lines of code on a Sinclair ZX Spectrum+, though unfortunately not in Python at the time.

Slashdot Top Deals

For God's sake, stop researching for a while and begin to think!

Working...