Why I’m learning a new Programming Language called Go

For the past few years, I got stuck in a rut, a good one. My sole focus was not the technology I used. but rather the thought processes behind why and how I write code. I write in PHP and I mainly focus on the WordPress CMS. This pays the bills and helps me take care of my family but, while focusing on thought processes, I didn’t realise that learning a new language can have the same effect, helping me think differently about similar problems.

So why Go (#golang)? This one I stumbled upon by accident. A colleague of mine, Akeda, automated one of our workflows. Before this, we had a weird process involving multiple tools and steps. His script made life just a little easier. I thought one could improve it just a little bit more, but in oreder to do this I had to go digging into Go source code.

After hacking on this project and getting it “mostly working” I decided to dig a bit deeper into Go. I found out immediately that it was created by a few very smart people at Google. It is open source and has a very strong community. More specifically, Docker, the tool I use all the time, was written in Go(mind blown gif goes here).

With Go you to create systems software. I know my way around PHP and this is great, but there are a few things an interpreted language simply can’t do. This presented me with another opportunity to learn.

Go is written in Go! Yep, that means you can eventually read and contribute to any bugs in the language itself, if that’s something you’re interested in. I think it’s great that one only needs to learn on language to get involved with an entire commuinity.

Learning GO is free, no need to buy expensive books. Do the tour, then work through How to write go code and then read Effective Go. After this, you can start using the language. If you are new to programming you may need more help.

With Go, most of the tooling forms part of the language. The following things are already included: code documentation generation, testing, dependencies etc. In most languages I know these are third party tools. They may not work exactly how you want them to, but they work and they remove the burden of having to choose between third-party options. Though third-party options are available, the idea is that everything you need to be productive should be part of the language.

New languages force us to think differently about the same problems, as per this stack overflow answer:

It’s not about the next “new thing”. It’s about thinking in different ways outside of your normal thought patterns

I hope this inspires you to pick up a new language. There are so many to choose from.

Featured image is a gophers, the Go mascot. It was created with https://gopherize.me/. Creating a unique gopher.

Microservices Are Something You Grow Into, Not Begin With

The craze around microservices is great, but starting small and simple is the best use of our limit time, specially when starting a new project, More on this from the link below:

https://nickjanetakis.com/blog/microservices-are-something-you-grow-into-not-begin-with

Golang Channels: explained simply

I see go channels as a pipe connecting two air tight vacuum cleaners. One vacuum cleaner can not push anything into the pipe, if the other vacuum is not pulling from the pipe. Both need to do the opposite action. If one sends the “package” will be stuck until the other turns on it’s receiving action.

Channels can contain multiple slots for “holding” the “packages”.

Pushing more into the pipe than wha the pipe can handle results in a broken pipe.

I also think of it as a queue, first in, first out ( last in last out ). The only difference is this one is ultra sensitive and very particular.

PHP database management in a single file

I’ve found this nice little thing that quickly allows you to have a MySql GUI.

It is called Adminer and it just works! Database management in a single file:

https://www.adminer.org/

Add it to your base web directory (public_html or something similar ) and viola.

Disclaimer: only use on development environment.

Colemak Keyboard Layout, 1 Month(ish) In

Typing is one of the most important aspects of my professional career.  That’s why, a month ago, I decided to change my keyboard layout to Colemak.

The first hurdle I faced was switching in December, what a weird time to switch right?  I was supposed to be scaling down and focus on relaxation, but I thought the switch to be such a huge challenge, that It wouldn’t matter when I did it.

The second hurdle: I went cold turkey. I simply switched, printed out the new layout, gave it a solid glance and memorized all the new positions and kept it next to my desk. I watched my typing speed go from 35 WPM(words per minute) to 9. And my frustration levels go into the red.

I started to use this at work immediately. I warned my team mates and just jumped in. A good thing this sort of thing is encouraged at Automattic.

colemak_print_out
Learning the new layout.

The two things that helped me the most during the first month was Type Fu and a supportive team.

With Type Fu you repeatedly type similar phrases until you “master the keys. At this point, you move on to the next level with more variation. It also has a setting to select the keys you battle with and only focus on them.

Screen Shot 2018-01-16 at 6.12.34 AM
Doing typing drills in Type Fu

My current speed is 30 WPM. I use it as my default layout and I’m way more confident than I was a month ago. My main take away is that, if I can go from 9 -30WPM in a month then I’ll be more productive as time goes on.

I hope to increase this as I continue to practice every working day.