Skip to main content

Function Design

  • Chapter
  • First Online:
Good Habits for Great Coding
  • 4075 Accesses

Abstract

Most of the time you want to create functions that do only one task. No multi-purpose functions—most of the time.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 34.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 44.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    Found in Andrew Hunt and David Thomas, The Pragmatic Programmer (Addison Wesley, 2000), page xiii.

  2. 2.

    Software Tools in Pascal (Addison-Wesley, 1981), page 189.

  3. 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. 4.

    The alphametic was invented by Henry Dudeney, and first published in the July 1924 issue of the British Strand magazine.

  5. 5.

    Alan W. Watts, The Spirit of Zen (Grove Press, 1958), page 61.

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2018 Michael Stueben

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

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

Publish with us

Policies and ethics