The third productivity mechanism is to reuse portions from past designs rather

The third productivity mechanism is to reuse portions

This preview shows page 56 - 58 out of 517 pages.

highlight examples that improve productivity by generating code with this “CodeGen” gears icon. The third productivity mechanism is to reuse portions from past designs rather than write everything from scratch. As it is easier to make small changes in software than in hardware, software is even more likely than hardware to reuse a component that is almost but not quite a correct fit. We highlight
Image of page 56
examples that improve productivity via reuse with this “Reuse” recycling icon. Procedures and functions were invented in the earliest days of software so that different parts of the program could reuse the same code with different parameter values. Standardized libraries for input/output and for mathematical functions soon followed, so that programmers could reuse code developed by others. Procedures in libraries let you reuse implementations of individual tasks. But more commonly, programmers want to reuse and manage collections of tasks. The next step in software reuse was therefore object-oriented programming , where you could reuse the same tasks with different objects via the use of inheritance in languages like C++ and Java. While inheritance supported reuse of implementations, another opportunity for reuse is a general strategy for doing something even if the implementation varies. Design patterns , inspired by work in civil architecture ( Alexander et al. 1977 ), arose to address this need. Language support for reuse of design patterns includes dynamic typing , which facilitates composition of abstractions, and mix-ins , which offer ways to collect functionality from multiple methods without some of the pathologies of multiple inheritance found in some object oriented programming. Python and Ruby are examples of languages with features that help with reuse of design patterns. Note that reuse does not mean copying and pasting code so that you have very similar code in many places. The problem with copying and pasting code is that you may not change all the copies when fixing a bug or adding a feature. Here is a software engineering guideline that guards against repetition: Every piece of knowledge must have a single, unambiguous, authoritative representation within a system. Andy Hunt and Dave Thomas, 1999 This guideline has been captured in the motto and acronym: Don’t Repeat Yourself (DRY) . We’ll use a towel as the “DRY” icon to show examples of DRY in the following chapters. A core value of computer engineering is finding ways to replace tedious manual tasks with tools to save time, improve accuracy, or both. Obvious Computer Aided Design (CAD) tools for software development are compilers and interpreters that raise the level of abstraction and generate code as mentioned above, but there are also more subtle productivity tools like Makefiles and version control systems (see Section 10.4 ) that automate tedious tasks. We highlight tool examples with the hammer icon.
Image of page 57
Image of page 58

You've reached the end of your free preview.

Want to read all 517 pages?

  • Spring '19
  • Dr.Marcos

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes
A+ icon
Ask Expert Tutors