Skip to Content
Clean Code: A Handbook of Agile Software Craftsmanship
book

Clean Code: A Handbook of Agile Software Craftsmanship

by Robert C. Martin
August 2008
Intermediate to advanced
464 pages
13h 48m
English
Pearson
Content preview from Clean Code: A Handbook of Agile Software Craftsmanship

3Functions

Image

In the early days of programming we composed our systems of routines and subroutines. Then, in the era of Fortran and PL/1 we composed our systems of programs, subprograms, and functions. Nowadays only the function survives from those early days. Functions are the first line of organization in any program. Writing them well is the topic of this chapter.

Consider the code in Listing 3-1. It’s hard to find a long function in FitNesse,1 but after a bit of searching I came across this one. Not only is it long, but it’s got duplicated code, lots of odd strings, and many strange and inobvious data types and APIs. See how much sense you can ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Designing Data-Intensive Applications

Designing Data-Intensive Applications

Martin Kleppmann

Publisher Resources

ISBN: 9780136083238Purchase Link