For the past few weeks I've been looking into Go . It's a rather new language, backed by Google and it seems to have gained a fair amount (relative to its age) of adoption from developers.
These day I'm coding primarily in Python. Apparently, most people switching to Go are users of Python, Ruby, and similar languages. So, naturally, there's a lot of comparison made between these languages: for example, Go is considered by some to be as expressive as Python, but compiled down to native code so it's faster in execution, and has way better concurrency support.
But I have a different comparison to make - to C. Before Python, I was a C programmer , and I've actually spent more years coding in C than in Python. While learning Go, I compared it not only to the high-level dynamic Python language, but also to the low-level "portable assembler" language.
For the types of applications I used C for (desktop apps, command line tools, network services - nothing touching raw hardware), Go easily beats C. It seems as if someone sat down, listed all the problems with C that occur in practice, and then designed a language without those problems. In fact, considering who the principal mind behind Go is, that may not be far from the truth.
A few examples:
- memory allocation - manually managing memory in large applications is extremely hard and error prone; Go uses a garbage collector
- error signalling - standard practice in C is to signal errors by a special return value, which it makes it impossible to use that value as an actual value; Go practice is to return both the value and the (possibly empty) error
- bounded strings and arrays - in contract to C “strings” and “arrays” (pointer manipulation syntactic sugar with no boundary checks), Go's arrays, slices and strings provide proper boundary checks; no more smashing the stack for fun and profit.
- improved syntax - host of small changes, like mandatory code blocks for
for, saner operator precedence, better
switch syntax, that help eliminate some classes of errors
- unified coding style - basic coding style as enforced by
go fmt improves readibility and maintainability of the code and eliminates endless flame wars; in C, I had to switch between K&R, GNU and Linux kernel coding styles daily
- resource cleanup - shocking as it may be, the best idiom for resource cleanup in a function in C is a series of
goto statements; Go's deferred functions are much cleaner (and more robust) implementation
- standard library - the highest-level concept in C standard library is
qsort; it takes less code to write a web server in Go than to sort an array in C
- tools - in place of the horrendous autotools, Go has a simple way of building the code on any supported platform
I've only listed some of the improvements that can be directly compared with C, without touching features like channels and interfaces, which don't have direct counterparts in the land of C.
It is true that from a purely academic perspective, you may not find Go a very interesting language (if you're not into the whole concurrency thing). But from a C developer's point of view, it's a dream come true.
 I'm not switching to Go or ditching Python - I'm merely learning a new language
 Where I say “C”, I really do mean “C” - not “C and C++”