Your Cart
Loading

Code Clinic - The Build - Book 1: Functions That Work for You

On Sale
$12.00
$12.00
Added to cart

Stop writing the same five lines twice. That habit has a name, DRY, and this book turns it into working code. You take a function apart piece by piece: the def line, the parameters that go in, the body, and the return value that comes back out. From there you write functions that hand back a whole dictionary instead of a single value, so one call gives you a labelled record rather than a loose string. You meet the ternary, a one-line way to reach for a field that may not be there without your program stopping. You call functions from inside other functions, which is how small pieces of logic stack into something larger. Then comes the router pattern: one function that looks at what it has been handed and sends the work to the right specialist function. By the last chapter you point all of it at a raw hospital message and parse the whole thing into clean labelled records.


Twenty A4 pages, in full colour. Written in short sentences and plain English, for readers whose first language is not English and clearer for everyone else because of it.


Every code example in this book was run before the page was printed, so the output you read is the output you get. Instant PDF download. By M.R. Sterling.

You will get a PDF (1MB) file