in Learning, Reflection

Learning Log: Week of 5/1/17

Week of 5/1/17

During this week I set the goal to dive deeper into some of the programming languages that I already know. One way that I decided to do this was to dive in to some programming podcasts for JavaScript. This is where I came across the above suggestion about keeping a programming diary/log.

New Language Exploration

I’m a bit obsessive when it comes to online courses. I’m enrolled in several free and paid courses that I work through whenever I have free time. I typically try to devote anywhere from 1-2 hours a day on these pursuits, and I tend to skip around between subjects. Here’s an overview of what I did this week:

Golang

I’ve been working with Go in a rather trivial way since last September. This site is powered by Hugo, a static site generator written in Go. Since Go is the technology running my site, I’ve always wanted to dive deeper and learn more. However, I never quite devoted a chunk of time to this pursuit. This week, I decided that I wanted to go through a primer course on Go to round-out my basic knowledge of the language. It turns out that I actually knew more than I gave myself credit for, but I’m a firm believer in the value of repeating concepts to build familiarity and comfort.
I went through the CodeSchool On Track With Golang course in about two nights. This rounded out some of my knowledge and filled in the gaps about the strengths of Go. Here’s some of the things that I learned:

  • Go has lots incredible support for concurrency and multi-threaded computing

  • Go is extremely fast (I already knew this because of Hugo’s benchmarks)

  • Go has type inference:

  • name := “jonathan” will infer that it’s a string
    Here are some things that I found different from my prior experiences with other languages:

Declaring variables w/o type inference is interesting.
govar meaning int = 42
I found it strange to declare the type of a variable in that format, but after some practice I got used to it.
Another interesting aspect is the syntax structure itself. Since JavaScript and Python are two of my frames of reference, I started comparing Go to their syntax structures. Here’s a function from A Tour of Go:
gofunc add(x int, y int) int { return x + y}
I thought it strange to put the type after the parameter, such as in the above example. Another interesting thing is the inclusion of the type of the returned value. In the above example, the add function returns an integer. The type is placed before the opening {.
Another cool feature that I now understand a bit better is the ability to use structs to essentially create collections of data types. A lot of people talk about the ability to leverage type in Go, and I now understand it. At first glance, these seem similar to how objects are used in JavaScript:
gotype Alien struct {    name string    health int    age int}
Then, inside another function such as the func main(), you can create an instance of a struct and then access the fields inside:
gofunc main() {    mike := Alien("Mike", 30, 42)    fmt.Println(mike.name)    fmt.Println(mike.health)    fmt.Println(mike.age)}
There’s a lot of power in this flexibility, but I still don’t quite have the comfort/practice to explain in more detail. Go is often described as being a very Zen like language. I enjoy digging into some of these constructs and I look forward to building my understanding and knowledge!
There are some other interesting observations I had, but I want to pause to move on to some other things first.
I decided after completing the course that I needed a project to practice and solidify my foundation. Luckily, my site is built with a SSG backed by Go, so I had a perfect opportunity to test my skills. This is something I’m going to continue to do, but I want to explore some other project ideas as well. One thing I came across is a Go wrapper called SCGolang for the SuperCollider synthesis engine. This is definitely something I want to explore, as Go’s incredible concurrency and speed may allow for some interesting possibilities within SuperCollider.

Functional Programming

Last summer I was exposed to the world of functional programming. This, like many of my other interests, was spawned from music and creative pursuits. My first exposure was to Clojure via Overtone. I’d been aware of generating music with code due to my familiarity with SuperCollider and Max as well as some other tools, but I was extremely interested in expanding my horizons. I can’t remember exactly how I came across Overtone (this is why I want to start keeping a learning log!) but I remember being excited, because I had read about Clojure in the same week. It seemed like a nice synchronicity, so I started exploring.
Functional programming was something completely foreign to me. Last summer I eagerly expanded my programming skills and knowledge, but the functional paradigm was something that I hadn’t encountered at that point. I experimented with Clojure via Overtone and then found TidalCycles, a live coding environment that’s embedded in Haskell. I continued experimenting, and built a basic familiarity and understanding of functional programming. I’ve come to greatly love it, and while I don’t have a lot of practice with it yet, it was one of those things that seemed to immediately resonate and click. I’ve since started writing functional JavaScript, and have started looking for other languages to try as well.
This leads me to my second entry in my learning log: ClojureScript and Elixir. While I haven’t actually started working with either of these languages, I did some research last weekend and found some courses and resources for both languages. I did some reading about Elixir and found it interesting. I installed everything I need for Elixir and the Phoenix Web Framework that is paired with Elixir for web application development. I’m looking forward to experimenting with these tools, but haven’t quite come across a project that I want to use them for.
For now, these languages are on the (somewhat) backburner as I delve deeper into JavaScript, Python, and Go. However, my plan is to continue to explore Klangmeister and TidalCycles to build my comfort level with functional programming until I find a deeper project.
Until next week!

Let me know what you think

Comment