Tuesday, June 30, 2009

Practical Programming: An Introduction to Computer Science Using Python

Authors: Jennifer Campbell, Paul Gries, Jason Montojo, and Greg Wilson
Format: Paperback, 350 pages
Publisher: Pragmatic Bookshelf; 1st edition (May 28, 2009)
ISBN-10: 1934356271
ISBN-13: 978-1934356272

According to wordnetweb.princeton.edu, Computer Science is "the branch of engineering science that studies (with the aid of computers) computable processes and structures". It's the study of computer architectures, languages, and mathematical structures as applied to the process of computing. So what have Campbell, et al produced in this book...a Computer Science textbook that teaches Python? Kind of. Imagine you wanted to learn how the computer is used in the various scientific disciples. Further, you wanted to learn how computer programs and programming is used in this context to construct tools, perform investigations, and to solve problems. You also want to use a single programming language as your example. Welcome to "Practical Programming: An Introduction to Computer Science Using Python". Not a book about learning Python as such, but an introduction to the discipline of Computer Science with Python as your guide.

Yes, it is a text book. Page 5 in the Introduction has a For Instructors section which should be a clue. Code samples and installation instructions for the class are available for download at the book's website. New as this book is, there's already entries in the Errata section, and as with other Pragmatic books, there's a discussion forum available for questions and comments, which will come in handy for teacher and student alike.

This really is a book that starts at the beginning, even to the point of describing a prompt in a python shell on page 9. Sections in Chapter 2 include Expressions and What is a Type, so the reader isn't presumed to know Python or programming at all. Like any other textbook of worth, there are exercises at the end of each chapter. Also like many textbooks, the information is presented in a rather "dry" manner, so don't expect to be entertained. Please keep in mind that this is a textbook and the target audience is a beginning Computer Science class. Class instructors are the most likely subset of the audience to be commenting about the book at this point, since they are using the book to educate their students in the fundamentals of Computer Science (which leaves me out since I'm not an instructor, but I'll do the review anyway).

The book doesn't contain any surprises. Ultimately, it teaches beginning concepts in computer programming and as such, takes the reader along the elements of learning programming. As I mentioned before, Python is the "example" language, but the student is really supposed to be learning programming principles in general, not just Python programming principles. I must admit that Python was a good choice for this task as a language to learn from, plus it has a great deal of power and scalability. Thus the Python skills learned by the student will serve him or her in future classes and in a programming career.

If you want to buy this book as an individual to teach yourself the content, it will still work, but you won't have the support of an instructor or a class. You can use the aforementioned discussion group at the Pragmatic site to ask questions and review any issues or shortcomings you discover (such as packages requiring Python 2.5 be installed on your computer in order to work).

Many of the programming books I review contain at least a little humor to help break the monotony of the topic being taught, but don't expect to get any laughs out of this book. Campbell and company have written this text to be "all business". If used in the classroom, the instructor or the resident "class clown" will need to provide any required distractions or levity. Perhaps this is because this book is for a beginning Computer Science class and needs to take itself very seriously. I suspect that the publisher imposed this style of writing as part of the requirements for this series. In real life, in sure the authors are very funny.

This is a beginner's book, so don't expect to learn everything there is to know about Computer Science or the Python programming language. It's just one class, intended to be taught in semester one of year one of a university student's academic career (though it could also be used in a High School class of similar nature). The later chapters do touch on Object-Oriented Programming, Graphical User Interfaces, and Databases, so by the end of the course, the student should be prepared to move on.

Appendix A is the book's Bibliography, so you can see the sources drawn upon and, if you're using this book independently, determine what other books you might want to add to your library. Many of the sources are other traditional textbooks, but a few are more widely used references such as O'Reilly's Learning SQL.

If you don't anticipate using this textbook in an Introduction to Computer Science class, but are intending to enter into such a program, this book would fit nicely in your summer reading list, giving you a leg up on the course work. Since a large part of what you are supposed to be learning is the process of computing, exposing yourself to the principles early can only help. That, and as a standard classroom textbook, is the best use I can think to make of "Practical Programming: An Introduction to Computer Science Using Python".

Friday, June 26, 2009

Review: Regular Expressions Cookbook

Authors: Jan Goyvaerts and Steven Levithan
Format: Paperback, 510 pages
Publisher: O'Reilly Media, Inc.; 1st edition (June 4, 2009)
ISBN-10: 0596520689
ISBN-13: 978-0596520687

According to Wikipedia, "In computing, regular expressions provide a concise and flexible means for identifying strings of text of interest, such as particular characters, words, or patterns of characters". If you even dabble in open source, shell scripts, and writing code, you are likely at least somewhat aware of regular expressions. Some people are even really good at using regular expressions, but this method can be a struggle for others. O'Reilly's Cookbook series offers over 100 "recipes" using regular expressions to solve common tasks. The question is, will this cookbook help you whip up the dish you need to serve?

I hate to cave in to the consensus of reviews on the web, but this book is hot! That said, there is a caveat. Despite the fact that the Intended Audience section of the book's front matter states the book is written for anyone who "regularly work(s) with text on a computer, whether that's searching through a pile of documents, manipulating text in a text editor, or developing software...", many of the people who are editing articles, books, or a web page source won't need or want to access the power regular expressions have to offer. Also, a large number of the book's recipes are written for programming languages or for web development, so to make the most out of this book, you'll need to be doing work in those areas.

I was a little surprised that the book didn't require any prior experience with regular expressions at all. It offers the reader a complete introduction from the first chapter on what regular expressions are, then proceeds to teach the basic skills in chapter two. I doubt it will replace O'Reilly's Mastering Regular Expressions but it might be a way in the "side door" of using regular expressions for someone who doesn't need to "master" this process.

For those of you who are programmers (which is most likely the majority of people reading this review), the content that will interest you starts in Chapter 3. Languages covered in the recipes includes .NET Java, JavaScript, Perl, PHP, Python, and Ruby. Regardless of your level of expertise, there's bound to be a recipe or two in this book that will make your life easier.

A regular expressions cookbook doesn't require that you be able to use this method "from scratch", any more than a food-related cookbook expects you to create a cheese soufflé from scratch. The "ingredients" are all listed, how they are to be mixed, the temperature of the oven, how long to bake, all the little details should be included. Of course, you'll need to know the difference between a cup and a tablespoon, and how to use all the tools typically found in a kitchen. The regular expressions cookbook is no different, except the ingredients and process aren't designed around food but rather text. You also have to know what task you want to perform and the cookbook must contain information on that task. If you want to make an omelet and your cookbook doesn't contain that recipe, you're out of luck. That's the limit of the Regular Expressions Cookbook. At least some of the recipes contained within its pages must apply to the tasks you need to perform. A random (I just flipped to a page) example is as follows.

In recipe 3.5 Test Whether a Match Can Be Found Within a Subject String, the problem is presented in summary and then the solutions are offered. In this case, the solutions presented are for C#, VB.NET, Java, JavaScript, PHP, Perl, Python, and Ruby. The discussion section talks about any additional information or special cases involved in any of the languages. In this example, discussion sections are available for each of the aforementioned languages. The reader is also referred to Recipes 3.6 and 3.7 for more information.

I just described the general formatting of recipes in any of O'Reilly's Cookbook texts and this is what you can expect when you use this specific book. If you want (and this is the way the common cookbook is used), just thumb through the table of contents or index to find the particular recipe you require and then have at it. Occasionally, a novice cook will consult the beginning sections of a cookbook to familiarize themselves with food preparation basics. If that's describes you relative to regular expressions, you'll find the early parts of the book quite handy.

Bottom line, I'd have to say that the Regular Expressions Cookbook is best used by someone who doesn't use regular expressions regularly (sorry), but whose work efficiency would be enhanced by using a regex engine. The types of recipes that are accessible through this book are also correctly "biased" to the audience, so you won't find that only one or two bits are useful while the rest are impractical or unrealistic for typical coding and text manipulation tasks. I'd have to say that authors Goyvaerts and Levithan and O'Reilly have hit a home run with this book.

Tuesday, June 23, 2009

Book Review: The Manga Guide to Physics

Authors: Hideo Nitta and Keita Takatsu
Format: Paperback, 248 pages
Publisher: No Starch Press (May 13, 2009)
ISBN-10: 1593271964
ISBN-13: 978-1593271961

"I can't change the laws of physics! I've got to have thirty minutes!" -Scotty

The aforementioned quote is from the original Star Trek series episode The Naked Time. As you may (or may not) recall, the Enterprise crew had become infected with a disease that did away with all inhibitions and good judgment, allowing everyone to express their deepest thoughts, feelings, and fantasies. Riley (played by Bruce Hyde) had locked everyone out of engineering so as "Captain", he could control the ship. He also unfortunately, turned off all of the engine power while the Enterprise was orbiting an ancient planet in the process of breaking up. When Scotty and the crew regained control of engineering, the ship was entering the planet's upper atmosphere and was minutes away from fiery destruction. Kirk wants the engines started NOW! but you "can't mix matter and antimatter cold". The "laws of physics" say so. Sure. Kirk, Spock, and Scotty get the engines started, invent the time warp, and all is right again, but just exactly what "laws of physics" was Scotty talking about? For that matter (no pun intended) what are the "laws of Physics"?

The answer to that question may not be easy to learn for some of you. Like electricity and databases, technical subjects aren't always effortless to grasp, let alone master. If you are an exceptionally visual learner, a dry textbook may not do you much good, especially if you are required to learn the content and demonstrate your knowledge (take a test) in a high school or university beginning Physics class.

Fortunately, once again No Starch Press has come to your rescue by publishing The Manga Guide to Physics (originally published by TREND-PRO Co., Ltd., Japan in 2006). If you're familiar with any of the other books in this series, you know that the lessons are told within the context of a story depicting the adventures of a hero or heroine, presented in "manga" or Japanese comic format. While this may seem amazingly frivolous to some of you, physics (or databases, electricity, statistics, and so forth) taught within the context of manga can be "distracting" in a good way, and there's no "law of physics" that says education can't also be fun. If the idea of learning while reading manga appeals to you or if you're just curious, this book and series could be the way to go.

A couple of things to keep in mind. First of all, this is a beginner's book, so you won't know everything there is to know about physics by the last page. It's just to get you started and to familiarize you with what probably are the topics in a "Physics 101" class at the high school or college level. Also, it's unlikely that an instructor of such a class will actually use this book (though I've been wrong before) to teach said-class. As with the other "Manga Guides" I've reviewed, this book seems best suited as a preparation text for a student who is looking forward to attending such a class (in the same way as he or she might look forward to having their fingernails pulled out by a pair of pliers and then crawling five miles naked over ground glass). If there's something that could give such a student a "jump start" on the coursework and ease the pain of transition, that something would be exceedingly welcome.

The book is divided into four basic sections or topics: The Law of Action and Reaction, Force and Motion, Momentum, and Energy. Unlike the prior two Manga books I reviewed (electricity and databases), the story isn't set in a mythical kingdom or a fantasy city, but rather in a "typical" (for a manga adventure) school. The authors have you follow the "adventures" of student and tennis ace Megumi who is a "star athlete" but hopeless when it comes to understanding physics (I'm sure you can see where this is going already). Fortunately Megumi befriends "physics geek" Ryota, who helps her leverage her understanding of sports in order to teach her how to pass her physics class.

As is consistent with this series, the book presents the "story" or scenario designed to teach specific principles followed by a more "factually" organized review section. As is consistent with traditional manga or anime, there's plenty of drama to be had, this time in the form of Megumi's rival Sayaka. If you are athletic or used to thinking in terms of sports metaphors, the book's storyline is an added bonus. Megumi's athletic performance, particularly on the tennis court, becomes dependent on her understanding of the physics she's learning for class. She has to think of learning physics in terms of the sports she plays. Also, like some students (or some people in general), when one area of her life has problems like her physics class, Megumi can't concentrate on any other area of her life, even tennis.

Although there are two authors listed, Hideo Nitta actually wrote the content while Keita Takatsu provided the artwork. As it turns out, Nitta is well qualified to write a book on physics since he's a professor in the Department of Physics at Tokyo Gakugei University and has published numerous papers and books on topics such as quantum dynamics and radiation physics. I don't know how the dynamics of creating this book happened, but I wonder if Nitta really did write the book creating the characters, dialogue, and situations or if he had help from Takatsu? If the former, I'll have to give special kudos to Nitta for not only knowing his topic (and with his qualifications, it's to be expected) but being a creative fiction and manga writer, too.

No, you won't learn about the physics of matter and antimatter and how to write a new start-up routine for a vintage 23rd century warp engine, but you will grasp the foundational basics of physics by the last page of this book. As with the occasional movie, there's a little "treat" waiting for you after the credits, or index in this case, just for one last chuckle (did I mention, this book is funny?). If you find yourself in need of a physics primer and traditional textbooks either send you into fits of anxiety or to the depths of boredom, give The Manga Guide to Physics a whirl. You might learn something and have fun doing it.

Oh, just a thought. I wish some writers of science fiction including those creative souls responsible for the most recent Star Trek film would read this book occasionally. For instance, in the film, when Chekov beamed Kirk and Sulu up to the Enterprise while they were in free fall, the law of the conservation of momentum says they should still have been falling when the materialized in the transporter chamber (causing a really big bang!). That said, my son theorizes Chekov used an inertial damper field to suppress this law during transport. Gee, aren't the (fictional) physics of the future wonderful...and convenient?

Monday, June 8, 2009

Front End Drupal: Designing, Theming, Scripting

Authors: Konstantin Käfer and Emma Hogbin
Format: Paperback, 456 pages
Publisher: Prentice Hall PTR; 1st edition (April 15, 2009)
ISBN-10: 0137136692
ISBN-13: 978-0137136698

The Käfer and Hogbin book isn't just a "how to use Drupal" book. There are a number of books that introduce Drupal in general (I put in the link just in case you need to know what Drupal is), including Using Drupal (O'Reilly) which I previously reviewed. According to this book's back cover blurb, "Drupal is now the world's number one content management system...As Web Designers and developers adopt Drupal, they need ways to quickly customize the visuals and interactivity with their sites." Is Front End Drupal then a book with just a focus on designing and managing themes, or is there more "under the hood"? Let's find out.

As always, my first question for a book is "who is it written for?" The back cover invokes "web designers and developers", which presupposes a certain skill set. The authors have backgrounds in both web development and Drupal, so that should also be a clue. That said, I didn't find a section in the front matter of the book saying "this is the book's audience" or similar text. The context of the book will have to do, but who the book is created for should become fairly obvious early on.

The first page of the Forward states the basic problem and thus, the reason this book was written. Apparently, Drupal sites "out-of-the-box" are "ugly". Further, Dries Buytaert (Drupal founder and project lead) says "...creating a Drupal theme isn't always easy. It's a crosscutting experience that requires a lot of diverse skills and utilizes expertise in XHTML, CSS, JavaScript, and PHP..." That should be enough to define the target reader of this book, at least as far as what you have to know to utilize this text. Chapter 10 is an introduction to jQuery, further narrowing the focus, at least as far as JavaScript libraries are concerned.

Chapter 1 starts out with a lesson on how basic web design integrates with Drupal. No, it's not an XHTML/CSS primer. You are supposed to know that stuff already to be able to utilize this book, but the authors do suggest here that you access those skills when mapping out the design of your future Drupal site. They do include resources such as Zen Garden and W3Schools.com's CSS Tutorial for those who might need to brush up in that area, so it's not like you have to be a total guru. I found this interesting because, as I moved through the book, I found that being a guru helps a lot, but more on that in a minute.

Theming tools and strategies are added onto this "gentle introduction" and the more formal introduction to Drupal begins, including JavaScript, PHP, and the Drupal API. The mechanics of creating a Drupal theme are presented as early as Chapter 3, including more online tutorials and code examples in the book. This is where your coding experience starts to be needed. A basic understanding of at least XHTML, CSS, and PHP is required from here on in. I say "at least", because the book will not hold your hand as far as learning these technologies is concerned and even then, I don't think just "basic" skills are quite sufficient. The way the topics are presented doesn't seem to be quite "even" and I really think a lot of prior web design/development, and even some prior Drupal experience helps in having a good reader experience.

In fact, if this book was my introduction to Drupal and I had no other experience with this platform or with other Drupal books, (even if I was well versed in the underlying technologies), I can see myself getting lost somewhere in the first third of this text's pages. If I was expecting a "total newbie's" book, I'd probably write a review slamming the authors for getting me in too far over my head. Do not, repeat, do not use this book if you have no experience with Drupal at all. Even more, do not use this book if you have little or no experience in web development. This book is best used by people who are (despite the resources presented in Chapter 1) well versed in how to design websites. If you work in a content management firm, you are probably ideally positioned to use Front End Drupal.

The book's Appendix describes how to install Drupal, if you don't know, briefly discusses LAMP/XAMPP, and provides equal time for Windows, Linux, and Mac OS X as OS platforms. A "value added" piece is the book's support website which has the sample code included in the book available for download. There's also an errata page for the first printing of this book, so you can check if any issues or errors you come across have already been dealt with. Contact the authors if you come across something new. I'd suggest downloading and configuring Drupal up front and learning basic Drupal from a book like O'Reilly's Using Drupal before digging into Käfer and Hogbin's Front End Drupal. Save yourself the aggravation (or the temptation of writing a "negative" review on this book) of trying to follow along with this book if you don't have a Drupal background already. Those of you who do know Drupal and know web development, have fun.

Wednesday, May 27, 2009

Review: The Twitter Book

Authors: Tim O'Reilly and Sarah Milstein
Format: Paperback, 240 pages
Publisher: O'Reilly Media, Inc. (May 26, 2009)
ISBN-10: 0596802811
ISBN-13: 978-0596802813

This book is marketed to everyone who uses or wants to use twitter with an eye on being popular, either personally or professionally. I don't mean that in a frivolous way. Twitter has become an important tool for self-promotion of individuals and businesses. OK, I doubt that Bill Gates worries that the number of followers he has in any way affects Microsoft's profit margin (actually, I can't find the "real" Bill Gates on twitter, but there are a number of "parody" profiles with his name on them), however there are a number of "big bananas" on Twitter who tweet regularly for more than just a lark (if you'll pardon the "bird" metaphor).

According to twitterholic, the top 20 twitter users include Barack Obama (number 1.), DowningStreet (number 2.), The Onion (number 6.), Guy Kawasaki (number 12.), and ESPN Headlines (number 15.). Adam Ostrow (alias @mashable), states that twitter saw a massive 752 percent growth in 2008 with no end in sight. All this would seem to indicate that twitter is "where the cool kids hang out". Reason enough to at least consider O'Reilly's and Milstein's book if you want to know more about twitter than just its name.

The Twitter Book is easy to read in the extreme. It's general format is less like a standard book and more like an instruction manual "for dummies". I don't use the term "dummies" in the pejorative sense, but to indicate that the content is designed to be accessible to the widest possible audience. The book in fact, starts out with answering one of the mysteries to twitter newbies: what is a hashtag? The answer on page 3 is only a brief mention and suggests the reader will learn more in Chapters 1 and 3, but it is one of those little details that makes tweeting less than easy to understand.

The actual Introduction section doesn't start until page 5 and goes into a brief history lesson of what twitter is and where it came from. As the reader moves through the book, screen captures abound. Text per page is large and limited, so like twitter tweets themselves, information is presented only in small, bite-sized, bits (although there are more than 140 characters per page, fortunately).

Pages 9-17 address what a lot of people might want to know about twitter: What's it good for? Turns out "ambient intimacy" is the number one use (at least in terms of being presented first in the list) of twitter; having "lightweight but meaningful" conversations. My personal opinion is that not all tweets are "meaningful", but they certainly are lightweight. If you can talk like a T.V. sound byte, you can successfully tweet on twitter.

Chapter 1 gives the reader the basics required to get started using twitter (which at ground level, isn't really such a chore). If you've created a personal account on any social networking or similar site, you can create a twitter account. Of course, there are probably people who would use twitter who might not also use Facebook, MySpace, and so on, so including such basic instructions is a good idea. Since attracting followers is a main goal, page 23 covers creating a "compelling profile"; something that will draw others to you. I've been using a lot of twitter-specific terms in my review thus far and, if you're not familiar with twitter, you may be having difficulty following some of my content. Fortunately, page 25 defines the term "following" and many more "jargon" definitions follow.

Believe it or not, compressing what you want to say into 140 characters (including spaces) isn't always easy. The book provides helpful little hints (everything seems diminutive when describing twitter) on how this is accomplished. The long and the short of Chapter 1 will get you going quite well as a twitter user, but wait! There's more. Chapter 2 covers a variety of twitter related tools including search, finding people, following trends, and twitter clients for the desktop. TwitterGadget, the client I use (on Ubuntu) wasn't present, but it may not have been available when the book was being written.

Chapter 3 goes to the heart of the matter: getting followers. Actually, the chapter talks about getting "great" followers, and tells you to get great followers, you need to be worthy of being followed. I thumbed through the basic suggestions and I probably don't follow a lot of them. I tend to either tweet too little (when I'm busy on projects) or to tweet too much (which is often). I suppose that's one of the reasons I don't have as many followers as the "big kahunas" (though I'm sure there are many other reasons). Of course, you have to really care about the number of followers you have for this to be important to you but then, isn't that part of what twitter is all about?

Chapter 4 describes how to use twitter to promote your blog, website, events, and so on; using twitter as the link or lure to get people to enter the rest of your world. Chapter 5 emphasizes making twitter "personal" rather than tweeting dry, informational updates. The idea is that people will be more likely to follow you if you come across as a real human being (and there are bots on twitter). On the other hand, a large number of tweets about what color socks you're wearing or what you had for lunch can get a little dull. Chapter 6 presents data on using twitter to promote your business. This may be especially interesting to you if you have a small business you are trying to grow or are just launching a start up and are trying to attract some buzz.

All in all, a worthy book though somewhat "lightweight" and definitely written with the traditional "end user" in mind. You may not end up reading the whole book and instead just focus on the parts of interest, though it's only 240 pages long and, with the large-print formatting and large number of images, it takes no time at all to burn through this work, cover to cover.

If you are both interested in twitter and interested in the authors, you can follow them on twitter: Tim O'Reilly (@timoreilly) and Sarah Milstein (@SarahM) both tweet regularly. For that matter, your humble reviewer is @jamespyles on twitter. If you've heard about twitter and want to learn more, you can find out all the basics of the application and how to use it within the pages of this book. I wouldn't say it contains any amazing secrets, but it is a good, common sense primer for becoming active in twitter. Happy tweeting.

Thursday, May 21, 2009

Yom Yerushalayim Parade going through Damascus Gate

Long live the City of David

Yom Yerushalayim Parade going through Damascus Gate on Twitpic

Friday, May 15, 2009

Learn to Program, 2nd Ed: A Book Review

Author: Chris Pine
Format: Paperback, 200 pages
Publisher: Pragmatic Bookshelf; 2nd edition (March 28, 2009)
ISBN-10: 1934356360
ISBN-13: 978-1934356364

Amazingly, this is a "how to program" book that doesn't use JavaScript as the first programming language the newbie experiences. I'm intrigued. Of course, it's a second edition, so using Ruby isn't exactly new for the new person. I never read the first edition, so I'll have to rely completely on the text I have in my hand (uh...sitting beside me, since I'm keyboarding with my hands). Just looking at the TOC, I already like the book, since the "Getting Started" chapter includes how to get started using Windows, Mac OS X, and Linux. Truly an equal opportunity author.

The first section of the Introduction showed me that author Chris Pine (as far as I know, no relation to the actor playing James Kirk in the current Star Trek film) is a person after my own heart. He compares the writing of instructions on making a PB&J sandwich to writing a computer program. One of my "issues" is writing good tutorials for the correct audience. The instructions on how to make a PB&J sandwich differ, depending on if your audience is a 5 year old child vs. a 35 year old adult, for instance. I heard something of my own "voice" in those particular paragraphs, as Pine outlined the set of instructions pretty much the same way I would.

Pine almost immediately answered one of my questions (Why Ruby?) in the Introduction. The answer is completely pragmatic: "Ruby programs tend to be short". He compared the same task written in Java and Ruby. Ruby was just a little "blip" compared to the several lines of code Java required to do the same thing (print "Hello Word", as if that were inventive). In the "Getting Started" section, I ignored the instructions for installing a text editor and Ruby for Windows and Mac, and honed in on Linux. Easy stuff. Everything was already on my Ubuntu box. Time to move on to the first lesson.

You can just about blink and be 4 or 5 chapters into the book. The tutorials for beginners are written in more less the same way, and with the same sort of problems as a lot of other beginning programming books. Integers, floats, strings, and variables are all delivered in short order. What's nice is that Pine's writing style is friendly and easy to read, and each of the beginning chapters are relatively short. This makes the learning, particularly for the programming newbie, go by fast and gives the sense of quick and easy learning early on. Of course, while you may cruise through the first 4 chapters at warp speed, Chapter 5 starts only on page 25, meaning you have a way to go before getting through all the material.

I noticed a few, very minor omissions (actually, one "omission" was explained, and was only an omission in the instructions if the reader didn't actually read Chapters 1 and 2). One exercise in Chapter 5 required the reader to increment a value by one, which hadn't been illustrated in the chapter material. On the one hand, if you have any programming experience, you can figure this out on your own. If not and it stumps you, the answers are easy enough to find in the Appendix. Pine made a point of saying the book was spawned from an online tutorial in part, because of the amount of emails he received citing various omissions. From that point of view, I can see that this book has been very finely honed from its earlier incarnations, including the first edition in all likelihood. That said, this particular bolt could have used a bit of tightening, but it was one, small bolt.

One of the things that's different about Pine's book is that he explains technical terms and concepts as he goes along. Most books define terms such as "methods", "strings", "objects", and so on separately and then illustrate their use in examples. Pine often has the reader perform various tasks using methods, objects, and variables either without explaining what they are, or explaining them during the actual tutorial. He "took a breath", so to speak, at the beginning of Chapter 6 and more specifically defined what methods are. This is probably good for the reader who wants to get his or her hands dirty right away, but it's important to not only be able to write code and understand why it works, but be able to understand what different parts of a program are called. This is the language used by programmers to speak with each other about how code works. I'm relieved that Pine doesn't spend a ton of time defining his terms before getting to work, but still, the reader will really need to pay attention to pick out these little tidbits nestled in the text.

The first 6 chapters of the book are pretty much a basics primer with no surprises. What you put in to your small, newbie programs is just what you get out. Pine introduces how to write an interactive program with Chapter 7, which starts the second half of the book. I noticed that the exercises at the end of Chapter 8 asked the reader to use what they've learned, not just in the chapter, but in prior chapters (the question was implicit though, and I would have preferred if Pine had spelled it out). Not enough tutorial books do this or at least, they don't do this well. Stuff you learn in prior chapters doesn't get practiced in subsequent chapters usually, so the reader forgets about them. You can't learn to program (or to do most anything else) unless you are constantly using what you've newly learned and then adding all that to what you're learning now. Kudos to Pine for this.

Pine's tendency to define terms as he goes along, which I mentioned earlier, can get a little muddy at times. For instance, in Chapter 9, he starts out by describing and illustrating local variables without letting the reader know there's such a thing as global variables. You can still follow along and pick up the gist of the chapter, but it would have helped if Pine would have just defined the terms straight out here. There are several other places in the book where, if you aren't paying attention (a highlighter sometimes helps), you could miss out encapsulating the conceptual bits of the book into your memory.

Having said all that, you also encounter another real conceptual explanation (they're rare) of local variables in Chapter 9 (particularly in the section "Experiment: Duby"; Pine has a definite sense of humor and it's evident throughout the book). I have to admit that I was a little surprised I could take my hands off the keyboard for 3 pages and just read something. No complaints either way, but the book was just so "hands on" (excepting that small bit in Chapter 6 I previously mentioned) up to this point. This is proof that explanations are necessary from time to time, and Pine does include more of these narratives as the book progresses.

The author "declares" the readers as a "programmers" if they've made it to the beginning of Chapter 10. I suppose it depends on how you define "programmers", but I wouldn't get terribly excited if you find yourself staring at Chapter 10. You're not ready for your first programming job yet and, you can't do anything "practical" with Ruby yet (think of a real world problem that can be solved by writing a program...can you write that program yet?). Pine seems to be doing two things here. First, he's bolstering the reader's confidence and re-enforcing that the reader really has learned "stuff". Second, he's declaring that the reader has in fact, gone through the bare bones basics of learning Ruby. Actually, most of what the reader has learned at this point applies to many programming languages (methods, variables, and such). This is good and a step in the right direction, but don't abandon the rest of the chapters. It's more than just fluff and in fact, Chapter 10 is pretty much "review". As I said before, I approve of review.

Even by the end of the book, the reader can't be expected to write programs in Ruby equal to a professional programmer. This book pretty much gets the reader's feet wet and that's about it. This is no insult to the author or the book. In 200 pages (actually, the practical instruction ends at page 149), I wouldn't expect any book to provide a complete programming novice with that level of expertise. Chapter 15 covers where the reader can go to look for help in expanding their knowledge of Ruby or just getting out of a jam. The first suggestion is to consult irb, which should have been installed when the reader installed Ruby. Since my Ubuntu 8.04 computer had Ruby already installed, I followed the instructions to invoke irb, but discovered that I needed to install it separately. No worries there. It was just a sudo apt-get install away. Pine also provides a couple of online resources and, I presume as a last resort, he put his email address on the final page of the chapter. As my last resort, I Googled "ruby forums" and discovered there's quite a bit more online than listed in Chapter 15. Once you get to this point in the book, explore the "interwebs". Of course, there are always other books after this one, depending on where you want to go next (Pragmatic's list of Ruby and other programming books is found after the index in this book).

I noticed that there was no accompanying CD/DVD, which didn't break my heart, but there was also no website listed in the book to support what the author has written. In other words, there's no place (at least no place stated) to go to get the code samples used by Pine, and being able to download a book's code samples from the web is fairly standard for programming books. I thought about this for a second and realized there was nothing really lost here. First off, the code used in the book isn't incredibly long or complex, so the reader doesn't have to keyboard his or her fingers to the nubs performing the exercises. Second, the only way to learn to code is to code, so it's good practice for the reader to write each program listed to hone their newborn skills. Since this book started out as an online tutorial, I did wonder though if Pine had maintained anything online to augment his writing? The answer (though not in the book) is found at The Pragmatic Books for this book. Probably the most valuable resource is the Discussion Forums for this book. There, readers have already asked questions and the author is quite interactive with them.

What I came away with is a basic understanding of the principles of programming, which I recognized from other languages. I also came away with an interest in learning more Ruby. It's actually a pretty good language for learning programming, which I hadn't previously considered. It's also in wide use in the industry and who hasn't heard of Ruby on Rails (though the "rails" part is yet to come)? Regardless of your motivation for learning basic programming, I think Chris Pine's book does a fine job as an introduction. It's basic, fast, and funny, and while not revolutionary, Learn to Program will definitely get you started in the right direction.