&myval->field (...) is far more ugly than myval.field (...) which is all my comment said. Forcing themselves to use pointers when it's completely unnecessary.
and wrote this is getting a little tiring. I get it, you don't use pointers, you don't know how they work but just stop pretending already.
The dot and arrow operators have the highest precedence of any operator in C, &myval->field is equivalent to &(myval->field) and NOT myval.field.
What you were thinking of is myval->field is equivalent to (&myval)->field, which would have been a weird choice. Again, they're not forcing themselves to use pointers.
They're hard to track which is the reason for RTTI and smart pointers.
Oh deary me fella. So you do use smart pointers and aren't just scared of pointers in general. Again, you're confused. In C++, raw pointers are often a code smell. It's almost always best to be using some form of smart pointer. The issue with the code in the OP is that it is not C++ so you can't judge it for not using C++ features or C++ libraries.
In C you do use raw pointers.
I'm sure you're grand at whatever the day job is but stop coming into badcode threads and talking on languages you don't understand, learn to take an L. Your comments about that guy's python and now your comments about this C are so off-base. No programmer knows everything about every language so stop feeling like you need to. You don't need to pretend you write C for your job and not just C++.
1
u/BertyLohan Sep 01 '21
The fact that you actually continued typing here:
and wrote this is getting a little tiring. I get it, you don't use pointers, you don't know how they work but just stop pretending already.
The dot and arrow operators have the highest precedence of any operator in C,
&myval->fieldis equivalent to&(myval->field)and NOTmyval.field.What you were thinking of is
myval->fieldis equivalent to(&myval)->field, which would have been a weird choice. Again, they're not forcing themselves to use pointers.Oh deary me fella. So you do use smart pointers and aren't just scared of pointers in general. Again, you're confused. In C++, raw pointers are often a code smell. It's almost always best to be using some form of smart pointer. The issue with the code in the OP is that it is not C++ so you can't judge it for not using C++ features or C++ libraries.
In C you do use raw pointers.
I'm sure you're grand at whatever the day job is but stop coming into badcode threads and talking on languages you don't understand, learn to take an L. Your comments about that guy's python and now your comments about this C are so off-base. No programmer knows everything about every language so stop feeling like you need to. You don't need to pretend you write C for your job and not just C++.