Live data from Hacker News

Deprecating Raw Pointers in C++20

bfilipek.com

41–50 of 84 posts

Re: Deprecating Raw Pointers in C++20

#42
post #38

I've never done any real development with a language that uses pointers. So noob question: why would one use a pointer over passing a variable? (those are the two flavors right?)

That's far too big a question to answer here, but consider for example writing a function thst modifies its arguments.

Re: Deprecating Raw Pointers in C++20

#43
post #38

I've never done any real development with a language that uses pointers. So noob question: why would one use a pointer over passing a variable? (those are the two flavors right?)

When passing a pointer, if you want the resulting state of the variable, the function doesn't need to return a value. Also if the variable is a large object, then passing just a pointer to it saves time spent copying the object.

Re: Deprecating Raw Pointers in C++20

#44
post #23

This could be a joke. Or not. It is very much in keeping with the current direction of C++, which appears to be: "Oh no, C++ cannot keep pace with modern systems languages, let's repair it by whatever means possible" Their heart is in the right place, but perhaps this accelerated process of mutating the language will ultimately be what kills it. Personally, after having deep expertise in C++(11/14) I jumped ship to G…

There is nothing in C++ 11 and later that is forced on you. Everything that was added is optional. For personal projects I depend on some alternate implementations for things that are now in the STL because these not complete enough for my needs.

That only works if you are working alone. In a real world team environment you can’t always enforce your preferences on your teammates

Re: Deprecating Raw Pointers in C++20

#45
post #38

I've never done any real development with a language that uses pointers. So noob question: why would one use a pointer over passing a variable? (those are the two flavors right?)

There's absolutely no reason to use pointers, unmentioned detail is that c++20 will bundle v8's garbage collector in the runtime to support this removal.

Re: Deprecating Raw Pointers in C++20

#48
post #6

The fact that this headline cannot be distinguished from April Fools joke by other commenters seems to say a lot about the direction in which C++ standard committee is heading.

maybe HN should have a colored header line to remind people about this day and prevent reactions

I don’t think they are disallowed, but think most of them end up getting downvoted out of distaste (the annoying and useless April 1sts was one of the reasons I left slashdot years ago).

Obviously this one is either believed, or believed to be amusingly subtle. Either way, I agree it should be at least [Joke] flagged.

Post reply on HN