Page 241 -
P. 241

custom data objects





                                                Tonight’s talk: Inheritance, a.k.a. He looks just like his father.







           Custom Class:                                         Inherited Class:
           Programmers like me because they get to
           control everything in their code…and you know
           programmers: they love to code.

                                                                Yes, they do. But sometimes writing everything from
                                                                 scratch is not the best design decision.
           Design! Phooey! Real programmers eat, sleep,
           dream, snore, and exhale code. All that design talk
           is for people who can’t code!

                                                                 Is it really? So, you’re saying it’s much better to do
                                                                 everything from scratch and repeat the work of
                                                                 others, because your way is the best way. Are you
                                                                 serious?!?
           No, no, no: you’re not listening. It’s all done with
           control. When you build everything from the
           ground up, you’re in control, as it’s all your code.

                                                                And you’re happy to reinvent the wheel, even
                                                                 though someone else solved that problem eons ago?
           Of course, especially when there are custom
           requirements to be taken into consideration. In that
           case, a brand-spanking new custom class is the only
           way to go.
                                                                 Not if you can extend someone else’s class to handle
                                                                 your custom requirements. That way, you get the
                                                                 best of both worlds: inheritied functionality (so
                                                                 you’re not reinventing the wheel) together with the
                                                                 custom bits. It’s a win-win situation.
          Yeah, right…it’s a win-win for you, not me.

                                                                 But it’s not about us: it’s to do with making the life
                                                                 of the programmer easier, even the ones that live to
                                                                 code, right?
           I guess so, although I’m still a fan of custom code…


                                                                                      you are here 4    205
   236   237   238   239   240   241   242   243   244   245   246