Version Control with Git, 2nd Ed. – Bring order to software development’s collaborative chaos – #bookreview #programming

Version Control with Git, 2nd Edition
Jon Loeliger and Matthew McCullough
(O’Reilly, paperbackKindle)

When I first took a job in software development, individual programmers controlled code versions themselves, and they jealously guarded their releases with back-ups on multiple diskettes – 5.25” diskettes. The real floppies. (Yep, I’m so old I actually worked with a few 8-inch floppies, too.)

It’s a different world now. Code for one project often is developed, modified, tested and controlled by groups of people, sometimes big groups. And many of those who work with the project’s code are scattered all over the planet.

Thus, maintaining version control and keeping good backups are major management challenges for software developers today. There’s no more going home after work with 10 big floppies in your briefcase as a hedge against your office burning down overnight.

Git is a popular, if somewhat difficult, tool for tracking, branching, merging, and managing code revisions. The authors of Version Control with Git favor the term “version control system (VCS)” for this and other software packages that perform similar functions. (“Source code manager (SCM)” is another popular label.)

In their updated and expanded 2nd edition, here is how they sum up the imperative for strong version control:

“No cautious, creative person starts a project nowadays without a back-up strategy. Because data is ephemeral and be lost easily—through an errant code change or catastrophic disk crash, say— it is wise to maintain a living archive of all work. For text and code projects, the back-up strategy typically includes version control, or tracking and managing revisions. Each developer can make several revisions per day, and the ever-increasing corpus serves simultaneously as repository, project narrative, communication medium, and team and project management tool. Given its pivotal role, version control is most effective when tailored to the working habits and goals of the project team.”

Whether you do or do not yet have experience with a version control system, you can glean important information and numerous useful tips from this book’s 21 chapters and 434 pages. Version Control with Git covers a lot of vital ground in a well-organized how-to fashion, with plenty of code samples and related illustrations.

One example out of its many key lessons: “As the developer of content for a project using Git, you should create your own private copy, or clone, of the repository to do your development. This development repository should serve as your own work area where you can make changes without fear of colliding with, interrupting, or otherwise interfering with another developer.”

In another key lesson, they show how to use git stash, “the mechanism for capturing your work in progress, allowing you to save it and return to it later when convenient….the stash is a quick convenience mechanism that allows a complete and thorough capturing of your index and working directory in one simple command. It leaves your repository clean, uncluttered, and ready for an alternate development direction. Another single command restores that index and working directory state completely, allowing you to resume where you left off.”

In a software development environment where everything is a crisis and priorities change hourly on what should have been finished yesterday, git stash save and git stash pop may become two of your favorite commands.

The book describes installing versions of Git for Linux and Microsoft Windows, and for running within Cygwin. It also can be run on Mac OS X and Solaris systems. Meanwhile, most of the book’s chapters focus on using the Git command line tool. But the new 2nd edition also devotes a chapter to what many Git users consider the most vital tool that has emerged from the big online community that now surrounds Git: GitHub.com.

Developers often clone a repository from GitHub. Several types of public and private repositories also can be created there. And so-called “social coding” is available. Indeed, many open source projects are hosted on GitHub, and some of them attract people who simply watch the coding, while others do coding in personal “forks” that may or not prove helpful to those more officially involved in the project. Yet another popular use of GitHub is finding useful code examples in particular programming languages.

Whether Git is in your working future or it’s already here, or if you’re still wondering if it can help you, definitely check out Version Control with Git.

Si Dunn

Think Python – A gentle and effective guide to learning Python programming – #programming #bookreview

Think Python
Allen B. Downey
(O’Reilly, paperbackKindle)

First, a confession. My favorite book for learning Python is Head First Python by Paul Barry. It literally does throw you head-first into Python programming. By page 10, it has you working with nested lists. By page 30, you are creating a function that you will save and turn into a module just a few pages later. By the time you hit page 50, you have learned how to upload code to PyPi. And, as the book continues, you keep improving and expanding the functionality of one project that stays in development from chapter to chapter.

That said, I hereby declare that Think Python by Allen B. Downey is my new co-favorite book for learning Python.  I intend to keep it handy right alongside Head First Python.

Just about anyone studying or using Python can benefit from having Think Python on their bookshelf, in their computer, on their mobile device or, better yet, accessible in all these places. It is an excellent reference book, as well as a clear, concise and calm how-to guide for beginning programmers.

Think Python takes a gentle yet effective approach to introducing and exploring the language one step at a time. First you learn some basic programming concepts. Then, 13 pages in, you start easing into the language at the level of “Hello, World!”, plus variables, expressions, and statements.

The 277-page book has 19 chapters that carefully explain and illustrate each key point, without overkill. The author is a veteran instructor of computer languages, and he also is the author of a well-known book that has been around since 1999, in one form or another: How to Think Like a Computer Scientist.

Think Python is an outgrowth of the Python version that book. Downey has added materials on debugging and other topics, plus some exercises and case studies. And he has gotten plenty of proofreading help from more than 100 enthusiastic followers of his writings and teaching.

What I like most about Think Python are its short, concise, clear explanations of each new concept and its use of very short code examples. When I’m in the mood to spend just a few minutes reviewing or learning a new concept in Python, I can open Think Python and quickly find a refresher or a new area to try out. Head First Python, on the other hand, suits me best when I have an hour or two to stay focused on reading, keying in a lot more code and making the required changes to the ongoing project.

One minor caution: There are differences – sometimes significant and sometimes merely irritating – between Python 3 and Python 2. Head First Python focuses on Python 3 code and Think Python uses Python 2 code examples. But Think Python’s author has been careful to minimize the conflict and explains what to do when using Python 3.

The main thing to remember is that the print statement in Python 2 has become print(), a function, in Python 3. So if, for example, the book’s code says print ‘Hello, World!’ and you are using Python 3, you type print(‘Hello, World!’), instead.

It’s not hard. But the opportunity to print or print() something does come up a lot in the text.

Si Dunn