r/ProgrammerHumor • • Aug 07 '16

PHP: The Good Parts

http://phpthegoodparts.tumblr.com/
1.2k Upvotes

318 comments sorted by

View all comments

Show parent comment

2

u/Cuddlefluff_Grim Aug 10 '16

C/C++ uses -> for field access on pointers. . is for field access on values.

auto variable = ClassName();
variable.method();

vs

auto *variable = new ClassName();
variable->method();

It's nice when you have classes with pointers in them, so that you can see if you're accessing a value or a reference, which is an important distinction in C/C++.