Abstract
Most of the time you want to create functions that do only one task. No multi-purpose functions—most of the time.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
Found in Andrew Hunt and David Thomas, The Pragmatic Programmer (Addison Wesley, 2000), page xiii.
- 2.
Software Tools in Pascal (Addison-Wesley, 1981), page 189.
- 3.
My choice is B. Exit messages C and D take too much time and code for an error that I expect rarely will be made. Message A simply exits the program with an error message. Message B does the same as A, but also causes the cursor to be placed on the assert line in the function.
- 4.
The alphametic was invented by Henry Dudeney, and first published in the July 1924 issue of the British Strand magazine.
- 5.
Alan W. Watts, The Spirit of Zen (Grove Press, 1958), page 61.
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2018 Michael Stueben
About this chapter
Cite this chapter
Stueben, M. (2018). Function Design. In: Good Habits for Great Coding. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-3459-4_5
Download citation
DOI: https://doi.org/10.1007/978-1-4842-3459-4_5
Published:
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-4842-3458-7
Online ISBN: 978-1-4842-3459-4
eBook Packages: Professional and Applied ComputingApress Access BooksProfessional and Applied Computing (R0)