Hacker News new | past | comments | ask | show | jobs | submit login

If you compare Go to C++, Go has gotten more organized but still retains understandability, and in my opinion, C++ has become unrecognizable. I did 10+ years of C++ until around 2012, and since then the changes have been so quick and so drastic I would not call myself an experienced C++ programmer anymore. It's a shame because I love C/C++ but not what I see today, because they have lost what makes Go great: an opinion. They are trying very hard to be everything and it has changed the language too quickly to keep up.





Without a doubt, C has "lost" nothing, because it barely changed. And most of the modern code written in it still has mostly the same style as in the nineties.

I guess about C++ you are comparing pre-C++11 era to post-C++11 era (because C++14 and C++17 were more minor, and even for the most part a kind of finalization of the C++11 spirit). And I consider you thinking C++ has lost an "opinion" is merely _your_ opinion (how meta :p ), which I don't share at all: C++ was always kind of multiparadigm and like it or not but people attempted to do all the modern stuff even with pre-C++11 core language. It sometimes did not end well (first smart pointers...), and/or it was just annoying to miss some features, like variadic templates, or again there was missed optimizations (now permitted with rvalue references and move semantics). SFINAE was abused and let us write great things at compile time at the cost of truly insane syntax, but now there is some work to let write that kind of thing less insanely. The core language basically evolved to let what people were already trying to do actually doable with somehow sound results and/or less boilerplate/hacks (not statically nor dynamically checked in tons of cases, though, but that is another story).

Very old C++ was also very often POO heavy, in the Java/GoF sense/spirit. Some people detest that (myself kind of included), so I'm glad there is something else to do in modern C++ than creating SingletonFactory classes, that kind of insanity.


> Without a doubt, C has "lost" nothing, because it barely changed

Thanks to UB exploitation, C as implemented has been changing a lot over time. Old C was a decent low-level language. New C is barely usable.


I'm not following. Can you give an example of such changes which make C less-usable? Also, are you referring to changes in the C standard or just the implementations?

I can see where you're coming from and I'm sure it must feel that way but I'm not sure its actually true. Most of what's happened is that C++11 can be summed up into a few priorities. We want to make type deduction simple. We want to make writing templates easy. We want to make doing things at compile time easy. We want you to be able to write local closures easily.

You can contextualize the vast majority of the language changes from c++11 on this way. I just don't think having the same priorities for 10 years is making constant drastic change.


>I love C/C++

It is weird that these usually get lumped together, they are completely different languages.


It's not that weird if you consider the history. With C++, you can drop down and do lower level "C" stuff when you need to. C++ syntax is, with a few minor exceptions, compatible with C. Many, many 90's and early 2000's "C++" apps are written in a simple "C with classes" style.

I'm a newcomer to C++ and by no means intend to sound like an expert but I think the key to working with it is to treat it not like one language in which you should try to learn most of the features (like say Python) but instead treat it as a smaller language (e.g. C) with a bunch of optional extensions that you can choose to use if you wish (like classes, templates, smart pointers etc.).

If you pick a subset of C++ and keep some discipline (e.g. follow one of the existing style guides from LLVM, Google, Mozilla etc.), I've found it to be a very nice, pleasant language to work with.


C++ was not intended to be "opinionated" in the way that you believe; consider taking a look at Bjarne Stroustrup's "Design and Evolution of C++", or just his presentations at CppCon conferences over the past several years which focus on the history of the language.

Now, it's true that C++ has seen significant changes, but:

1. C++ is, indeed, a multi-paradigmatic language; and in recent years it is becoming easier to write code using other paradigms - particularly functional. But your old code, and programming style/paradigm, still work just fine. C++ changes by addition, not by removal (with tiny tiny exceptions to this rule). So you can keep your opinion.

2. It was "always" known that C++ is a work-in-progress language, and that a lot of its idioms are temporary studs until something better is formulated, implemented, tried and standardized. In a sense, we don't even have C++ yet, we're just gradually getting parts of it.

3. The most significant ones so far were in 2011, while you were still writing. (C++2020 is arguably as much of an update as C++2011.)

4. While the changes make the language larger, they also very often simplify a lot of coding tasks. A prominent example: With C++2017 you can avoid a lot of "template metaprogramming" voodoo in favor of compile-time-evaluated code.


Although I share similar experiences with what you're saying per se, I don't understand why people compare Go to C++. Comparing Go to C makes sense; to Rust or C++ does not.

I'm comparing it as a language that is evolving. Not as a point-to-point comparison. I feel like Go has evolved properly and C++ is mutating too quickly for its own good.

Nah, C++ is hardly mutating, in the sense of being backwards-incompatible. Rather, it is expanding incrementally (these days in big chunks). Anyway... Would you compare Python and C++, then? The goals of the languages are clearly different.

The comparison that has always made a bit more sense to me was "Rust tries to be a better C++, Go tries to be a better Java."

Honestly, "Go tries to be a better BASIC" would be more accurate. Nothing wrong with that, mind you.

This case may be an exception, but the root cause for most comparisons of Go to C++ is that Pike started it: https://commandcenter.blogspot.com/2012/06/less-is-exponenti...

Imo I wouldn't say that "being everything for everyone" for C. In my mind C has still mostly retained its simpleness, which for me would be its most defined feature. It is still not that many concepts you need learn to code in C. You still need to be very organised to code safe and correct code in it but that is not something that has changed. But I might be wrong. Someone with better experience with C throughout its entire life are free to correct me :)

> an opinion

Suppose you don't share that opinion? That's what puts me off Go.


"Go has gotten more organized but still retains understandability" you just literally contradicted yourelf in two words. thats amazing :D



Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: