Google has earned more than its fair share of public hate lately (granted, your stance may vary). But, I’ve recently found a new love for the company, especially three of its incredible employees: Robert Griesemer, Rob Pike, and Ken Thompson. If the title didn’t give it away, no doubt the massive name drop did; I’m talking about Golang.
My first experience with C came during a stint with the U.S. Air Force Civil Service. I was transferred from a Java Web Applications team to the F-15 RADAR systems team and tasked with building test and systems simulations software. All of my academic and professional experience up to that point had been in the garbage collected, memory managed, byte code world.
At first, I found C to be simultaneously intimidating and wholly liberating! I could go on about the power of pointers and references for days, or about how incredibly simple C’s structs and bitfields made building and parsing data packets for the 1553B bus. Ultimately, this was the point in my life where I began wondering why Java both complicated programming with its dogmatic approach of making everything and object and why it was lacking in so many ways like simple structs or more granular memory control through pointers and references. Where were bitfields and why couldn’t I obtain a pointer to a string and iterate over its characters by incrementing that pointer? Or simply treat a string like what it is, an array of characters?
On the other hand, however, I did find C to have many shortcomings of its own. For starters, remembering to free allocated space from the heap is one of the most cumbersome gotchas in the history programming, and C is no exception. Another issue I found with the language was the ungodly amount of function parameters required in lieu of any sort of object-oriented framework. And the issue of choosing between pointers and references was always fun. The treatment of strings as second class citizens was also a very significant feature I found MIA. In all fairness, C’s lack of features is itself a feature, but it sure creates a lot more work for the programmer.
Then, there are the “features” C has that it could do without. For example, the cumbersome build process. Whether you use the traditional Makefile or something more robust like CMake, you ultimately wind up declaratively programming the build sequence. Why? Why can’t the build tool just look at the #include statements, scan the project directories, and figure it all out? And how about header files? Why? Forward declarations of methods? Why? Sure, you can write all your implementation in the header file and eliminate the actual .c file. And, sure, you can use tools like lzz that will generate the forward declarations and header files for you, but why?
Despite my great love for C’s rawness and the implicit trust it shows for the programmer, despite my vast experience with Java and the incredible improvements that came with Java 8, no language really “struck my fancy” until I decided to give Golang a try…
In my next article, I will delve into the wonderful language of Go and why I wish I could find a job where I worked with Go on a daily basis.
Clinton is a full-time Software Developer currently working for CGI Federal, Inc. He spends most his days building Java web applications using tools like Spring MVC, Java Server Faces, and VueJS. In his free time, he likes to dabble in Golang, Hadoop, and other cool technologies. Clinton has been married to his wonderful wife Ashley for 8 years. Together, they have a super-handsome, unbelievably cute (no bias here folks) 5 year old son, Andrew.