O'Reilly Forums: Beehive "this." Syntax Question - O'Reilly Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Beehive "this." Syntax Question

#1 User is offline   kinwolf 

  • New Member
  • Pip
  • Group: Members
  • Posts: 2
  • Joined: 27-February 14

Posted 27 February 2014 - 10:51 AM

Hi,

In the beehive solution, page 284(3rd edition) why use this.shiftsToWork = numberOfShifts instead of simply stating shiftsToWork = numberOfShifts

I don't see why "this" has to be used here. Am I missing something?

Thanks!
0

#2 User is offline   AndrewStellman 

  • Andrew Stellman
  • PipPipPipPipPipPipPipPipPipPipPip
  • Group: O'Reilly Author
  • Posts: 804
  • Joined: 08-October 08
  • Gender:Male
  • Location:Brooklyn, NY
  • Interests:Author of: "Head First C#", "Beautiful Teams", "Head First PMP", "Applied Software Project Management"

Posted 28 February 2014 - 12:34 PM

Wow, nice catch! No, you're not missing anything, that 'this' is extraneous. The funny thing is that was there in the second edition, too. Thousands and thousands of people have seen that code, but I think you're the first person to notice it. Good work!

Andrew


Andrew Stellman
Author, Head First C#
Building Better Software -- http://www.stellman-greene.com
0

#3 User is offline   kinwolf 

  • New Member
  • Pip
  • Group: Members
  • Posts: 2
  • Joined: 27-February 14

Posted 01 March 2014 - 12:17 PM

View PostAndrewStellman, on 28 February 2014 - 12:34 PM, said:

Wow, nice catch! No, you're not missing anything, that 'this' is extraneous. The funny thing is that was there in the second edition, too. Thousands and thousands of people have seen that code, but I think you're the first person to notice it. Good work!

Andrew



Glad I wasn't crazy and that it seems I'm actually understanding something :P
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users