Jump to content

  • Log In with Google      Sign In   
  • Create Account


#Actualfrob

Posted 27 August 2013 - 11:34 AM

The point is not that it causes ambiguity or strange behavior.

 

The point is that it makes the programmer stop for a moment to figure it out.  

 

Code should be obvious.  You should generally be able to tell at a glance what the code does.  Code that does something tricky should include a great big comment block explaining why it does what it does, the reason the programmer decided to take the less obvious route, and instructions for future developers who maintain it.

 

When I see "this->foo()" my brain needs to pause, if only for a moment, and ask why they are calling a function from the object rather than calling the function directly. 

 

Just the fact that my brain must switch gears for a moment, no matter how small that moment is, that is the issue.


#1frob

Posted 27 August 2013 - 11:32 AM

The point is not that it causes ambiguity or strange behavior.

 

The point is that it makes the programmer stop for a moment to figure it out.  

 

Code should be obvious.  You should generally be able to tell at a glance what the code does.  Code that does something tricky should include a great big comment block explaining why it does what it does, the reason the programmer decided to take the less obvious route, and instructions for future developers who maintain it.

 

Just the fact that your brain must switch gears for a moment, no matter how small that moment is, that is the issue.


PARTNERS