Monday 6 February 2017

Writing, Teaching, and Reading

I haven't posted here for a while. This is mainly because I discovered that there are various places, such as Digital Ocean, Codementor, and Compose.io, that are actively looking for technical articles and tutorials. Writing for these sites means that my work ranks higher on search engines and reaches more people. It also means that I can keep buying food in this expensive place I recently moved to (The Netherlands).

I've also started one-on-one mentoring through Codementor. This involves me helping people learn to code via video chat and screen sharing. I've found it thoroughly enjoyable so far, with the only slight downside being that there are many requests from people going "Do my homework that's due tomorrow. I'll pay" and it's sometimes difficult to filter these out from the people who actually want to learn.

I learned that the Dutch don't really believe in Christmas vacation (or vacation at all for that matter), but I stole some time and went back home to visit my family for a few weeks. I'd forgotten that they all go to bed at about 9pm every night, so I got a good amount of reading in too, which reminded me how gratifying it is to read books as opposed to the online media (which is much easier to habitually consume).

Writing


There's been a Chatbot hype recently. I think it'll follow a similar pattern to the mobile app hype (no one needs them, then suddenly every tiny business needs one, and then people kind of forget they they ever existed apart from one or two like Google Chrome and Gmail). That doesn't mean that they aren't fun to build though, so I wrote a series of tutorials on building very simple Telegram Chat Bots from scratch. You can find Part 1 here https://www.codementor.io/garethdwyer/building-a-telegram-bot-using-python-part-1-goi5fncay, which links to Part 2. (Part 3 is in the form of an unscripted video where a bunch of stuff goes wrong, so I'd steer clear of it if I were you).

I also wrote an article about using SQLAlchemy which you can find here: https://www.compose.com/articles/using-postgresql-through-sqlalchemy/. Like the Chatbot ones, it's very beginner focused. While I was learning how to use SQLAlchemy, I really wanted a tutorial with some uber-basic examples and couldn't find any nice ones, so I hope this one fills the gap.

Teaching


As I mentioned, I've been teaching through Codementor. I also ran a brief set of (in person) Python sessions for some language students who got thrown in the deep end of a short Python course. I realised two things: 1) I enjoy teaching; 2) I'm not very good at it. I think one of the strangest parts of modern academia is that lecturers are expected to able to teach through some kind of teaching osmosis absorbed from the walls of academic buildings. Most lecturers are never taught how to teach, or even assessed on their teaching ability (with their research and publications CV being what gets them the job). Teaching is a skill that requires practice and iteration. I'm hoping to learn this skill over the next few years, and I'm planning on doing this by teaching through platforms like Code Mentor, teaching people face to face when the opportunity arises, and making instructional videos. I've applied to author some instructional videos for PluralSight, and have started trying to learn my way around Camtasia.

Reading


The three most interesting books I read over the Christmas holidays were:
  •     The Righteous Mind: Why Good People Are Divided by Politics and Religion by Jonathan Haidt
  •     Being Wrong: Adventures in the Margin of Error by Kathryn Schulz
  •     On Writing Well by William Zinsser
Haidt's title is long enough that the book doesn't need a summary. The idea that I found most enthralling is his breakdown of morality into dimensions. After carrying out several studies across ages, backgrounds, and cultures, asking people about moral and immoral actions, Haidt defines the following dimensions of morality (cribbed from the Wikipedia article here: https://en.wikipedia.org/wiki/Moral_foundations_theory)
  •     Care: cherishing and protecting others; opposite of harm.
  •     Fairness or proportionality: rendering justice according to shared rules; opposite of cheating.
  •     Liberty: the loathing of tyranny; opposite of oppression.
  •     Loyalty or ingroup: standing with your group, family, nation; opposite of betrayal.
  •     Authority or respect: submitting to tradition and legitimate authority; opposite of subversion.
  •     Sanctity or purity: abhorrence for disgusting things, foods, actions; opposite of degradation.
More studies showed that Democrats/Progressives cared almost exclusively about the care, fairness, and sanctity dimensions, while Republicans/Conservatives tended to care about all six. He uses this to partly explain why Republicans see Democrats as naive and unsophisticated, while Democrats tend to see Republicans as uncaring and unjust. And why they're both right.

Schulz's Being Wrong has some overlap with Haidt's work. I came across Schulz from her Pulitzer Prize winning article about the Cascadia subduction zone fault line in North America. Even if you have no interest in earthquakes or how Seattle might descend into chaos because of one, I'd recommend reading it for the prose quality.

Schulz's book is similarly well written, and is filled with (true) short stories that explain what 'being wrong' means for humanity. It ties very nicely in with Haidt's ideas on cognitive biases and why we so often Get Things Wrong. My favourite part is where Schulz describes the three assumptions that we make when someone disagrees with us: The ignorance assumption, the idiocy assumption, and the evil assumption.

First, we assume that our opponents are ignorant. We assume that they disagree with us only because we have facts of which they are ignorant. If this is shown to be false (e.g., after we have enlightened them of the facts), we take up the idiot assumption: we assume that they must be unintelligent enough to possess all the facts but still fail to arrive at the correct conclusion. If we become convinced that they possess an intellect comparable to our own, we move on to the evil assumption: that they have all the facts, are intelligent enough to arrive at the correct (our) conclusion, but choose not to for their own self-benefit, even at the expense of others. I've definitely gone through that exact process many, many times without noticing, and it was interesting to read about it in such general terms.

Zinsser's book is different from the other two, but like Haidt's has most of the description it needs encompassed in the (much shorter) title. I'm surprised that I hadn't come across Zinsser before given his fame. His writing is expertly crafted; his advice is instantly applicable, while remaining entertaining; and his comparison of writing to carpentry manages to be paradoxically inspiring and slightly depressing (he advocates that writing is a craft instead of an art, but he does make it seem an admirable craft). Zinsser is one of those magnificent writers where you can pick up his book, open it at random, and learn something interesting and useful, even if you've already read it before -- the information is that densely packed (and easy to understand).

I'll keep posting here, but follow me on Codementor for my tutorials and programming posts. I'm going to have my head down trying to write a master's thesis over the next few months, so I'm expecting my output of other writing to go up as I search for more reasons to procrastinate. I usually post links to the stuff I publish on Twitter, so follow me there for updates.