October 2021
Intermediate to advanced
336 pages
9h 16m
English
This chapter covers
if with else and Never use switchif statements with Replace type code with classes and Push code into classesAt the end of the last chapter, we had just introduced a handleInput function that we could not use Extract method (P3.2.1) on because we did not want to break up the else if chain. Unfortunately, handleInput is not compliant with our fundamental Five lines (R3.1.1) rule, so we cannot leave it as is.
Here’s the function.
Listing 4.1 Initial
function handleInput(input: Input) ...
Read now
Unlock full access