Why you should teach Go

I have been teaching programming for a while, and recently, I started teaching to web students.
After a few months of teaching, I proposed to add Go to the program. And it’s not because I want them to be Go programmers.


The web student profile

It’s a 3 years formation, with 3 specialities (webmarketing, webdesign, webdev) beginning from the first year.
I have been in contact with all the years through different subjects, few including support classes.

Here is some specificites about that students that I focused:

  • They mainly code with very high-level languages. The most low-level language is objective-C.
  • When there is a bug, the first reflex is to search on google, or groping with approximate variations.
  • They copy/paste a lot of code from the internet.
  • They have difficulties to deal with complexes datastructures.
  • They rarely think from a perspective of software design.
  • They leak of a wider IT culture, and they express a strong desire to fill this gap.
Representativity
I have been teaching for 4 years now, in different schools, and a class always has significant students with different levels of programming. However, the 2 last points (design, IT culture) are very true even for the most advanced students.

A question, several possible answers

How to improve their methodology quality ?

I made a proposal : Teach them a programming language with the following specifities :

  • Strong and explicit typing.
  • A strict language (syntax, design).
  • Easy to include in the school program.
  • Not too frustrating for student accustomed to fast coding languages.

Several possibilities :

  • C/C++/OCaml : Would be very time-consuming to teach.
  • Python/Ruby/Perl : Not enough typing.
  • Java : Time-consuming too (specially dev environment), even if teached in 2nd year. My favorite so far.

As you guessed, we choose Go.
A lot of good points for Go here :

  • Fast learning : “less is more”, few keywords, no pointer arythmetic, not too low-level operations
  • Strong and explicit typing
  • Make think about design : no recursive imports, no complex object mechanics = Obligation of simplicity
  • Fast-coding, less frustration : Recursivity (powerful fmt.Println, json.Unmarshall, etc), a lot of packages, strong expressivity.

Let’s do it : 15 to 21 hours of Go per class + An extra full week of Go for first year.


Process

The first students reaction is : Why ? Why Golang for web developpers ?
I was very clear with them, and even more, I went into the details of the habits I had detected in them, and the new light that I would like give. Also, I didn’t want them to think it’s only about making API.

I proceeded in 3 stages:

  1. Basics: Go run/build, some simple exercices (read/write in a file), array/map/object, etc.
  2. Conference:
    • How to assess the quality of a program?
    • Golang advanced functionnalities : Goroutines, go tools, a quick tour of the packages, etc.
    • The birth of Go : Frustrations, objectives
    • Comparison with other languages : Speed, safety, ease of use, multithreading, metaprogramming (a lot of IT culture here)
    • Go today : Statistics, famous businesses using it
    • For which projects should you use Golang ?
    • Personnal feedback
  3. A rated project/talk, with increasing difficulties for each year.

Exception : 3rd years had the conference first.


Feedback

The students reaction globally the same :

  • After some practice, the need of more rigor in typing became more obvious
  • For a lot of them, that video about strange typing behaviour was game-changing.
  • The conference got a lot of questions on IT culture : Specialy on why Golang if adapted or not to a project and on why Golang is hight-performant.
  • They would have liked to get the conference earlier. Before coding. And it’s true that the 3rd year was the most motivated class from the beggining.
  • During the course, they especially enjoyed asides on corollaries concepts (panic vs error in different languages, implementation behind goroutines or maps, etc.)
  • Some students ask the school more Golang courses, and told that It would be even better from the beginning of the year (!)
  • The 3rd students had a more advanced final project : A chat and a collaborative canvas drawing (front web + API Go). They were very motivated about it.

Conclusion :
The desire to learn more about IT culture, and to think differently was stronger that I thought, and I’m very satisfied about what we get. The students had an excellent state of mind during this experience, and it was a pleasure for me too !

Entrepreneur – Cofounder at Golem.ai (Paris, France)

I enjoy sharing Golang interesting patterns, experiments and tips.

Leave a Reply

Your email address will not be published. Required fields are marked *