Live data from Hacker News

C++ Should Be C++

open-std.org

51–60 of 191 posts

Re: C++ Should Be C++

#51

> What is much less prevalent is a demand from average C++ users for memory safety features; they’re much more concerned about compilation speed. When most C++ developers haven’t adopted tools like Coverity and C++ core guidelines checkers, it is hard to claim that memory safety features substantially improve their lives at least from their point of view. I don’t really agree with this. There’s also a group of develo…

I think it's less about not wanting memory safety and more that compilation speeds are so time-wastingly abysmal that it's a few orders of magnitude more important to address. The whole deal with interpreted languages was to avoid sitting there for a few minutes every time you make a god damn one letter change, with the unfortunate but usually acceptable trade-off of some execution speed.

And the additional trade-off that some bugs are only noticed at runtime when that particular line is executed while it could have been noticed by the compiler of a strongly typed language. Pytype helps but at this point you have a static analyzer that potentially runs as slow as a compiler without the additional performance benefit.

Re: C++ Should Be C++

#52
post #10

Earlier quoted context omitted.

Anything C++11 forward is alright with me, though 17 introduces some very nice conveniences like , and most critically . Honorable mention to std::clamp too.

> Honorable mention to std::clamp too. One shudders to think how many times variations of that template have been written in house.

Heck, I find so many cases where std::min and std::max could be used as well.

Re: C++ Should Be C++

#53
I agree with everything written here - C++ is never going to be Rust, or any other language, but it can at least become better than it is now, in some common-sense ways.

In my view, C++'s biggest problem is its design-by-committee structure, leading to a lack of pragmatism - in other words, perfect is the enemy of good. Pragmatism is what you see when you look at the standard libraries of languages like Python and Java: are they perfect? Far from it. But they prioritize being at least good enough for a good amount of situations, over being perfect. Which ends up being far more useful for regular people. And being useful for regular people is what makes a programming language successful.

But design by committee means if your proposal isn't perfect, it will get shot down. So the language remains bad for everyone's use cases, rather than at least becoming somewhat good for some people's use cases.

Re: C++ Should Be C++

#54
post #22

Earlier quoted context omitted.

I'm not saying it is. I'm using the exclusivity of religious belief just as a short-cut to show that it is possible for large groups of people to hold false beliefs without getting into the weeds of which of those beliefs are actually false. The point is not that C++ is analogous to a religion, just that "adoption by millions" is not a valid argument for its merits.

No, your analogy falls over. The equivalent assertion is "Christianity is a good/useful belief system" (and "Islam is a good/useful belief system") Now, you could endeavor to disprove that equivalent assertion, but your earlier argument doesn't.

My argument applies equally well to that: the mere fact that a religion has large numbers of adherents does not in and of itself show that it is either good or useful. But that's a harder case to make because it turns on what is meant by "good" and "useful", and those are things about which reasonable people can disagree.

To be clear, "fitness as a general purpose programming language" is also something about which reasonable people can (and manifestly do) disagree. All I'm saying is that having large numbers of adherents is not a valid argument in favor of fitness any more than it is an argument in favor of goodness or usefulness. It's possible that all it shows is that a lot of people drank the kool-aid.

[UPDATE] It's also possible that most of the people using C++ think that it sucks, and they are all just using it because everyone else is using it.

Re: C++ Should Be C++

#55
post #12

> It is easy to see that C++ is fit as a general-purpose programming language–adoption by millions is a testament to that. No, that is false. It is akin to arguing that Christianity must be true because 2.4 billion Christians can't be wrong. The fallacy is easy to see because the argument can be applied equally to the world's 1.9 billion Muslims and 1.2 billion Hindus and 500 million Buddhists, etc. And yet these gro…

It's easy to see that driving on the RIGHT side of the road is a fit as a general mode of transportation. Adoption by millions is a testament to that.

It's easy to see that driving on the LEFT side of the road is a fit as a general mode of transportation. Adoption by millions is a testament to that.

Both statements are true. The author didn't say only C++ is fit. Nor did he say a program written in BOTH C++ AND python (i.e. a system of driving on both left and right sides of the road) is fit.

The counter-argument (C++ is NOT fit as a general purpose programming language) is invalidated by millions of programmers who use it as such in the same way that thumbs are not fit for grasping is invalidated by, well, grasping with your hands.

It doesn't mean pliers are not fit for grasping just because thumbs are fit for grasping.

You're conflating types of evidence and types of arguments.

Re: C++ Should Be C++

#56

> What is much less prevalent is a demand from average C++ users for memory safety features; they’re much more concerned about compilation speed. When most C++ developers haven’t adopted tools like Coverity and C++ core guidelines checkers, it is hard to claim that memory safety features substantially improve their lives at least from their point of view. I don’t really agree with this. There’s also a group of develo…

I'll make a similar, but fundamentally different, claim to what you're quoting: There isn't much demand for half assed memory safety features. And C++ memory safety features are - nearly by definition - half assed. They're opt-in (meaning all the third-party and system code you link against doesn't have coverage), slow (meaning you can't use it in production), and tend to catch the trivial bugs rather than the hard-to-find ones that keep you up at night.

Re: C++ Should Be C++

#57
post #55
post #12

> It is easy to see that C++ is fit as a general-purpose programming language–adoption by millions is a testament to that. No, that is false. It is akin to arguing that Christianity must be true because 2.4 billion Christians can't be wrong. The fallacy is easy to see because the argument can be applied equally to the world's 1.9 billion Muslims and 1.2 billion Hindus and 500 million Buddhists, etc. And yet these gro…

It's easy to see that driving on the RIGHT side of the road is a fit as a general mode of transportation. Adoption by millions is a testament to that. It's easy to see that driving on the LEFT side of the road is a fit as a general mode of transportation. Adoption by millions is a testament to that. Both statements are true. The author didn't say only C++ is fit. Nor did he say a program written in BOTH C++ AND pytho…

No. I'm not saying that C++ is not fit as a general purpose programming language. It very well may be. All I'm saying is that "adoption by millions is a testament to [the fitness of C++]" is not a valid argument. If it were, "adoption by millions is a testament to truth of [objective religious claim X]" would be a valid argument, and it manifestly isn't because different religions make mutually exclusive objective claims.

Re: C++ Should Be C++

#58
I have seen that the biggest issue with C++ is that legacy C++ is quite hard to refactor to the new patterns. For example, I have been working on font substitution in LibreOffice, and I'd like to use a more functional style of programming, but I'm getting stuck because of an overuse of classes.

I've been reading Functional Programming in C++ by Ivan Cukic and I'd like to adopt this - it does require a lot of refactoring of this massive codebase.

Perhaps this is a massive, ancient codebase issue more than a C++ issue, though.

Re: C++ Should Be C++

#59
post #13
post #4

Earlier quoted context omitted.

I don't know if you're in the minority or I am, but I find modern C++ to be borderline intolerable (and I've been programming mostly in C++ from before there were C++ compilers). I used to love C++ (and still do if we're talking about older standards), but the new stuff is just a baroque torture.

Aye, same here. I don't mond C++ evolving into some thing of its own beyond all recognition, but there is a distinct lack of modern "C with Classes" language. Basically, C on steroids. There are attempts at that, but none is perfect and/or has enough traction to be viable.

I just want a C with templates (and function overloading)?

Re: C++ Should Be C++

#60
I hope people don't throw out the effective and well-thought out parts with the problematic parts.

It happened with Macromedia Flash and it happened with Microsoft's Visual Basic. The JVM and industry attitudes to Java. PHP.

We have lost some good technology over time, please don't let us lose the good parts of C++.

Post reply on HN