P. 43: Explanation of method names

The authors explain that by convention method names in Swift include the name of the first parameter(tacked onto the end of the method name). Then, on p. 47 the authors define the tick(_:slight_smile: method like this:

func tick(dt: NSTimeInterval) { ... }

Following the conventions previously stated, the tick method should have been named something like:

tickForDt(dt: NSTimeInterval) { ... }

But because “tick” really has no meaning there, a more descriptive name might be something like:

updatePropertiesAfterTimeIntervalDt(dt: NSTimeInterval) { ... }

And a name like that adheres more closely to the Cocoa convention of picking names that are so long that your code has no chance of fitting on an 80 space line–nor on a line in a book that is significantly taller than it is wide. :frowning:

Right you are. If I were to name that method today having read this feedback, I might call it:

func tickForTimeInterval(dt: NSTimeInterval) {
    ...
}

Or possibly use another verb like “update” or “simulate”. I must have thought I was writing C while working on this chapter. :wink: