This is an oversimplified example. When I imagine how both approaches would look like in actual production code with much more complex requirements, it makes much more sense.
Indeed. You should keep the complexity to a reasonable level, lines of code tends to correspond to it so it makes sense to keep the number of lines of code per function low.
The author doesn't understand the relationship, he blindly follows the advice to keep the number of lines low without considering the complexity and that leads to unnecessarily complex code.
Re:Why Swift Guard Should Be Avoided
by therockhead on Saturday January 02, 2016 @07:09AM
(#10825952)
Agree completely, it comes across that the author of the post has read some useful guidelines and created a strict rule which must not be broken.
That isn't software engineering. That is religious fanaticism.
E.g.
Is a very low complexity statement. One comparison is made and an enum value is thrown. You are gaining no clarity by placing this inside a separate function.