Get Better with Golang: ‘Go in Practice’

Go in Practice

Matt Butcher and Matt Farina

Manning, paperback

Considerable planning, effort and care have gone into writing Go in Practice, a new Golang programming book from Manning and also available from Amazon.

The book’s structure and approach are both geared toward helping Go newbies move beyond the basics. The writing is clear, and the code examples are focused and not overly long.

Go in Practice opens with a concise refresher on the history, advantages and key features of Go. From there, the 11-chapter book moves into areas that include:

  • Well-rounded applications
  • An interface for your applications
  • Taking your applications to the cloud

In each of these major sections, the authors present some 70 useful and practical techniques, such as:

  • Avoiding CLI boilerplate code
  • Using multiple channels
  • Serving subdirectories
  • Incrementally saving a file
  • Custom HTTP error passing
  • Using protocol buffers

These and the other practical techniques are presented in Problem, Solution and Discussion format. And code examples illustrate (and allow you to try out) what is supposed to happen.

If you are still learning the Golang basics, make this one your next book. Stick with Go in Action or some other starter book, for now. But if you know the basics and are now eager to get more serious about learning and applying this versatile programming language, definitely check out Go in Practice.

If you already are using Go as a development language, it can’t hurt you to take a look at this how-to guide, as well. You may pick up some new and useful techniques.

The two authors, by the way, have been described as”key contributors in the Go ecosystem for years.”

— Si Dunn

 

 

Advertisements

‘Introducing Data Science’ – A good doorway into the world of processing, analyzing & displaying Big Data – #bookreview

Introducing Data Science

Davy Cielen, Arno D. B. Meysman, and Mohamed Ali

Manning – paperback

The three authors of this book note that “[d]ata science is a very wide field, so wide indeed that a book ten times the size of this one wouldn’t be able to cover it all. For each chapter, we picked a different aspect we find interesting. Some hard decisions had to be made to keep this book from collapsing your bookshelf!”

In their decisions and selections, they have made some good choices. Introducing Data Science is well written and generally well-organized (unless you are overly impatient to get to hands-on tasks).

The book appears to be aimed primarily at individual computer users and persons contemplating possible careers in data science–not those already working in, or heading, big data centers. The book also could be good for managers and others trying to wrap their heads around some data science techniques that could help them cope with swelling mountains of business data.

With this book in hand, you may be impatient to open it to the first chapter and dive headfirst into slicing, dicing, and graphing data. Try to curb your enthusiasm for a little while. Books from Manning generally avoid the “jump in now, swim later” approach. Instead, you get some overviews, explanations and theory first. Then you start getting to the heart of the matter. Some like this approach, while others get impatient with it.

In Introducing Data Science, your “First steps in big data” start happening in chapter five, after you’ve first delved into the data science process: 1. Setting the research goal; 2. Retrieving data; 3. Data preparation, 4. Data exploration; 5. Data modeling; and 6. Presentation and automation.

The “First steps” chapter also is preceded by chapters on machine learning and how to handle large data files on a single computer.

Once you get to Chapter 5, however, your “First steps” start moving pretty quickly. You are shown how to work (at the sandbox level) with two big data applications, Hadoop and Spark. And you get examples of how even Python can be used to write big data jobs.

From there, you march on to (1) the use of NoSQL databases and graph databases, (2) text mining and text analytics, and (3) data visualization and creating a small data science application.

It should be noted and emphasized, however, that the concluding pages of chapter 1 do present “An introductory working example of Hadoop.” The authors explain how to run “a small [Hadoop] application in a big data context,” using a Hortonworks Sandbox image inside a VirtualBox.

It’s not grand, but it is a start in a book that otherwise would take four chapters to get to the first hands-on part.

Near the beginning of their book, the authors also include a worthy quote from Morpheus in “The Matrix”: “I can only show you the door. You’re the one that has to walk through it.”

This book can be a good entry door to the huge and rapidly changing field of data science,  if you are willing to go through it and do the work it presents.

Si Dunn

Some Book Choices for ‘National Week of Making,’ June 17-23, 2016 – #books #WeekofMaking

The White House and the University of the District of Columbia are two of the sites helping spotlight the National Week of Making, June 17-23, 2016.

“America has always been a nation of tinkerers, inventors, and entrepreneurs,” a White House news release recently stated.

“Empowering students and adults to create, innovate, tinker, and make their ideas and solutions into reality is at the heart of the Maker Movement.”

Step Away from that SmartPhone and Make Something! 

Do you worry that your children or grandchildren now spend too much time messing with cellphones and game players and no time learning basic life skills such as how to work with tools to create or repair things?

Do you worry that you have become a slave to time-wasting digital distractions and have lost touch with how to make stuff, repair things or create something new from available materials?

It may be time to be come a maker, too, and an advocate for others who need to expand their horizons beyond the devices clutched tightly in their hands.

Some How-to-Make-Something Book Selections

In recognition of National Week of Making and the third annual White House Maker Faire, here are some books from Maker Media that can help you and others get into (or back into) the art, science and fun of making things and learning useful skills.

Start Making!

A Guide to Engaging Young People in Maker Activities

Danielle Martin and Alisha Panjwani

Maker Media, paperback, Kindle

Making is “the process of creating projects based on your ideas and interest,” the authors emphasize. “This Start Making! guide offers a series of creative do-it-yourself (DIY) projects that introduce young people to the basics of circuitry, coding, crafting, and engineering.”

Start Making! describes “a series of activity sessions that you can adapt to your situation” as an organizer and/or leader of activities for children and teens. “You can offer your own version of Start Making! activities in your home, at the library, at an after-school club, at the local community center, or anywhere else young people can gather to work on projects together.”

Tinkering

Kids Learn by Making Stuff, 2nd Edition

Curt Gabrielson

Maker Media, paperback, Kindle

Giving kids the time, opportunity and motivation to tinker with things (and make things from other things) can have big educational payoffs, the author, a science teacher, contends.

To the question “Are kids learning anything while they are having fun?”, he gives an enthusiastic and lengthy reply: “[H]eck yes they’re learning something, and it may be the most valuable thing they’ve learned all week, and it may raise all sorts of questions in their minds that inspire them to learn more about what they’re tinkering with, and it may start them on a path to a satisfying career, not to mention good fun on their own time, and it may put them in the driver’s seat of their own education by realizing their competence and ability to learn through tinkering, and they may begin to demand more of just this sort of learning opportunity.” Whew!

By the way, don’t just hand this book to a kid and say “Go have fun!” It is mainly written for adults who are willing to help children learn the joys of using their hands and minds to make stuff and try simple experiments.

 

Getting Started with 3D Printing

A Hands-on Guide to the Hardware, Software, and Services Behind the New
Manufacturing Revolution

Liza Wallach Kloski, Nick Kloski, and HoneyPoint3D™

Maker Media, paperback, Kindle

In a consumer-grade 3D printer, “thin strand of melted plastic is laid down, layer by layer, on a flat surface where it cools and hardens into an object,” the authors explain.

This book will not turn you into a manufacturing expert, but it does introduce major aspects of 3D printing and shows how to get started with computer-aided design (CAD) and 3D printing. It also introduces new makers to the two main types of consumer 3D printers: FDM, which use filament for fused deposition modeling, and SLA, which use resin for stereolithography.

Likewise, you learn the benefits of outsourcing your printing to firms with bigger, more expensive machines than a typical home user can afford. Meanwhile, consumer-focused 3D printing service bureaus offer another, less expensive choice. And you can have printing done by a local “hub” source, which may be one person offering to run your project on his or her 3D printer. In any case, you focus on creating a good design and uploading your files, and then your creation gets printed and shipped to you—or you go pick it up.

The book also covers topics such as what supplies you will need, how to get and use free 3D modeling software, how to correct mistakes in your models and prints, and how to lay out a 3D printing workspace.

 

Getting Started with Processing.py

Making Interactive Graphics with Python’s Processing Mode

Allison Parrish, Ben Fry, Casey Reas

Maker Media, paperback, Kindle

“Processing.py,” the authors explain, “is an interactive programming and graphics framework for the Python programming language.” This book shows how to create drawings, animations, and interactive images, even if you have never used Python or had any other programming experience.

Processing.py helps make coding more accessible to artists, educators, designers, and beginners. And the book can be used by children, teens, and adults.

Indeed, Getting Started with Processing.py is a good way to introduce a young person to computer programming, because the simple programs that are entered cause images to be created and objects to be moved. And the parameters of the images and objects often can be changed to create new effects.

 

Encyclopedia of Electronic Components

https://www.linkedin.com/in/sidunnVolume 3, Sensors

Charles Platt and Fredrik Jansson

Maker Media, paperback, Kindle

This final volume in the Encyclopedia of Electronics Components series focuses on a wide range of sensor devices that detect or respond to such factors as light, sound, heat, location, presence, proximity, orientation, oscillation, force, load, human input, gas and liquid properties, and electricity. The text describes what the sensors do, how they work, and how they can be used.

The authors note that many sensor devices previously were very expensive but “are now as cheap as basic semiconductor components such as a voltage regulator or a logic chip, and they are easy to use in conjunction with microcomputers.”

Si Dunn

Java Testing with Spock: A good (and sometimes Groovy) guide to using this powerful testing framework – #programming #java

Java Testing with Spock

Konstantinos Kapelonis

Manning, paperback

 

Spock, the author states, is “a comprehensive testing framework for Java (and Groovy) code that can help you automate the boring, repetitive, and manual process of testing a software application. Spock is comprehensive because it’s a union of existing testing libraries”—specifically JUnit, Mockito and JBehave. It also is influenced by several others.

What is Spock’s main advantage in test scenarios? “When things go wrong,” Konstantinos Kapelonis notes, “Spock gives as much detail as possible on the inner workings of the code at the time of the failure.”

Spock is written in Groovy, and just mentioning that language, as well as the Gradle build tool, may give a little heartburn to hardcore Java developers who don’t want to learn them. But others find Groovy refreshingly efficient and Gradle easy to use. In any case, using Groovy (and Gradle) with this book is “optional,” the author emphasizes. As noted in Appendix A, “It’s perfectly possible to use Spock in your Java project without installing Groovy itself.”

To emphasize that point, Kapelonis shows how to use Spock with the Maven build tool first, before he delves into how to use Spock with the Gradle build tool.

The book is divided into three major parts: (1) Foundations and brief tour of Spock; (2) Structuring Spock tests; and (3) Spock in the Enterprise.

Two appendices deal with installing and using Spock, plus getting your IDE set up, and using the book’s example files.

Java Testing with Spock is a comprehensive guide to learning how to do Java (and Groovy) testing with Spock, and it is generally well written and adequately illustrated.

I chose to try the Groovy-Gradle approach, with Eclipse as my IDE. And I did run into some awkward moments trying to get Eclipse Mars.2 to play correctly. The Groovy-Gradle plug-in from the Eclipse Marketplace was for earlier versions of Eclipse, and so was the Spock plug-in. After some tinkering and reconfiguring, I was able to get things working together and do some Java and Groovy tests. To be fair, I was doing this on a kludged-together Windows 10 machine that definitely is no development powerhouse. And I did not have time to try out the Maven approach, but I have used Maven in the past, and the author’s instructions and examples for Maven look solid.

Java Testing with Spock is a good, helpful how-to book for anyone who wants to know more about putting the Spock testing framework to good use at all levels of Java development.

Si Dunn

Manning’s ‘MongoDB in Action’ has been updated for version 3.0 – #programming #bookreview

MongoDB in Action, Second Edition

Covers MongoDB version 3.0

Kyle Banker

Manning, paperback

Yes, this updated edition of MongoDB in Action is aimed at software developers. However, the book wisely does not ignore those of us who are more casual users of MongoDB.

Indeed, this is a fine how-to book for MongoDB newcomers and casual users, too, particularly if you are patient and willing to read through an introductory chapter focusing on “MongoDB’s history, design goals, and application use cases.”

Many people, of course, just want to jump straight into downloading the software, running it, and playing with it for a while before getting down to any serious stuff such as application use cases. So this book’s Appendix A is the place to go first, so you can get MongoDB onto your Linux, Mac, or Windows computer.  Then, after MongoDB is installed, you can jump back to Chapter 2 to start learning how to use the JavaScript shell.

After that, things quickly  start getting more “practical.” For example, Chapter 3 introduces “Writing programs using MongoDB.” Here, Ruby is employed to work with the MongoDB API. But the author notes: “MongoDB, Inc. provides officially supported, Apache-licensed MongoDB drivers for all of the most popular programming languages. The driver examples in the book use Ruby, but the principles we’ll illustrate are universal and easily transferable to other drivers. Throughout the book we’ll illustrate most commands with the JavaScript shell, but examples of using MongoDB from within an application will be in Ruby.”

I won’t try to sum up everything in this well-written, 13-chapter book. I have used older, 2.X versions of MongoDB in MEAN stack applications. And, separately, I have worked a bit with Ruby and MongoDB. But in each case, I haven’t needed to learn all that much about MongoDB itself, mainly just ensure that it is storing data that can be accessed in the right place and updated, saved or deleted as needed. So this book, written for 3.0.X (and earlier and later) MongoDB releases is an eye-opener for me and one that I will keep around for reference and more learning now that I have upgraded to 3.2.

Part 1 of MongoDB in Action, 2nd edition “provides a broad, practical introduction to MongoDB.” Part 2 delivers “a deep exploration of MongoDB’s document data model.” Part 3, meanwhile, examines MongoDB “from the database administrator’s perspective. This means we’ll cover all the things you need to know about performance, deployments, fault tolerance, and scalability.”

The book’s author knows that readers with some MongoDB experience will not read the book straight through. Instead, they will tackle chapters in many different orders and will even skip some chapters. And this is okay. MongoDB in Action: Second Edition is a book many of us will be happy to have handy whenever we need to get a better grip on some new aspect of working with this very popular open-source document database.

One cautionary note: The author points out that “as of MongoDB v3.0, 32-bit binaries will no longer be supported.” Of course, some 3.X 32-bit binaries are still out there, and you can install them. But you will get a lot of warning messages from MongoDB. So, download a 64-bit binary if your system will support it.

Si Dunn

‘Spring Boot in Action’ can help you push aside the old drudgeries of configuring Spring applications – #programming #bookreview

Spring in Action

Craig Walls

Manningpaperback

If you have worked with the decade-old Spring framework, you know well that it has a long history of providing configuration headaches for developers. The new Spring Boot framework, on the other hand, literally brings much-needed simplification and automation to the process of using Spring. And it can put some refreshing fun back into application development.

“Spring Boot,” Craig Walls states in his new book, “is an exciting new way to develop Spring applications with minimal friction from the framework itself. Auto-configuration eliminates much of the boilerplate configuration that infests traditional Spring applications. Spring Boot starters enable you to specify build dependencies by what they offer rather than use explicit library names and version. The Spring Boot CLI takes Spring Boot’s frictionless development model to a whole new level by enabling quick and easy development with Groovy from the command line. And the [Spring Boot] Actuator lets you look inside your running application to see what and how Spring Boot has done.”

You do not need a lot of Spring experience to benefit from this book. You do need some Java background, and it is helpful to have used Groovy, Gradle and Maven a few times. But the book’s text is written smoothly, and it is well illustrated, with numerous code examples and a few screen shoots. So Java developers who are fairly new likely can use it and pick up new skills.

While going through the book, you develop a reading-list application using Spring Initializr, Spring Boot, Spring Tool Suite, and other tools. In the project, you “use Spring MVC to handle web requests, Thymeleaf to define web views, and Spring Data JPA to persist the reading selections to a database,” Craig Walls explains. Initially, at least, “an embedded H2 database” is employed during development.

Walls’s book is divided into eight chapters:

1. Bootstarting Spring
2. Developing your first Spring Boot Application
3. Customizing configuration
4. Testing with Spring Boot
5. Getting Groovy with the Spring Boot CLI
6. Applying Grails in Spring Boot
7. Taking a peek inside the Actuator
8. Deploying Spring Boot applications

Four appendices also are presented: Spring Boot developer tools, Spring Boot starters, Configuration properties, and Spring Boot dependencies.

Bottom line: with Spring Boot providing much of the heavy lifting, you likely will gain better feelings about the venerable Spring framework. You may even wind up with a healthy new respect for it. And Spring Boot certainly should add more years to Spring’s usefulness and viability in the marketplace.

Si Dunn

Attack of the Killer Parentheses: ‘Clojure in Action, 2nd Edition’ – #bookreview

Clojure in Action, 2nd Edition

Amit Rathore and Francis Avila

Manning – paperback

Clojure seems to be afflicted with a measles-like outbreak of parentheses, and it generally just looks strange to many software developers. And there’s a good reason for that, as this book’s two author point out in their recently released second edition.

“Clojure’s syntax is derived from its Lisp roots: lots of parentheses. It’s alien to most developers with experience in languages with Algol-inspired syntax like C, C++, Java, Python, Ruby, Perl, and so on.”

But Clojure also is an intriguing and powerful choice for many software development projects, Amit Rathore and Francis Avila insist. Clojure is “a functional Lisp on the JVM” (the Java Virtual Machine), and: “It is impossible to separate the Lisp, functional programming, and JVM features of Clojure. At every step they play on each other and tell a compelling software development story….”

I have been tinkering with Clojure on the side, at random spare moments, for more than two years, using a disorganized approach of looking at web postings, building and modifying simple projects that others have posted, and sometimes looking at Clojure how-to books as time permits.

From my perspective, Clojure in Action, 2nd Edition fills a beginner’s need for a friendly, well-organized approach to learning the language and putting it to work effectively. Developers already working with Clojure can benefit from having this book, too, as a handy reference. It covers a lot of ground, using reasonably short paragraphs and offers many short code examples to illustrate its key points.

Clojure in Action, 2nd Edition “assumes no prior experience with Lisp or with any functional programming language,” the authors emphasize. “It starts out with the absolute basics and slowly layers on the different features of the language in  a way to make it all fit together in an intuitive way. It takes a first-principles approach to all the topics, first explaining why something needs to be done a certain way, and only then talking about the Clojure way.”

Clojure is not a language for absolute beginners. The authors assume “you’re familiar with an OO [object-oriented] language like Java, C++, Ruby, or Python, but no background in Java, Lisp, or Clojure is required.” They also assume you have downloaded Clojure and gotten it working on your PC. You can read more about Clojure and download it here.

This expanded 2nd edition states that it covers the “new” features of Clojure 1.6. Of course, Clojure already is up to 1.8, but I have tried many of the code examples at various points in the book and have not encountered problems while running 1.8.

Si Dunn