• DocumentCode
    1397732
  • Title

    Why you should use routines...routinely

  • Author

    McConnell, Stephen

  • Author_Institution
    Construx Software, USA
  • Volume
    15
  • Issue
    4
  • fYear
    1998
  • Lastpage
    95
  • Abstract
    As an undergraduate computer science student, the author thought that the main reason to create new routines, instead of leaving all the code in one big routine, was to avoid duplicate code. This is undoubtedly the most popular reason for creating a routine, and it´s a good one. Similar code in two routines is a warning sign. David Parnas says that if you use copy and paste while you´re coding, you´re probably committing a design error. Instead of copying code, move it into its own routine. Future modifications will be easier because you will need to modify the code in only one location. The code will be more reliable because you will have only one place in which to be sure that the code is correct. That is one good reason to create a routine, but it hardly makes a complete list. There are many additional reasons to create routines, and many of them are more important than avoiding duplicate code: reducing complexity; limiting effects of changes; hiding sequences; improving performance; hiding data structures; hiding global data; promoting code reuse; planning for a family of programs; improving readability; improving portability; isolating use of nonstandard language functions; and isolating complex operations
  • Keywords
    software engineering; code reuse; complex operation isolation; complexity reduction; data structure hiding; duplicate code avoidance; global data hiding; limited change effects; performance improvement; portability; readability; routines; sequence hiding; Data structures; Databases; Documentation; Hardware; Information retrieval; Insurance; Monitoring; Operating systems; Performance evaluation; Testing;
  • fLanguage
    English
  • Journal_Title
    Software, IEEE
  • Publisher
    ieee
  • ISSN
    0740-7459
  • Type

    jour

  • DOI
    10.1109/52.687957
  • Filename
    687957