Rob Pike’s Go Proverbs convey many elements of the Go programming language philosphy in a way that is approachable and fun. He compares with the game of Go, which is “easy to learn, and hard to master.” Inspired by the “Go Proverbs Illustrated” book about patterns in playing the game of Go, he crafted a set of proverbs about the Go programming language. His goal is that proverbs should be “short, poetic, general, about more than the Go programming language. Contradictory is OK. Life and programming are full of contradictions.” These are ideas to explain to beginners or maybe in a code review. He notes that there are probably many more. These proverbs seek to capture the ideas that make programming in Go different.

The proverbs with my notes from the talk are listed below. I also found a lovely post with code illustrations by Greg Osuri, as well as graphically illustrated deck with nice icons chosen from the noun project and if you have additional proverbs to suggest, there’s now a github repo.

“Don’t communicate by sharing memory, share memory by communicating”
Passing on a channel enables safe concurrent, even parallel operations.

“Concurrency is not parallelism.”
These are often confused by beginners. How these are thought of in the Go community is that they are important to keep separate. Concurrency is a way that you structure your program to make it easier to understand and scalable, and parallelism is simply the execution of multiple Go routines in parallel — somewhat a less interesting topic than concurrency.

“Channels orchestrate; mutexes serialize”
Mutexes are fine-grained and very small, and they tend to serialize execution. If you put a mutex on a variable, then only one thing can ever happen to that variable at any one time (and that is often very important, and sometimes exactly what you want). In the big picture of your program, channels give you a way to structure your program and arrange how the pieces work. As an example, how the “Select for loop” uses channels to orchestrate your program.

“The bigger the interface, the weaker the abstraction”
In Java, you think about interfaces having lots of methods. In Go, we have interfaces which are not declared to be satisfied, they are satisfied implicitly, but even more important is the culture around interfaces that is captured by this proverb. The smaller the interface is the more useful it is. This is a Go-specific idea, we want to make little interfaces, so that we can build components that share them.

“Make the zero value useful”
You want to make it so that you can use a type without initializing it (if you can).
For example: Bytes buffer or sync mutex — you don’t have to call an init function, you don’t have to call any methods. There is nothing wrong with calling a constructor, sometimes you need that; however, if you can avoid it to make the program nicer, it just means there’s less API there which is always a good thing.

“interface{} says nothing.”
When you are programming and have an empty interface, think very hard about whether that is really what you want…or whether there is just a little something that is really necessary to capture what you need. Sometimes you do need an empty interface, but it is rare. It is overused, especially by beginners. You see this in almost any question on stackoverflow in Go.

“Gofmt’s style is no one’s favorite, yet gofmt is everyone’s favorite.”
Experienced Go Programmers will say “I don’t like how it formats, but I really like that it formats.”
“A little copying is better than a little dependency.”
You can make your programs compile faster and be simpler if you keep the dependency tree really, really small. Sometimes you don’t need that whole library, you just need those three lines of code, that you can just copy and it’s fine.

“Syscall must always be guarded with build tags.”
Syscall isn’t portable — that is the point. If you import it, you must have a build tag for the architecture and operating system that syscall invocation is valid for. If you think you have a portable thing you are using the wrong package. Check out ‘os’ or something else.

“Cgo must always be guarded with build tags.”
Same as above. If you are calling C, god knows what it does! It’s very non-portable. It needs to be built for specific architectures and operating systems.

“Cgo is not Go.”
A lot of people in the early days would write about how a favorite feature of Go was how easily it connected to C, but lots of times it shouldn’t be necessary, it takes you out of the Go universe and you lose the benefits of Go if you are coding in C.

“With the unsafe package there are no guarantees.”
A lot of people use “unsafe” and then complain that things don’t work… that’s the point, don’t use “unsafe” unless you are prepared to have your program break one day.

“Clear is better than clever.”
Amen. There are languages that celebrate cleverness. Go celebrates simple clear code. The Go philosophy values code readability.

“Reflection is never clear.”
Common Stackoverflow question of people wanting to use reflect and complaining that it doesn’t work. It doesn’t work, because it is not for you. Very, very few people should be playing with this. Powerful, yet very difficult to use. We should encourage beginners to step away from using reflection and use the language proper.

“Errors are values.”
Beginners struggle with this. Too often people write “err != nil” — they think about substituting try/catch. Errors are just values…

“Don’t just check errors, handle them gracefully.”
Think about whether you should be doing something with errors. People are too quick to just return an error up the tree, instead of designing how it should work. A big part of writing good Go code is getting the error handling right up front. Of any program really, but its easier to program with errors as just values, and easier to do it gracefully.

“Design the architecture, name the components, document the details.”
Think of really good names for the pieces. If the names are good, the code will be easy to understand and the design will be clear inside your pogram, and programming your system will feel natural. Names should express your design.

“Documentation is for users.”
Think about what the function is for, not what it does. You want to write something that the programmer using your function will find helpful.

There is a tremendous sea of good will in the public to volunteer their time, energy, and services to support Veterans and their families. The Department of Veterans Innovators Network has a lengthy list of potential innovation opportunities to serve Veterans, ranging from developing reimagined service journeys for Veterans seeking mental health services to designing 3D printed personalized assistive technologies for Veterans with disabilities to developing a machine learning algorithm to scan retinal images to detect blindness in Veterans.

The question becomes: how to match the talents and spirit to serve of citizens of the United States with the opportunities and needs of employees within the Department of Veteran Affairs?

Our goal is to harness the ingenuity and brainpower of the public and pair this talent with projects in need across the Department of Veterans Affairs (VA). On the platform “Serving Those Who Served Us”, the public will be able to come for an “innovation volunteer tour” and collaborate with VA employees, Veterans, and Veterans supporters on a portfolio of innovation-related projects across the Department. These are short term projects ranging from activities that could take a couple hours to a couple months and are in need of the brain power + talent of innovators, such as designers, engineers, developers, entrepreneurs, and data scientists! Most volunteer activities can happen virtually with volunteers and staff collaborating from different locations.

This is how it will work:

  • VA employees will post innovation project opportunities on to the “Serving Those Who Served Us” platform. These projects will list out their problem statement, a short summary of the project, and the potential tasks for the project and skillsets needed.
  • External innovators can create a profile and browse opportunities to volunteer.
  • When the external innovator finds a project of interest, they can then contact the VA employee through the platform and they can begin conversations to work together!
  • External innovators can earn “badges” and recognition for volunteering their efforts to serve our Nation’s Veterans and their families! Also volunteers who volunteer often (and earn the most badges!) or get nominated from their VA employee will earn a special award from VA leadership!

To help accomplish this goal, the VA is partnering with the Open Opportunities team to develop this platform and working with a local high school to build this platform as part of a STEM student project. We are looking for a team of developer mentors to help provide guidance to this team of high school students in leveraging the open source code of the open opportunities platform to build this platform to serve Veterans!

Anyone interested in volunteering to mentor the kids? It could be completely remote, though if you are in DC, we could probably set up time for you to meet the students in person too. We’re kicking off the project on Monday, but the kids don’t start for two weeks. We’re looking for a few more Javascript developers to help. Feel free to contact me directly or reply on our mailing list.

The Open Opportunities project is supported by:

eagle image within a seal and golden banner
Presidential Innovation Fellows Foundation

blue cloud with number 9
Cloud9 IDE

Last week was a big week for me. I started a new job at Google and my kid graduated from high school. These big changes seem to have arrived all at once, though in reality change is constant.

I’ve spent a lot of time over the past 4 months reflecting on US Government transformation and the small, yet significant impact that one human can make. When I decided to leave at the end of my two-year term at 18F, I knew exactly what I wanted: find a group of smart, fun people who are trying to do something challenging, yet possible, that has the potential to make a big impact on a lot of people’s lives. I wanted to make (or improve) products for regular people. I didn’t need to save the world. I wanted something intellectually challenging that would let me solve different kinds of hard problems, the familiar kind that I’ve been solving my whole career.

At this point in my career, given my tech experience, folks think it is easy to find a job. And, yes, it is easy to find a job, but finding the job where I’ll be happy and be able to effectively apply my skills is hard. Those of us who don’t look like Mark Zuckerberg need to do a bit of homework to validate that we’re joining the right kind of team, and a company where you can be an effective leader and collaborate with difference. I knew the kind of people I wanted to work with, but was pretty flexible of the kind of tech, so it took a bit of research.

I started to get together with people I’ve worked with before who I respect and they introduced me to new people… in almost 5 months I only got about a quarter of the way through my list and met many more folks. To keep track of my random schedule of meetings and introductions, I started tracking everything in a spreadsheet… since December 26th, I’ve had almost 100 meetings or phone calls with 83 people, which led me to seriously consider 10 companies. I interviewed with 5 of them, had job offers from 3, and finally had a really difficult choice. This was actually my goal. I’ve never actually done this kind of job search before, but it is similar to how I usually approach hiring. I like to have good, tough choices.

On of the reasons the choice was hard was that I was biased against Google based on their hiring process. I still think their hiring process is a problem for them attracting and selecting the best talent, but having spent the last three years working for the federal government, I have a lot more empathy for large systems and organizations. I talked to a lot of people inside Google to assess their internal culture and the groups I considered joining. I found a lot of genuinely good and caring people who share my values about building great teams and creating great software. Also, after working for the federal government, I joke that I’m ready to join a small company, like Google, which is about half the size of the US Dept. of Agriculture.

In selecting a new job, I found that the journey, as well as the destination, helped me figure out some things that really matter to me.

An Open Source Project

I hadn’t really understood until last month that open source is not only something I believe is important for government services and non-profit work, but that I value how it enables me to work. I love the impromptu collaboration with like-minded strangers that happens when you work in the open.

Some time ago, Google quietly released Vanadium on github. If you search for it on google you find lots of information on the element which is an essential mineral in the lives of sea squirts.

sea-squirts

The technology emerged from a research group at Google, and allows for secure peer-to-peer messaging.

Connected Applications

Connected applications have become widespread in the last decade, with the rise of social networks, messaging apps, and online collaborative tools like Google Docs which let people see each others’ edits in real-time. For the convenience of developers, these online interactions require people to be connected to the Internet. We have transformed the Internet from a resilient, distributed network to a more fragile place where we all have to be connected via central servers. I love Google docs, and understand how powerful it can be to use in the classroom; however, I agree with parents’ concerns about privacy. There’s really no technical need to store all of our personal information in the “cloud.” Technically we could create local clouds, where information never leaves a classroom, home or office. This could have a significant positive impact for privacy, and also for the developing world where Internet connectivity is expensive, intermittent or simply unavailable. So, I guess part of me wants to keep trying to save the world, after all.

What’s Next

I’ll be leading a small team within the Vanadium group. For me, this connects to the work I was doing at the turn of the century with multiparty communication. Under-the-hood it’s a lot like what I was working on when we created the Flash Media Server, except it’s not focused on media, and it doesn’t require a server, and it has nothing to do with Flash. I have a lot of ideas about how technology can help humans connect with each other, and maybe I can help bring some of those to life… or, even more exciting, develop new ideas that make sense in this future we’re creating.

I just started at Google. I’m not sure yet whether all of my ideas align with theirs, but I can already tell that I’m joining an ambitious group of talented engineers who aspire to create a positive impact on the world. I’m looking forward to whatever happens next!