In [2]:
name = "2019-11-21-become-a-10x-programmer"
title = "Become a 10x programmer, lessons from academia and industry"
tags = "optimisation, profiling, testing, version control"
author = "Anthony De Gol"

In [3]:
from nb_tools import connect_notebook_to_post
from IPython.core.display import HTML

html = connect_notebook_to_post(name, title, tags, author)

Anthony De Gol spoke to us about lessons learned form academia and industry on how to be a 10x better programmer with a few simple tools and techniques. Here are Callum's notes from the talk.

Anthony's recommendations fall into three broad groups:

1. Version Control

Use a version control system like git to keep track of your own work and collaborate with others. Tutorials abound

As well as helping you keep your work organised (no more data_process-ver2-final-improved-andy_edit-FINAL.py) git is an invaluable tool for collaborating with others. You'll thank yourself later!

UEA Python is managed entirely with git (including this website)

2. Unit Testing

Writing code that is easily testable makes for better code even before the tests are written. Your code will be broken up into managable, logical chunks. You don't need to go as far as test driven development, but think when you are writing code how you can make it easy to test.

Anthony recommends pyteest for Python

Good testing practices:

  • Minimise the iteration cycle: make short self contained functions that are easy to write tests for
  • Speed up debugging by using a subset of data to test
  • Use a debugger like ipdb

If you think tests waste time, try analysing invalid results for a month. Tests will save you stress down the line

3. The Functional Programming Paradigm

Exemplified by this talk by Rich Hickey

You don't neeed to do functional programming religiously (no need to learn clojure) but it's a useful paradigm to make your code modular and reusable

Miscellaneous advice

  • Use desciptive names for functions calculate_height_statistics(students) not do_suff(data)
  • If your function will alter the data you pass it (ie a text file or netCDF) end it with an underscore
  • Follow style guides like PEP8
  • Read people's code on github
  • Try pair programming
  • Get familiar with your IDE (try Pycharm)
  • Learn another programming language
  • Try rubber duck debugging
  • Get away from your computer. If you're stuck on a problem let your brain work on it subconciously. Go for walk, now's as good a time as ever (unless it's raining)

One idea that really stood out for me was that of cognitive resource. You only have a certain amount of ability to process cognitive tasks. The more you can smooth your workflow to simplify or remove complications, the more cognitive power you can bring to bear on your task objectives. The tools and techniques Anthony talks about all contribute to lessening of cognitive leakage, making your work simpler, better organised and more coherent.

This was my take on Anthony's talk, if you have anything to add, get in touch! You might even do a pull request on this repo with your added comments :) or drop me an email


In [3]:
HTML(html)


Out[3]:

This post was written as an IPython (Jupyter) notebook. You can view or download it using nbviewer.