February 2018: lightning talks and coding practice

Meetup #46. Please RSVP at Meetup.

We get started at 6:30 pm.

Sponsors

Venue provided by Startup Edmonton.

Lightning Talks

Peter Preeper's lightning talk, borrowed from a FOSDEM 2018 Go devroom talk by Fabian Wickborn, showed how to automate git bisect with a Go test. You mark a known good and a known bad commit, then write a TestMyRegression that fails on the bug and keep it in a dedicated _test.go file you don't commit yet. Running git bisect run go test ... lets Git test each candidate commit and reliably land on the one that introduced the regression. Once found, you reset to a working state and can commit the test so the regression is caught early from then on.

Key points:

  • git bisect finds the commit that introduced a regression.
  • Bracket the search with a known good and a known bad commit.
  • Write a failing Go test that detects the bug.
  • Keep the test in its own _test.go file and don't commit it yet.
  • git bisect run automates the search and reports the culprit commit.
  • Commit the test afterward to prevent future regressions.

Peter Preeper (slides)

Coding Practice

Bring a laptop and/or a friend. We will be working in teams, so deep experience with Go is not required.

Install Go on your laptop in advance or use The Go Playground.

The coding practice used the capstone exercises from Nathan Youngman's Get Programming with Go, a set of small open-ended programs meant to be solved in teams. They ranged from a Ticket to Mars random ticket generator and a Vigenère cipher encoder/decoder through temperature conversion tables and Conway's Game of Life to a Martian animal sanctuary simulation and a Sudoku rules validator. Each capstone rehearses core Go: variables, loops, functions, slices, structs, interfaces, and error handling.

Key points:

  • Work through open-ended capstone projects from Get Programming with Go.
  • Ticket to Mars: random tickets with fmt and math/rand.
  • Vigenère cipher: strings, runes/bytes, and modulus arithmetic.
  • Temperature tables: reusable functions passed as parameters.
  • Game of Life: slices, methods, and double-buffering generations.
  • Martian animal sanctuary: structs, interfaces, and a day/night simulation.
  • Sudoku rules: fixed-size arrays, pointers, and validation errors.

presentation

News

Events