Cart (Loading....) | Create Account
Close category search window
 

Why you should use routines...routinely

Sign In

Cookies must be enabled to login.After enabling cookies , please use refresh or reload or ctrl+f5 on the browser for the login options.

Formats Non-Member Member
$31 $13
Learn how you can qualify for the best price for this item!
Become an IEEE Member or Subscribe to
IEEE Xplore for exclusive pricing!
close button

puzzle piece

IEEE membership options for an individual and IEEE Xplore subscriptions for an organization offer the most affordable access to essential journal articles, conference papers, standards, eBooks, and eLearning courses.

Learn more about:

IEEE membership

IEEE Xplore subscriptions

1 Author(s)
McConnell, S. ; Construx Software, USA

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

Published in:

Software, IEEE  (Volume:15 ,  Issue: 4 )

Date of Publication:

Jul/Aug 1998

Need Help?


IEEE Advancing Technology for Humanity About IEEE Xplore | Contact | Help | Terms of Use | Nondiscrimination Policy | Site Map | Privacy & Opting Out of Cookies

A not-for-profit organization, IEEE is the world's largest professional association for the advancement of technology.
© Copyright 2014 IEEE - All rights reserved. Use of this web site signifies your agreement to the terms and conditions.