Live data from Hacker News

Deprecating Raw Pointers in C++20

bfilipek.com

71–80 of 84 posts

Re: Deprecating Raw Pointers in C++20

#71
post #68
post #32

Earlier quoted context omitted.

1. April joke :) The point of c/c++ in comparision to other languages is that you can do anything and having a huge toolbox for that. Pointers are excelent sledgehammer. You can be perfectly fine with not using them but c++ need to have them. The pointers are not source of the problem, the developer is. That's why languages like java are prospering, it prevent incompetent people making stupid mistakes and that is fin…

You can have languages that prevent people making stupid mistakes and still offer full control over the hardware, that is what languages like Modula-2 and Ada offer.

Yeah, also Rust and ATS. A good systems language just needs to allow low-level and unsafe operations; nowadays the industry is warming up to the idea that such operations shouldn’t be available by default. Having to opt in with a machine-checked “unsafe” annotation means you have an explicit indication in the code of everywhere things could go wrong with type/memory safety, which means when something does go wrong, you know it must be caused by one of those unsafe regions.

Re: Deprecating Raw Pointers in C++20

#72
post #57

It's an April fool's day joke in the best tradition: a parody almost indistinguishable from truth. C++ has jumped the shark. Prima facie C was created as a portable assembly language that very nearly reflected the underlying hardware. Then C++ added new abstraction mechanisms on top of C, that were at first totally orthogonal: just classes and templates. One could still use all of C to get at the raw machine (raw poi…

I don’t know if the joke is about C++ or the committee, which has approved many things that don’t feel like C++ to me (i.e., I strongly suspect that some committee members aren’t big fans of the language).

That said, I fell for this joke.

Re: Deprecating Raw Pointers in C++20

#73
post #34

Earlier quoted context omitted.

The entire point of April Fools is to fool people...

It isn't a world-wide holiday

I remember reading about China making April Fools illegal after some major mishap where many people took a joke seriously. I was never sure if that was for real or satire.

Re: Deprecating Raw Pointers in C++20

#74
post #57

It's an April fool's day joke in the best tradition: a parody almost indistinguishable from truth. C++ has jumped the shark. Prima facie C was created as a portable assembly language that very nearly reflected the underlying hardware. Then C++ added new abstraction mechanisms on top of C, that were at first totally orthogonal: just classes and templates. One could still use all of C to get at the raw machine (raw poi…

> C++ has drifted off into some fantasy world

I like what E. W. Dijkstra had to say in "The Humble Programmer":

> Finally, although the subject is not a pleasant one, I must mention C++, a programming language for which the defining documentation is of a frightening size and complexity. Using C++ must be like flying a plane with 7000 buttons, switches and handles to manipulate in the cockpit. I absolutely fail to see how we can keep our growing programs firmly within our intellectual grip when by its sheer baroqueness the programming language —our basic tool, mind you!— already escapes our intellectual control. And if I have to describe the influence C++ can have on its users, the closest metaphor that comes to my mind is that of a drug. I remember from a symposium on higher level programming language a lecture given in defense of C++ by a man who described himself as one of its devoted users. But within a one-hour lecture in praise of C++. he managed to ask for the addition of about fifty new “features”, little supposing that the main source of his problems could very well be that it contained already far too many “features”. The speaker displayed all the depressing symptoms of addiction, reduced as he was to the state of mental stagnation in which he could only ask for more, more, more... When FORTRAN has been called an infantile disorder, full C++, with its growth characteristics of a dangerous tumor, could turn out to be a fatal disease.

April fool's. He actually said that about PL/1 [1].

[1] https://www.cs.utexas.edu/~EWD/transcriptions/EWD03xx/EWD340...

Re: Deprecating Raw Pointers in C++20

#75
post #16

I guess a serious point is that modern C++ does "deprecate" raw pointers in the sense that their use is discouraged outside of interfacing with external libraries or old C++ code. But that's more the realm of linters than compiler warnings.

I'm not sure that's quite true. Raw pointers are fine if you need a nullable non-owning reference type.

Re: Deprecating Raw Pointers in C++20

#77
post #13
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.

If i didn't read this comment section, i would've been convinced it's real.

Consider it real. (Please.)

Re: Deprecating Raw Pointers in C++20

#78
post #57

It's an April fool's day joke in the best tradition: a parody almost indistinguishable from truth. C++ has jumped the shark. Prima facie C was created as a portable assembly language that very nearly reflected the underlying hardware. Then C++ added new abstraction mechanisms on top of C, that were at first totally orthogonal: just classes and templates. One could still use all of C to get at the raw machine (raw poi…

> C++ has drifted off into some fantasy world I like what E. W. Dijkstra had to say in "The Humble Programmer": > Finally, although the subject is not a pleasant one, I must mention C++, a programming language for which the defining documentation is of a frightening size and complexity. Using C++ must be like flying a plane with 7000 buttons, switches and handles to manipulate in the cockpit. I absolutely fail to see…

Great quote, thanks!

Re: Deprecating Raw Pointers in C++20

#79
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.

I am sure parent meant "passing by reference". (In Oberon, for example, this is indicated by the VAR keyword.)

Re: Deprecating Raw Pointers in C++20

#80
post #73
post #34

Earlier quoted context omitted.

It isn't a world-wide holiday

I remember reading about China making April Fools illegal after some major mishap where many people took a joke seriously. I was never sure if that was for real or satire.

Now they should be surely aware of that.

FYI, here was one of Chinese translation of the article, but the contents was just deleted 10 minutes ago:

https://www.oschina.net/news/94805/deprecating-pointers

Post reply on HN