67 points · by pieterr · 4y ago · 28 comments
I'm surprised that the ability to search easily didn't come into their consideration, given ... well, it's Google.
I'm not a Go developer, so I have no idea of how big of a problem this is, but the fact that there is a commonly used second name 'GoLang' hints to me that this became a problem quickly.
And C++ is called "cpp". It's a non-issue, not a problem. And it fits the Go ethos of not overcomplicating the whole language to address minor concerns.
But that isn't for searchability but due to + not being permitted in names in some filesystems, or being rejected by some tools even where they are valid in filenames in the current environment, so file.c++ wasn't a good idea.
The ability to find things in a global search engines was not the concern that it can be today back in the early 80s when C++ was named, so this is not really a like-for-like comparison, and anyway a quick test in common search tools shows that searching for C++ seems to work well enough.
In the end I think c++11 did make things way better and less error prone than before, largely through new features.
Coding C++17 is better than C++14, mainly for its destructured bindings and improved variadics.
Coding C++20 is much better, again. chiefly because of Concepts, but co-routines will become increasingly important as library support surfaces.
It has been a long time since I shipped a memory usage fault. Languages that promise to make those impossible are hyped now, but their promoters are "fighting the last war".
What makes the difference today is productivity. C++ is still leading that charge. Hype notwithstanding, more people take up programming C++ professionally in any given week than the total paid to code Rust. Soon, many of those Rust coders will begin to jump ship for newer languages.
If productivity is "the current war", then languages like Go, Python, Rust, Elixir, and TypeScript are definitely fighting it, and it's not clear to me that any has significant lead in anything but limited areas.
Also consider the large amount of qt-based apps still running c++.
In your experience, are these improvements available to existing code bases, green field projects, or both?
Old code can be modernized incrementally, e.g. replacing uses of naked pointers with smart pointers and then deleting destructor code, or replacing C-style for-loops with modern range-style for-loops or calls to standard algorithms, passing a lambda. Many class declarations can be eliminated by using lambdas inline. A sweep throughout a big codebase just modernizing one kind of thing may take only a few days. This typically results in deleting a great deal of code, and all the bugs in the deleted code evaporate.
Deleting masses of code always feels great.
> Early in the rollout of Go I was told by someone that he could not imagine working in a language without generic types. As I have reported elsewhere, I found that an odd remark.
> But more important, what it says is that types are the way to lift that burden. Types. Not polymorphic functions or language primitives or helpers of other kinds, but types.
Go always had generics: slice, map, channel. Writing without those I also could not imagine working in.
And if anyone's curious how instead of making Go, C++ could be refactored into a smaller cleaner language, see "Can C++ be 10x Simpler and Safer?"[0]. It even allows for a memory arena that's managed by gc.
That's not what people understand when you say a language "has" generics though.
But in this talk, we have one of the creators of the language saying "you don't actually need generics," when what he meant was "you only need the generics I gave you."
Go has, from the very beginning, acknowledged the importance of generics, and offered them to users of the language. But, until fairly recently, Go didn't trust users to use generics in any but a few specific cases.
C++: minimize CPU cycles, maximize benefit to user.
Go: minimize developer cycles, maximize benefit to employer.
How can less be more? It's impossible. More is more.
-Yngwie Malmsteen, C++ developerJust overload the < and > operators to make it so…
Of course, an exception is generics, which I haven’t yet had much to do with, and while it potentially scratches a personal itch of mine (I always felt that builtins like ‘append’ and ‘len’ were overly magical), I worry that it’s a complication.
But only time will tell.