Method chaining + inheritance don't play well together?

后端 未结 15 755
北荒
北荒 2020-12-08 22:20

Consider:

// member data omitted for brevity

// assume that \"setAngle\" needs to be implemented separately
// in Label and Image, and that Button does need         


        
15条回答
  •  抹茶落季
    2020-12-08 22:43

    [rant]

    Yes. Quit this method chaining business and just call functions in a row.

    Seriously, you pay a price for allowing this syntax, and I don't get the benefits it offers.

    [/rant]

提交回复
热议问题