O'Reilly Forums: Dinner Party # 2 Question - O'Reilly Forums

Jump to content

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

Dinner Party # 2 Question CalculateCostOf Decorations in Constructor

#1 User is offline   BarelyConfused 

  • New Member
  • Pip
  • Group: Members
  • Posts: 1
  • Joined: 15-November 12

Posted 15 November 2012 - 04:03 PM

Can someone explain to me why we need the CalculateCostOfDecorations(fancyDecorations) in the constructor?.. It works the same when you take that line of code out because its already being called when we access the numberOfPeople property, but there must be a reason why we still need it right?
0

#2 User is offline   Sikta_26785 

  • Active Member
  • PipPipPip
  • Group: Members
  • Posts: 67
  • Joined: 18-May 11

Posted 15 November 2012 - 07:32 PM

Even great programmers make mistakes once in a while. It's not a big mistake since it doesn't show up as a bug just could be done away with due to its redundancy. FYI, I didn't look at the code but I remember another conversation a while back about the same issue and I'm assuming this is the same chunk of code.
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