Having an asterisk both be the type indicator and the dereference operator is one of the great programming language design blunders of our time, along with allowing nulls for any type in so many languages.
Having assignments return a value is right up there as well.
Because of the possibility of accidentally performing an assignment in a conditional expression?
If yes, I agree that it’s not great.
Yeah, exactly that.
std::shared_ptr p;
I’m just a c# dev wishing to fuck we had something visual to indicate reference types so my coworkers could stop misusing them
It’s such a short list of value types though. How can they have that much trouble? All of the various ints and floats, bool, char, structs, and enums. Everything else is reference.
Wait until I tell y’all about const.
no int * ptr fans here?
deleted by creator
Int *p is unreadable, unreasonable, and bad programming.
But C syntax clearly hints to
int *p
being the expected format.Otherwise you would only need to do
int* p, q
to declare two pointers… however doing that only declaresp
as pointer. You are actually required to type*
in front of each variable name intended to hold a pointer in the declaration:int *p, *q;
That’s because C was designed by a fool.
The fools who created Unix
And C!
What, could you have done better in 70-whatever?
Why so? It’s what it actually is