Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
andymurd
on Sept 2, 2015
|
parent
|
context
|
favorite
| on:
C Programming Guidelines
It is similar to:
struct thing athing; struct thing *thingptr = &athing;
Then there should be no confusion as to whether you write:
athing.member = 12;
or:
thingptr->member = 12;
fsloth
on Sept 2, 2015
[–]
If I saw a declaration like that in a code I was reviewing I would politely ask not to use this pointless level of indirection. This adds a tiny bit of complexity to the code and gives nothing back.
nitrogen
on Sept 2, 2015
|
parent
[–]
It can also turn a single memory access into two memory accesses if the structure and the pointer can't be coalesced by the optimizer.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: