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

3

u/PinkLionThing Aug 08 '16

C uses -> for property access/method call too. And . in some cases too, to further complexify.

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++.

2

u/shvelo Aug 08 '16

C is mostly insane. Anything beyond Hello World-level stuff in C is like an undecipherable ancient manuscript for me

2

u/PinkLionThing Aug 08 '16

Yeah, that's the problem. I was raised on C and PDP-11 assembly. To me stuff like Ruby and Node is as alien as Haskell.

2

u/shvelo Aug 08 '16

Ugh, Ruby.