Observations on Golang from A JavaScript Developer Who is Learning It — Part I

I also don’t have a CS degree so this might make no damn sense.

Jonathan Chin
Jul 20, 2017 · 4 min read

Recently with the leap of faith I’ve made in my life and career trajectory, I made a pact with myself to teach myself another programming language by Summer’s end (or Winter if you are in the Southern-half of the globe). I had been mulling over a few choices like Ruby, Python, and even Elixir.

I came across Go after remembering a fellow cohort of mine at the coding bootcamp I was attending mentioned the language frequently. After some research the things that attracted me to the language weren’t the technical bits like concurrency or the multi-core support. What I fancied about Go was the story to why and how the language came to fruition. The existing languages didn’t suit their needs so they just did the most badass thing and created their own. They gathered some of the most brilliant minds in Computer Science granted them the resources to create Go. They intended to create a language that will scale and support large scaled applications, which makes sense what Google needs.

I also have never used a C language before nor a statically-typed language

It’s still a fledgling language, but it’s future is insanely bright. Besides Google, organizations like The New York Times, The BBC, and Netflix have already started using it (along with these companies).

Riot Games used it to cure their server woes for LoL.

It’s Concise

The creators/authors of Go (Rob Pike, Ken Thompson, and Robert Griesemer) had readability in mind when they were designing it. I don’t have any specifics at this time to point out the brevity of the language but so far my overall impression is that it tries to be dead simple as a modern programming language (it was created in 2007).

A recursion example that feels pretty pretty pretty pretty simple.

‘Go’ 'For’ It

Again this is my first go around with a language that derives from C, and I have had no experience with a compiled language nor static-typed languages (although TypeScript is on my radar). I haven’t gotten far yet in terms of mastering the syntax but I was pleased to have been able to pick up their conventions in initializing and executing a basic for loop. Below I’ve written a for loop in Go from an example in Caleb Doxey’s excellent An Introduction to Programming In Go along with a comparable for loop in JavaScript:

A For loop in Go
Basic JavaScript function utilizing the for loop.

The syntax for Go is nice and concise, while the basic or brute force way of writing a for loop in JavaScript isn’t so elegant. I say the JavaScript for loops isn’t pretty being that I’ve been using higher-order functions for a few months and I’ve been accustomed to beautiful functions like map.

My ability to compose concise and clean functions in Go will no doubt improve and go further as I continue to get acquainted with the language. So far, I’m enjoying it, even if its not as pretty as Ruby.

It’s Nether Function or Object Oriented Programming

So far, with JavaScript being my first language I’ve come to know the two programming paradigms it’s community promotes, Object-Oriented and Functional. When researching and going through the basic syntax of Go, it has been revealed to me that it falls into neither of those. It is a procedural programming language and this is great explainer of why that is. To be honest, some of this is mumbo-jumbo to me. Like I’ve frequently mentioned above (probably ad nauseam at this point), I do not have any formal Computer Science training (yet), but hopefully this journey in learning Go, I’ll have come to understand these benefits and the nuances of these design choices.

And So…

So these were some of the observations I’ve had as a JavaScript developer who is learning Go and their second programming language. I should state that I attended a coding bootcamp and have absolutely no knowledge in Computer Science, so apologies if there are some misnomers here. I know there are criticisms of the language, but this is not a piece on the benefits of the language or why its the best language. My trek into learning Go is going bit-by-bit and I’m excited to dig deeper into the language.

)
Jonathan Chin

Written by

junior front end developer and amateur music journalist.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade