More Related Content


The Lead Developer: Go – I made all the mistakes so you don't have to

  1. James Abley Technical Architect Government Digital Service @jabley
  2. GDSJames Abley Go – I made all the mistakes
  3. GDSJames Abley What it is, important concepts, what’s good and what’s not
  4. GDSJames Abley What is Go?
  5. GDSJames Abley Open source programming language that makes it easy to build simple, reliable, and efficient software
  6. GDSJames Abley Statically typed, with fast compile times
  7. GDSJames Abley Statically linked, native binaries
  8. GDSJames Abley What’s important?
  9. GDSJames Abley Communicating Sequential Processes
  10. GDSJames Abley Input Output Concurrency
  11. GDSJames Abley
  12. GDSJames Abley What’s good?
  13. GDSJames Abley Religious formatting wars
  14. GDSJames Abley The standard library defines AST parsing and serialisation
  15. GDSJames Abley Crossing Refactoring’s Rubicon
  16. GDSJames Abley Backward compatibility
  17. GDSJames Abley Testing
  18. GDSJames Abley
  19. GDSJames Abley Code coverage
  20. GDSJames Abley
  21. GDSJames Abley Benchmarking
  22. GDSJames Abley
  23. GDSJames Abley Profiling
  24. GDSJames Abley
  25. GDSJames Abley
  26. GDSJames Abley Garbage collection
  27. GDSJames Abley
  28. GDSJames Abley Ecosystem
  29. GDSJames Abley What’s not good?
  30. GDSJames Abley Dependency management
  31. GDSJames Abley Lots of community options, oh my!
  32. GDSJames Abley What’s the sweet spot?
  33. GDSJames Abley Summary
  34. GDSJames Abley Communicating Sequential Processes
  35. GDSJames Abley Great tooling
  36. GDSJames Abley /
  37. GDSJames Abley • parallel-programming.html 8
  38. James Abley Technical Architect Government Digital Service @jabley

Editor's Notes

  1. Hello, I’m James. A Technical Architect at GDS is the developer that goes to all the meetings. I work in the civil service, so a lot of you pay my wages. Thank you! If I’d know Ben was doing that, I would have used Emacs.
  2. Originally this was going to be a description of journey and mistakes I had made in my code. Less likely to offend people if I point out my own stupidity. Then I realised I had 10 minutes. Well, architects like to say that constraints are a good thing, so I've hopefully come up with a more useful thing in this way.
  3. The talk has 4 main parts
  4. Comes from the creators at Google sitting around waiting for C++ apps to build.
  5. Target Windows, OSX, Linux, Plan 9, Android, iOS
  6. So what are the core ideas in Go?
  7. CS paper from 1978
  8. Three main ideas Modelling computation as mutually cooperating processes which participate in events
  9. Go give you both. Concurrency via the goroutines in the language, which model a process, and the IO scheduler in the runtime which distributes those goroutines across all of the cores of the CPU. So in CSP, communication and synchronisation are equivalent. You communicate by passing messages, not by sharing memory.
  10. Go doesn’t have that. Why is that so good? That’s the interesting thing.
  11. There is a tool called gofmt which you run on your code. With that defined as part of the language, formatting arguments go away. No more fighting over style guides. But the other things this enables. Call graphs…
  12. Martin Fowler wrote a thing nearly 15 years ago. In it, he proposes that Extract Method is the minimum height requirement for being a decent refactoring tool. To implement extract method, you need an AST. The AST for Go is in the language. So tools can be written in Go to manipulate Go.
  13. Sun and later Oracle have worked really hard to maintain backward compatibility for Java. Guarantee for 1.x. It should just work. Go sidesteps this, by having tooling. gofix gives migrations for code
  14. As a modern language, Go has testing in the stdlib. Other libraries are available.
  15. Tests are fast. That’s a great feedback loop which doesn’t interrupt your flow
  16. You can also get code coverage, so that you get detailed information on what is being tested, and make sensible decisions about making the investment in tests.
  17. Here is an HTML version of the coverage, showing me exactly which lines are and aren’t tested. Although using red and green might not be great from an a11y perspective…
  18. Look at the ns/op Improved that particular bit of code by 20%
  19. What is dominating the runtime of my application? Where is all the memory being used?
  20. Recently released Go 1.5 introduced GC intended for next 10 years of hardware and beyond. Currently you might develop on a quad-core machine, and then deploy to 16-core machines in production. CPUs are only getting wider. Now concurrent, so reduces the time to do collections.
  21. Here is a graph showing garbage collection pauses over time. When your application is paused, doing garbage collection, it’s not doing useful work. This is Not Good. Pauses have gone from 300ms to less than 30ms
  22. Heroku has first-class support. Travis has first-class support. AWS has an SDK for it.
  23. So often language conferences will try to fill up the schedule to address the thing they’re most uncomfortable about. So Clojure confs have lots of talks about people running it in production (hi Bruce!)
  24. Most software developers don’t work at Google. Google has all source code in a monolithic repository. This works for them. Go is open source, and exists outside of Google. So the Go curators didn’t enforce Google’s conventions on the world. They’ve waited for people to explore the problem.
  25. There are a bunch of things (that work currently) Community have built their own. Not blocked on Google to innovate.
  26. Not a C++ killer, despite intention. People seem to be migrating from Ruby / Python instead. I think Rust is more likely to supplant new development for C++, see Dan's talk later. Emerging language for cloud infrastructure. Small tools that do one thing well. etcd. Hashicorp. Packer, Consul, Terraform. hub for Github, Heroku Toolbelt. CloudFlare.
  27. CSP is really powerful (and as someone that doesn’t have a CS degree, Comp Sci isn’t scary)
  28. Fantastically great tooling, which is getting better!
  29. We’re hiring!