The idea for this open-source programming language came up when Google engineers Robert Griesemer, Rob Pike, and Ken Thompson huddled together to create a systems level language. The focus was on resolving the difficulties of other programming languages in writing codes without doing away with their characteristic features.
Accordingly, GoLang bases on the classic syntax of C/C++ with added benefits of garbage collection, memory safety, automatic declaration of variables, structural typing, and CSP-style concurrency. This is also the latest programming language that keeps multi-threading at its core.
With the whip hand over its competitors, GoLang has meteorically risen up the Tiobe Index – one that indicates programmer preferences and favorites. No wonder it is being used in diverse applications worldwide, including Dropbox, SoundCloud, Cloud Foundry any many others!
The question is, is GoLang really worthwhile? What makes it better than stalwarts like C, C++, Java and Python? Why choose it at all? Let’s find out the pros and cons of it.
Pro: The simplest reason to start programming in GoLang is its simplicity. The syntax is extremely small and easy to learn. Because its core resembles that of C/C++, experienced programmers can pick up the basics fast.
Although it lacks the functionality of other programming languages, its scope has been deliberately limited to keep it simple. Furthermore, for those trying and failing at multithreading codes, GoLang is a safe haven for background coding tasks.
Con: Although simple to use, GoLang makes room for undisciplined coding. Also, this simplicity, which the language flaunts, can become an obstacle when a project matures into something bigger.
It would then be unwise to ignore the other cleverer programming languages that have better bug-fighting abilities. For those looking for generics, exceptions and extensibility this programming language would be disappointed.
Pro: Regarding virtual machine dependencies, GoLang offers peace of mind. Codes written with this programming language are complied into a binary that is ready to go and doesn’t need a virtual machine.
Simply enter the executable’s name in the command line and hit Return. In short, dependencies are not an issue with GoLang because it comes with a dependency manager. As virtual machines are not involved in running codes, any software developed using this programming language would feed on fewer resources. Above all, GoLang enables faster debugging cycles.
Con: The standalone binaries of GoLang are huge because they need to include the power of the virtual machine as well. Even a small ‘hello world’ might eat up 2MB of data. Of course, much has been done to compress the binaries by excluding uncalled methods. Still and all, the RAM might end up clogging when a server fires up multiple versions of your code.
Furthermore, GoLang allows dependencies to be expressed within the same file that contains the dependent code. Although this is a good thing, no programmer can indicate a specific version of the dependencies.
The task is restricted to the latest version, also known as the master branch. This eventually causes errors, including the breaking of codes because of dependency alteration.
Pro: As discussed earlier, GoLang comes with features like automatic declaration of variables, fast compile times, and latency free garbage collection. It completely keeps away manual memory management. Such automation eventually saves time.
Con: Ask any programmer and he would tell you about the pitfalls of using automation features in programming languages. What if garbage collection is triggered at the wrong time leading to errors and delay in server code responses? What if the same variable name gets used in nested scopes and automatic declarations goof it up? Imagine the chaos! Doesn’t the belts-and-suspenders approach seem more logical?
Pro: C lovers consider GoLang to be the next update. Carrying the classic syntax, this programming language has everything that reminds you of C, of course, without the annoyances. Features like latency free garbage collection and a simpler file structure make the difference. Everything else is quintessentially C!
Con: There are other programming languages as well that resemble C. Consider the likes of Java, Swift, Rust, C#, C++, and even Objective-C. Moreover, programming isn’t only about defining basic blocks in compiler construction or fancying curly braces. And even if it is, other programming languages have so much more to offer.