Latest News

Showing posts with label Go Programming Language. Show all posts
Showing posts with label Go Programming Language. Show all posts

Thursday, March 21, 2019

5 Integrated Development Environments For Golang

Created by some of the brilliant minds from Google, Go is an amazing programming language — it is light-weight, open sourced, and suited for today’s microservices architectures. The Golang programming language has become a popular language for developers of all kinds.

Talking about programming, every coder needs a perfect, reliable integrated development environment (IDE) for hassle-free coding experience. An IDE is one of the most extremely useful tools when coding. If in case you don’t know, what is an integrated development environment (IDE), an IDE is a software suite that consists of basic tools required to code software. Usually, an IDE consists of a code editor, a compiler or interpreter, and a debugger. The coder writes and edits the code in the editor, then the compiler translates the code into a readable format (which is executable for a computer). And finally, the debugger tests the code and look for issues or bugs.

Vim

Written in C and Vim Script, Vim is a highly configurable, advanced text editor that provides the power of the Unix editor ‘Vi’, with a more complete feature set. Simply put, it is an improved version of the vi editor. Initially released in November 1991, Vim is also called as “programmer’s editor.” Over the years, it has become so popular that many consider it a complete IDE. That’s is not all, in 2006, Vim was voted one of the most popular editors; in 2015 the Stack Overflow developer survey also stated that Vim is the third most popular text editor. And last years, it bagged the place of the fifth most popular development environment.

Talking about Go coding, Vim’s vim-go plugin comes with all the required elements to provide a hassle-free and smoother environment for Go developers.

Some of the features are:
  • Persistent
  • multi-level undo tree
  • extensive plugin system
  • support for hundreds of programming languages and file formats
  • powerful search and replace
  • integrates with many tools.

JetBrains GoLand

GoLand is a commercial IDE with coding assistance and tool integrations specific for the Go language (it extends the IntelliJ, a Java IDE). The GoLand IDE is designed in such a way that it analyzes the source code, looking for connections between symbols and provide code completion, quick navigation, clever error analysis, formatting, and refactorings.

The latest GoLand version, GoLand 2018.3 comes with additional features that include:
  • Change Signature refactoring
  • Testify support
Additional tools in the debugger:
  • new code inspections and intention actions
  • improved code completion
  • support for diagrams
  • updates for VCS, Docker, and Kubernetes.

Eclipse

When we talk about IDEs, we cannot ignore Eclipse, Eclipse integrated development environment (IDE) is one of the most widely used Java IDEs. Eclipse is definitely one those IDEs that developers use when they start out with coding. Having a plug-in architecture that offers a great deal of power, flexibility, and extensibility, Eclipse over the years have gained tremendous popularity. Now, with the GoClipse (which is an Eclipse extension that adds IDE functionality for the Go programminglanguage), Go coders can use Eclipse IDE for their programming. Also, both the Eclipse IDE and GoClipse plugin are not only free but also open source.

Some of the GoClipse features:
  • a source code editor
  • a project wizard and builder to help report in-editor build errors
  • a fully featured GDB debugger support.

Visual Studio Code

Visual Studio Code is a source code editor that works on Windows, Linux, and macOS. The IDE is free and open source and it was released under the permissive MIT License. According to the Stack Overflow 2018 Developer Survey, Visual Studio Code was ranked the most popular development tool.

For Go coder, Visual Studio Code comes with a Go extension — the plugin, vscode-go has a number of Go tools that offers Go coders language features such as IntelliSense, code navigation, symbol search, bracket matching, snippets and many more. Also, Visual Studio’s VS Code offers support for dozens of languages.

LiteIDE

Authored by visualfc, directly targeting to Golang, LiteIDE is a simple, open source Go IDE. The IDE is created in such a way the working with it feels similar to IDEs like Visual Studio. As the IDE is completely Golang focused, its features are considered to most comfortable for Golang coders.

Its features include:
  • configurable build commands
  • advanced code editor
  • extensive Golang support
  • code management
  • gdb
  • Delve debugger
  • auto-completion and theming with WordApi
  • MIME type based system etc.

About Us 

TMA Solutions was established in 1997 to provide quality software outsourcing services to leading companies worldwide. We are one of the largest software outsourcing companies in Vietnam with 2,400 engineers. Our engineering team was selected from a large pool of Vietnam IT resources; they are well-trained and have successfully completed many large and complex projects. Visit us at: https://www.tmasolutions.com/

Wednesday, March 6, 2019

An overview of Golang


Open Source Language
Go is an open source programming language from Google. Made its first stable release, 2011.

What does it mean that Go is an open source programming language?
Well, it’s created by Google as I said. However, even you can contribute to it by creating new proposals, fixing bugs, making it faster.

Who created Go?
Robert Griesemer, Rob Pike and Ken Thompson. They started designing Go language around 2007. Go language open-sourced in 2009.

Go inherited mostly from Oberon language and its syntax is from C. Go’s OOP is more like Smalltalk but in Go, you can attach methods to any type. And concurrency is mostly from Newsqueak which is a language also from Rob Pike and heavily inspired by Hoare’s paper of CSP (Communicating Sequential Processes).

Why they created Go?
Fast languages like C, are difficult to work with and not safe. Compiling speed, dependencies and runtime errors are vast. An interpreted language like Ruby is safe but it’s slower and has many dependencies, one of them is the interpreter itself. Also, for Java, for example, a virtual machine is needed to run the code. Javascript and Node.js are wild kids; which are interpreted, weakly-typed and unsafe to work with (although there are some possible directions like TypeScript or compiling directly to Javascript from other safer languages).

Also, as an example, Java became too complex and verbose to write. There are many keywords which can be guessed from the context the language constructs inside in (which is called inferring). Ruby is joyful to work with however it’s not designed for speed in mind. Javascript lets you free, go wild and slowly kills you (maintenance nightmare, callback hell (the world before async await), no built-in solutions for safety).

For example, C language compiles very quickly, however, the language itself has not been designed to be compiled very fast (I’m not talking about the compiler here), so, C programmers can misuse the language facilities to create slow compiling programs. In Go, however, it’s been designed for fast compilation in mind from the beginning. So, it’s hard for Go programmers to create slow compiling programs as compared to other languages like C or C++.

Go removes all of these obstacles like safety, speed, and ease of programming
  • Fast results: It works like an interpreted language because of the fast compilation. You’ll not notice that it’s compiling. You’ll think that as if you’re working in an interpreted language like Ruby.
  • Safe: Strongly and statically typed and garbage collected. Strongly typed means: You can’t pass any type of data everywhere. You need to be explicit. Statically typed means: Compiler knows the type of every variable. In Go there are no implicit type conversions, for example, uint8 and uint16 are different types (except in some cases).
  • Easy to work with: It’s concise, explicit and easy to read.
  • Modern: Built-in support in the language itself for multi-core networked distributed applications and more.


Some advantages of using Go:
Compiled
  • There is no VM. It compiles directly to the machine code (if we exclude Go’s intermediary assembly) which is fast, fast and fast (did I say fast?).
  • Fast compilation. The programming language design is built for fast compilation in mind from the beginning.
  • Compiles cross-platform to OS X, Linux, Windows, and many others.
  • Creates only one executable file output after the compilation without any dependencies, so that you can upload it anywhere which Go supports and just run it. Or just compile it there after you upload the code. No dependency hell.


Safe
  • Strong and static typed.
  • Garbage collected. It cleans up your dirt after you and integrates the whole garbage collection system into your executable binary.
  • Reliable. You can really create a very reliable software with Go. Because the inherent language design prevents you from doing awful stuff with it. For example, It has pointers but they’re mostly not as dangerous as in C because the memory is being managed by Go and pointer arithmetic is not advised by default. However, this reliability is only for the compilation part, in runtime, nasty things can happen, if you want maximum run-time reliability, you may prefer, for example, Rust instead.


Paradigms
  • It’s an imperative language which is an advantage and a disadvantage to some people.
  • Supports a different kind of object-oriented programming (OOP). I come from many OOP languages like Java, C#, Ruby, but, Go gets the best practices from OOP and lets you program differently, in a Go way.
  • Supports interfaces (as in OOP). This helps to compose things. Does “Polymorphism” ring a bell? Go does not force you to mark your types as “implements this and that interface”, it infers this from the functionality the type supports. This increases flexibility and composability.
  • Go lets you attach functions to any type. This flexibility lets you compose your programs from smaller things. When a type implements the functions of an interface it’s said that the type satisfies that interface and can be used in places that desire that interface.
  • Supports functional programming (FP). For example, Go supports anonymous functions, closures, and first-class functions.


Concurrent
  • Built-in concurrency. There are no heavy threads but channels.
  • Ability to program and structure your programs in a synchronous manner but actually it’s asynchronous. Channels hide that complexity and let you structure your programs in a more maintainable way.


Standard Library
  • Almost all of the things built into its standard library (which is the library that comes with Go by default) like HTTP fetching, JSON parsing, and encryption. So, this makes you faster and prevents fragmentation in the ecosystem (most of the time).


Tooling
  • Great built-in command-line tools. Auto-formatting your code, checking race-condition issues, auto-documentation, test coverage reporting, refactoring tools etc.


Some disadvantages of using Go:

  • No generics support. Actually, I’m not counting this as a disadvantage although I put it here. Because it lets you create a very explicit code. Too much wrong abstraction comes with a cost of difficult understandability. Generics are good to some extent however they’re very open to misuse and I’ve seen this in action for years. So, I’m not in the camp of generics support in Go. However, the Go team is still considering adding generics support to the language.
  • Err everywhere. You need to check errors for each of the error producing function in your code explicitly. However, I love the explicitness of Go programs. In the upcoming years maybe we’d find an elegant solution for this. There are some proposals to change error handling.
  • No overloading support. However, it can be imitated to some extent by type assertions.
  • Strict rules. Sometimes an advantage, sometimes a disadvantage. For example: Can feel little heavy when you have ever-changing structs. However, most of these rules can be overridden by using Go’s reflection capabilities.
  • Not so strong runtime safety. However, Go doesn’t bring the level of safety, for example, Rust provides. Go’s safety is for compile-time only and only to some extent for runtime (for example forbidden pointer arithmetic). So, if you’re looking also for the runtime safety, look to Rust. Go cares more about the productivity of programmers. Go = fast to production, Rust = safety in production. 
  • Smaller number of packages as compared to other ecosystems like Node.js and Ruby. This is because Go’s standard library is full of features which mostly doesn’t need third-party support. However, the number of packages are increasing.


About Us
TMA Solutions was established in 1997 to provide quality software outsourcing services to leading companies worldwide. We are one of the largest software outsourcing companies in Vietnam with 2,400 engineers. Our engineering team was selected from a large pool of Vietnam IT resources; they are well-trained and have successfully completed many large and complex projects. Visit us at: https://www.tmasolutions.com/

Thursday, February 14, 2019

Go developers say go go go on v1.12 tester

A first release candidate for v1.12 of the Go programming language is now available for final pre-release testing.

The release comes without any changes to the actual language specification, but improvements to the toolchain, runtime, and libraries. For example in the compiler toolchain there are now more functions eligible for inlining by default and the compiler accepts a flag setting the language version to use. 

Stack frame pointers on Linux/ARM64 are maintained so that profiling tools like perf have more to work with. Those not interested in this sort of thing should consider setting GOEXPERIMENT to noframepointer when running make.bash to build their toolchain, since the pointer also introduces a small overhead.

A helpful addition to the trace tool is the now included plotting function for mutator utilisation, which can be used to learn more about the garbage collector’s impact. Improvements to argument printing and variable location information in the DWARF debug information should support any bug hunting endeavours.

Once updated, the Go runtime will amongst other things provide less allocation latency after garbage collection, offer more accurate memory profiles and free memory for the operating system faster. Changes in the core libraries are mainly confined to cryptography, since v1.12 will be the first version with optional support of TLS 1.3.

Go was initially developed at Google and is known as a central building block of the container ecosystem. Docker, Kubernetes, and Prometheus are just a few prominent examples of projects implemented in the language. It can also be found in infrastructural components at companies such as Netflix, Dropbox and Twitch, often replacing Python.

Version 1.12 is not only the last version to be supported on FreeBSD 10.x, but also the last to not follow the proposal evaluation process introduced in late 2018 to account for the large number of high-profile projects using Go. 

To not split the ecosystem and keep the language moving, the Go team will, starting with v1.13, identify a small number of language proposals, announce those, and collect feedback. 

Afterwards the changes will be implemented, giving users another chance to voice concerns in the process. Ahead of the repository freeze that goes along with a release, the team will decide if the changes make for a valuable addition and either ship or rework/discard them. Slight adjustments to the process are still likely, since it is in an early testing stage.

About Us

TMA Solutions was established in 1997 to provide quality software outsourcing services to leading companies worldwide. We are one of the largest software outsourcing companies in Vietnam with 2,400 engineers. Our engineering team was selected from a large pool of Vietnam IT resources; they are well-trained and have successfully completed many large and complex projects.

Wednesday, January 30, 2019

The advantages of Golang.


Golang is a programming language you might have heard about a lot during the last couple years. Even though it was created back in 2009, it has started to gain popularity only in recent years.

GoDoc is a static code analyzing tool that creates beautiful documentation pages straight out of your code. A remarkable thing about GoDoc is that it doesn’t use any extra languages, like JavaDoc, PHPDoc, or JSDoc to annotate constructions in your code. Just English.

It uses as much information as it can get from the code to outline, structure, and format the documentation. And it has all the bells and whistles, such as cross-references, code samples, and direct links to your version control system repository.

GoDoc is the only documentation engine for Go that is used by the whole community. This means that every library or application written in Go has the same format of documentation. In the long run, it saves you tons of time while browsing those docs.

Static code analysis
Go heavily relies on static code analysis. Examples include godoc for documentation, gofmt for code formatting, golint for code style linting, and many others.

There are so many of them that there’s even an everything-included-kind-of project called gometalinter to compose them all into a single utility.

Those tools are commonly implemented as stand-alone command line applications and integrate easily with any coding environment.

Static code analysis isn’t actually something new to modern programming, but Go sort of brings it to the absolute. I can’t overestimate how much time it saved me. Also, it gives you a feeling of safety, as though someone is covering your back.

It’s very easy to create your own analyzers, as Go has dedicated built-in packages for parsing and working with Go sources.

Built-in testing and profiling framework
Have you ever tried to pick a testing framework for a Javascript project you are starting from scratch? If so, you might understand that struggle of going through such an analysis paralysis. You might have also realized that you were not using like 80% of the framework you have chosen.

The issue repeats over again once you need to do some reliable profiling.

Go comes with a built-in testing tool designed for simplicity and efficiency. It provides you the simplest API possible, and makes minimum assumptions. You can use it for different kinds of testing, profiling, and even to provide executable code examples.

It produces CI-friendly output out-of-box, and the usage is usually as easy as running go test. Of course, it also supports advanced features like running tests in parallel, marking them skipped, and many more.

Race condition detection
You might already know about Goroutines, which are used in Go to achieve concurrent code execution. If you don’t, here’s a really brief explanation.

Concurrent programming in complex applications is never easy regardless of the specific technique, partly due to the possibility of race conditions.

Simply put, race conditions happen when several concurrent operations finish in an unpredicted order. It might lead to a huge number of bugs, which are particularly hard to chase down. Ever spent a day debugging an integration test which only worked in about 80% of executions? It probably was a race condition.

All that said, concurrent programming is taken very seriously in Go and, luckily, we have quite a powerful tool to hunt those race conditions down. It is fully integrated into Go’s toolchain.

Learning curve
You can learn ALL Go’s language features in one evening. I mean it. Of course, there are also the standard library, and the best practices in different, more specific areas. But two hours would totally be enough time to get you confidently writing a simple HTTP server, or a command-line app.

Go is much easier to bring to your team than Java (and the family), Javascript, Ruby, Python, or even PHP. The environment is easy to setup, and the investment your team needs to make is much smaller before they can complete your first production code.

Reflection
Code reflection is essentially an ability to sneak under the hood and access different kinds of meta-information about your language constructs, such as variables or functions.

Given that Go is a statically typed language, it’s exposed to a number of various limitations when it comes to more loosely typed abstract programming. Especially compared to languages like Javascript or Python.

Moreover, Go doesn’t implement a concept called Generics which makes it even more challenging to work with multiple types in an abstract way. Nevertheless, many people think it’s actually beneficial for the language because of the amount of complexity Generics bring along. And I totally agree.

According to Go’s philosophy (which is a separate topic itself), you should try hard to not over-engineer your solutions. And this also applies to dynamically-typed programming. Stick to static types as much as possible, and use interfaces when you know exactly what sort of types you’re dealing with. Interfaces are very powerful and ubiquitous in Go.

However, there are still cases in which you can’t possibly know what sort of data you are facing. A great example is JSON. You convert all the kinds of data back and forth in your applications. Strings, buffers, all sorts of numbers, nested structs and more.

In order to pull that off, you need a tool to examine all the data in runtime that acts differently depending on its type and structure. Reflection to rescue! Go has a first-class reflect package to enable your code to be as dynamic as it would be in a language like Javascript.

Opinionatedness
Coming from the Javascript world, one of the most daunting processes I faced was deciding which conventions and tools I needed to use. How should I style my code? What testing library should I use? How should I go about structure? What programming paradigms and approaches should I rely on?

Which sometimes basically got me stuck. I was doing this instead of writing the code and satisfying the users.

To begin with, I should note that I totally get where those conventions should come from. It’s always you and your team. Anyway, even a group of experienced Javascript developers can easily find themselves having most of the experience with entirely different tools and paradigms to achieve kind of the same results.

This makes the analysis paralysis cloud explode over the whole team, and also makes it harder for the individuals to integrate with each other.

Well, Go is different. You have only one style guide that everyone follows. You have only one testing framework which is built into the basic toolchain. You have a lot of strong opinions on how to structure and maintain your code. How to pick names. What structuring patterns to follow. How to do concurrency better.

While this might seem too restrictive, it saves tons of time for you and your team. Being somewhat limited is actually a great thing when you are coding. It gives you a more straightforward way to go when architecting new code, and makes it easier to reason about the existing one.

Culture
People say that every time you learn a new spoken language, you also soak in some part of the culture of the people who speak that language. Thus, the more languages you learn, more personal changes you might experience.

It’s the same with programming languages. Regardless of how you are going to apply a new programming language in the future, it always gives you a new perspective on programming in general, or on some specific techniques.

Be it functional programming, pattern matching, or prototypal inheritance. Once you’ve learned it, you carry these approaches with you which broadens the problem-solving toolset that you have as a software developer. It also changes the way you see high-quality programming in general.

And Go is a terrific investment here. The main pillar of Go’s culture is keeping simple, down-to-earth code without creating many redundant abstractions and putting the maintainability at the top. It’s also a part of the culture to spend the most time actually working on the codebase, instead of tinkering with the tools and the environment. Or choosing between different variations of those.

Go is also all about “there should be only one way of doing a thing.”

A little side note. It’s also partially true that Go usually gets in your way when you need to build relatively complex abstractions. Well, I’d say that’s the tradeoff for its simplicity.

If you really need to write a lot of abstract code with complex relationships, you’d be better off using languages like Java or Python. However, even when it’s not obvious, it’s very rarely the case.

Conclusion
You might have heard of Go before. Or maybe it’s something that has been staying out of your radar for a while. Either way, chances are, Go can be a very decent choice for you or your team when starting a new project or improving the existing one.


About Us 

TMA Solutions was established in 1997 to provide quality software outsourcing services to leading companies worldwide. We are one of the largest software outsourcing companies in Vietnam with 2,400 engineers. Our engineering team was selected from a large pool of Vietnam IT resources; they are well-trained and have successfully completed many large and complex projects.

A short overview of Go programing language.

Go or Golang is a programming language created at Google, by Google developers and other programmers. This programming language is free and open source and currently being maintained by Google. One of the founding member of Go is Ken Thompson who is best known for his work in Unix operating system development. Go compiler was initially written in C but now, it is written in Go itself, making it self-hosted.

So what’s so special about Go?
  • Go is statically typed compiled language.
  • It support built in concurrency model with the help of GoRoutines.
  • It has built in garbage collector and memory safety.
  • Strings in Go are UTF-8 encoded by default.
  • It has simpler syntax compared to other compiled programming languages.

Motivation behind its creation

There are tons of programming language to choose from nowadays. Each language has its own benefits and different programmers find different languages friendlier than others. But a language should be perfect in all sense and should be easy to work with for any programmer. A programming language can be dedicated for one task like COBOL or can be used general purpose programming like Java or JavaScript on Node.

The four important things a language must thrive to achieve is speed/efficiency, reliability, scale and simplicity. If we consider languages like C or C++, they are great at speed, scale and reliability but in terms of simplicity, they are not so great. Java on other hand is very reliable and highly scalable, but moderately simple to write and not so efficient compared to other low-level languages. Python is a widely adopted language and very simple to write but not so efficient and reliable.

Whenever Google creates a language or a framework, I suppose it’s because they want to eventually use it in their own organization. Angular, Material design, Dart, Flutter etc. are few examples.

Google back in 2008–2010 was looking for a language which could be great at all these 4 things. I guess their idea was to replace traditional low-level programming languages with this language in their own infrastructure. Hence with the help of Ken Thompson, Rob Pike and Robert Griesemer, they created a language Go that was could give developers an experience of writing scripting (interpreted) language like Python or JavaScript but at the same time, provides quirks of low-level compiled language. Their major focus was on simplicity, scale, speed and reliability. Since, go is a commonly used English word which makes it difficult to target internet searches to Go Programming Language, many people use GoLang instead of Go.

Things that make Go a great language is its simple concurrency model, its package based code management and its non-strict (type inference) typing system. Go does not support out of the box Object Oriented Programming experience, but is support structures (structs) which with the help of methods and pointers can help us achieve the same. 

I came across an article on day, which stated that Go will be server language of the future. I don’t deny that. Go has strong potential, tooling is great and writing Go code is easy. Since, Go is not widely adopted language as of early 2018, it’s hard to find Go related tutorials and learning resources on the web.

About Us 

TMA Solutions was established in 1997 to provide quality software outsourcing services to leading companies worldwide. We are one of the largest software outsourcing companies in Vietnam with 2,400 engineers. Our engineering team was selected from a large pool of Vietnam IT resources; they are well-trained and have successfully completed many large and complex projects.

Monday, January 21, 2019

The reason why Golang becomes increasing famous.

In only two years, Golang leaped from the 65th most popular programming language to #17. Here's what's behind its rapid growth.

The Go programming language, sometimes referred to as Google's golang, is making strong gains in popularity. While languages such as Java and C continue to dominate programming, new models have emerged that are better suited to modern computing, particularly in the cloud. Go's increasing use is due, in part, to the fact that it is a lightweight, open source language suited for today's microservices architectures. Go is also gaining ground in data science, with strengths that data scientists are looking for in overall performance and the ability to go from "the analyst's laptop to full production."

As an engineered language (rather than something that evolved over time), Go benefits developers in multiple ways, including garbage collection, native concurrency, and many other native capabilities that reduce the need for developers to write code to handle memory leaks or networked apps. Go also provides many other features that fit well with microservices architectures and data science.

Go advantages

Some programming languages were hacked together over time, whereas others were created academically. Still others were designed in a different age of computing with different problems, hardware, and needs. Go is an explicitly engineered language intended to solve problems with existing languages and tools while natively taking advantage of modern hardware architectures. It has been designed not only with teams of developers in mind, but also long-term maintainability.

At its core, Go is pragmatic. In the real world of IT, complex, large-scale software is written by large teams of developers. These developers typically have varying skill levels, from juniors up to seniors. Go is easy to become functional with and appropriate for junior developers to work on.

Also, having a language that encourages readability and comprehension is extremely useful. The mixture of duck typing (via interfaces) and convenience features such as ":=" for short variable declarations give Go the feel of a dynamically typed language while retaining the positives of a strongly typed one.

Go's native garbage collection removes the need for developers to do their own memory management, which helps negate two common issues:

  •          First, many programmers have come to expect that memory management will be done for them.
  •          Second, memory management requires different routines for different processing cores. Manually attempting to account for each configuration can significantly increase the risk of introducing memory leaks.


Go's native concurrency is a boon for network applications that live and die on concurrency. From APIs to web servers to web app frameworks, Go projects tend to focus on networking, distributed functions, and/or services for which Go's goroutines and channels are well suited.

Suited for data science

Extracting business value from large datasets is quickly becoming a competitive advantage for companies and a very active area in programming, encompassing specialties like artificial intelligence, machine learning, and more. Go has multiple strengths in these areas of data science, which is increasing its use and popularity.

 ·        Superior error handling and easier debugging are helping it gain popularity over Python and R, the two most commonly used data science languages.
·         Data scientists are typically not programmers. Go helps with both prototyping and production, so it ends up being a more robust language for putting data science solutions into production.
·         Performance is fantastic, which is critical given the explosion in big data and the rise of GPU databases. Go does not have to call in C/C++ based optimizations for performance gains, but gives you the ability to do so.


Seeds of Go's expansion

Software delivery and deployment have changed dramatically. Microservices architectures have become key to unlocking application agility. Modern apps are designed to be cloud-native and to take advantage of loosely coupled cloud services offered by cloud platforms.

Go is an explicitly engineered programming language, specifically designed with these new requirements in mind. Written expressly for the cloud, Go has been growing in popularity because of its mastery of concurrent operations and the beauty of its construction.

About Us

TMA Solutions was established in 1997 to provide quality software outsourcing services to leading companies worldwide. We are one of the largest software outsourcing companies in Vietnam with 2,400 engineers. Our engineering team was selected from a large pool of Vietnam IT resources; they are well-trained and have successfully completed many large and complex projects.

Learning Golang becomes easier with 4 tips


My university's freshman programming class was taught using VAX assembler. In data structures class, we used Pascal—loaded via diskette on tired, old PCs in the library's computer center. In one upper-level course, I had a professor that loved to show all examples in ADA. I learned a bit of C via playing with various Unix utilities' source code on our Sun workstations. At IBM we used C—and some x86 assembler—for the OS/2 source code, and we heavily used C++'s object-oriented features for a joint project with Apple. I learned shell scripting soon after, starting with csh, but moving to Bash after finding Linux in the mid-'90s. I was thrust into learning m4 (arguably more of a macro-processor than a programming language) while working on the just-in-time (JIT) compiler in JVM code when porting it to Linux in the late '90s.

Fast-forward 20 years... I'd never been nervous about learning a new programming language. But Go felt different. I didn't want to be the laughingstock, the Go newbie as a 40-something-year-old senior developer! We all know that programmer pride that doesn't like to get bruised, no matter your experience level.

My early investigations revealed that Go seemed more committed to its "idiomatic-ness" than some languages. It wasn't just about getting the code to compile; I needed to be able to write code "the Go way."

Now that I'm four years and several hundred pull requests into my personal Go journey, I don't claim to be an expert, but I do feel a lot more comfortable contributing and writing Go code than I did in 2014. So, how do you teach an old guy new tricks—or at least a new programming language? Here are four steps that were valuable in my own journey to Golang land.

1. Don't skip the fundamentals

While you might be able to get by with copying code and hunting and pecking your way through early learnings, Go has a very readable language spec that was clearly written to be read and understood, even if you don't have a master's in language or compiler theory. Given that Go made some unique decisions about the order of the parameter:type constructs and has interesting language features like channels and goroutines, it is important to get grounded in these new concepts. Reading this document alongside Effective Go, another great resource from the Golang creators, will give you a huge boost in readiness to use the language effectively and properly.

2. Learn from the best

There are many valuable resources for digging in and taking your Go knowledge to the next level. All the talks from any recent GopherCon can be found online, like this exhaustive list from GopherCon US in 2018. Talks range in expertise and skill level, but you can easily find something you didn't know about Go by watching the talks. Francesc Campoy created a Go programming video series called JustForFunc that has an ever-increasing number of episodes to expand your Go knowledge and understanding. A quick search on "Golang" reveals many other video and online resources for those who want to learn more.

Want to look at code? Many of the most popular cloud-native projects on GitHub are written in Go: Docker/Moby, Kubernetes, Istio, containerd, CoreDNS, and many others. Language purists might rate some projects better than others regarding idiomatic-ness, but these are all good starting points to see how large codebases are using Go in highly active projects.

3. Use good language tools

You will learn quickly about the value of gofmt. One of the beautiful aspects of Go is that there is no arguing about code formatting guidelines per project—gofmt is built into the language runtime, and it formats Go code according to a set of stable, well-understood language rules. I don't know of any Golang-based project that doesn't insist on checking with gofmt for pull requests as part of continuous integration.

Beyond the wide, valuable array of useful tools built directly into the runtime/SDK, I strongly recommend using an editor or IDE with good Golang support features. Since I find myself much more often at a command line, I rely on Vim plus the great vim-go plugin. I also like what Microsoft has offered with VS Code, especially with its Go language plugins. Looking for a debugger? The Delve project has been improving and maturing and is a strong contender for doing gdb-like debugging on Go binaries.

4. Jump in and write some Go!

You'll never get better at writing Go unless you start trying. Find a project that has some "help needed" issues flagged and make a contribution. If you are already using an open source project written in Go, find out if there are some bugs that have beginner-level solutions and make your first pull request. As with most things in life, the only real way to improve is through practice, so get going.

And, as it turns out, apparently you can teach an old senior developer new tricks—or languages at least.


About Us

TMA Solutions was established in 1997 to provide quality software outsourcing services to leading companies worldwide. We are one of the largest software outsourcing companies in Vietnam with 2,400 engineers. Our engineering team was selected from a large pool of Vietnam IT resources; they are well-trained and have successfully completed many large and complex projects.

Tags

Recent Post