--- author: James date: 2018-01-27 10:09:34+00:00 medium_post: - O:11:"Medium_Post":11:{s:16:"author_image_url";s:69:"https://cdn-images-1.medium.com/fit/c/200/200/0*naYvMn9xdbL5qlkJ.jpeg";s:10:"author_url";s:30:"https://medium.com/@jamesravey";s:11:"byline_name";N;s:12:"byline_email";N;s:10:"cross_link";s:2:"no";s:2:"id";s:12:"452cd617afb4";s:21:"follower_notification";s:3:"yes";s:7:"license";s:19:"all-rights-reserved";s:14:"publication_id";s:2:"-1";s:6:"status";s:6:"public";s:3:"url";s:95:"https://medium.com/@jamesravey/how-i-became-a-gopher-and-learned-myself-an-angular-452cd617afb4";} post_meta: - date tags: - chatbots - work - golang title: How I became a gopher over christmas type: posts url: /2018/01/27/how-i-became-a-gopher/ --- Happy new year to one and all. It’s been a while since I posted and life continues onwards at a crazy pace. I meant to publish this post just after Christmas but have only found time to sit down and write now. If anyone is wondering what’s with the crazy title – a gopher is someone who practices the Go programming language (just as those who write in Python refer to themselves as pythonistas. There’s an interesting list of labels that programmers self-assign [here][1] if you’re interested). Over Christmas I decided I was going to have a break from working as a [CTO][2] and a [PhD student][3] in order to do something relaxing. That’s why I thought I’d teach myself a new programming language. I also taught myself how to use Angular.js too but I’ll probably write about that separately. ## Go Go Gadget… keyboard? First on my list is the Go programming language. I decided that I would spend 2 weeks over xmas (in between playing with my nintendo switch and of course spending time with my lovely fiancee and our families) building something useful and practical in the language because if there’s one thing I can’t stand its trying to learn to use a programming language by writing yet another [todo list.][4] At Filament, we are fast becoming one of the UK’s leading chat-bot providers, working with brands like T-Mobile and Hiscox insurance. We have an excellent team of chat-bot builders run by our very own Mr Chat-bot, [Rory][5] and supported by a very stringent but also very manual QA process. I decided I was going to try and help the team work smarter by building a PoC chatbot testing framework. The general gist of my tool, named Chatty Cathy, is that I can “record” a conversation with a bot, go make some changes to the intents and flows and then “playback” my conversation to make sure the bot still responds in the way I’d like. ## Why Go? If you hadn’t gathered, I’m in to performance-sensitive compute applications: AI, statistical modelling, machine learning, natural language processing. All of these things need a lot of juice. We’re also in the business of writing large-scale web applications that serve these kinds of machine learning models to huge numbers of users. I love python and node.js as much as the next man but most machine learning applications that have interfaces in those languages are written in something low level (C or C++) and bound to these higher level languages for ease of use. I know that Go is still higher level than C or something like Rust* but it outperforms all of the interpreted languages and Java in the [Benchmark Games][6] and is very easy to learn (see below). It is this trade-off relatively-high-performance-versus-ease-of-use that has me so excited. *Incidentally I spent some time last year working in Rust and even though I loved it, found it very hard going – I’ve been following [Julia Evans’ Ruby Profiler][7] project and it’s got me excited about Rust again so maybe I’ll dive back in some day soon. ### Pros of Working with Go
go └── src ├── github.com │ ├── author1 │ │ └── project1 │ │ ├── LICENSE.txt │ │ ├── README.md │ │ ├── somefile.go │ │ ├── more.go │ ├── author2 │ │ └── project2 │ │ ├── LICENSE.txt │ │ ├── README.md │ │ ├── somefile.go │ │ ├── more.goBasically, each project gets stored somewhere hierarchically in the tree and all dependencies of your project end up somewhere in here. This can make it a little bit confusing when you’re working on really large projects but then perhaps this is no more confusing than a python virtualenv or the node_modules directory of a mature node.js app and I’m being silly? * Some of the libraries are still a little bit immature. I don’t mean to be disparaging in any way towards the authors of these open source libraries that are doing a fantastic job for absolutely zero payment. However, a lot of the java tooling we use at work has been in development for 2 (in some cases nearly 3) decades and a lot of the crazier use cases I want to try and do are supported out of the box. * I’m still not a massive fan of the way that [struct tag][8] syntax works. Again, perhaps this is because I am a programming luddite but I definitely prefer Java Annotations and Python Decorators a lot more. ### Summary Go is a really exciting language for me personally but also for many of us still plagued by nightmarish visions of java boilerplate in our sleep. It has a fantastic ecosystem and first-class support for parallel programming and building web services via a really nice set of REST server libraries and JSON serialization libraries that are already built in. There are a few small issues that probably still need addressing but I’m sure they will come out in the wash. The most exciting thing for me is how well Go slots into the toolbox of any competent imperative language programmer (e.g. C, C++, Java, Python, Javascript, C#, PHP etc.). Whichever language you come from there are likely to be a few minor changes to get used to but the syntax and concepts are familiar enough that you can be up and running in no time at all! Is Go ready to be used in prime-time production-ready systems? I definitely think so but if you don’t believe me, why don’t you ask [the Docker Foundation?][9] [1]: https://gist.github.com/coolaj86/9256619 [2]: http://filament.uk.com/ [3]: https://www.wisc.warwick.ac.uk/people/student-profiles/2015-intake/james-ravenscroft/ [4]: https://github.com/search?l=JavaScript&q=todo&type=Repositories&utf8=%E2%9C%93 [5]: https://disruptionhub.com/whats-crappy-chatbots/ [6]: http://benchmarksgame.alioth.debian.org/u64q/compare.php?lang=go&lang2=node [7]: https://jvns.ca/blog/2017/12/02/taking-a-sabbatical-to-work-on-ruby-profiling-tools/ [8]: https://golang.org/ref/spec#Tag [9]: https://www.slideshare.net/jpetazzo/docker-and-go-why-did-we-decide-to-write-docker-in-go