Hacker News new | ask | show | jobs
by bb88 447 days ago
Maybe a decade ago I saw a video of Rob Pike telling people they can abandon C++ because golang was good enough. He proclaimed that people can toss out their reams of C++ code and replace it with Go. That never really came to fruition -- even as bad as C++ is.

The only godsend of C is that code written in the 1970's can still be compiled today -- half a century later. You can write code in your 20's in C and still be assured it will still work a half century later in your 70s. (as long as you don't use system libraries which might change.... etc.)

A lot of people complain about Rust compile times. But honestly, I'd rather work in a language that is trying to solve complexity rather than push it off on to the user.

2 comments

Mostly because he doesn't get why some of us reach out for C++, despite its warts.

As I wrote at the time on Lambda The Ultimate back in 2012,

http://lambda-the-ultimate.org/node/4554#comment-71504

As much as I hate Go, I have to admit that it does sort of fill a niche, or at least it did at the time it was released. If you wanted something less baroque and complex than C++, but still care about performance enough to not want to use an interpreted language, and don’t want to use Java because it’s overly verbose and attracts OOP architecture astronauts, there wasn’t much choice other than Go when it came out.

There’s a very high probability that something like Cockroach would use C++ if Go had never existed, so Rob Pike was sort of right, if you squint. On the other hand, if Cockroach were started today it would probably be written in Rust.

I think you’re missing a couple key benefits to go: compile time and cross arch builds. The story here is best in class by far. It’s so so simple and fast to compile go for 10 architectures and distribute a binary.