This is an alternative algorithm. But why would we ever want an alternative algorithm? There may be cases (during coding) when we want to do cross-checks on "size()". Thus, we could name this alternative something like "size2()", and use it only for that purpose.
Recall the algorithm we learned in Traversal. We'll copy and modify it to compute size as is shown below.
Traversal Algorithm Modified to Compute Linked List Size
count = 0
node = this.firstNode
While node is not null
Increment count
node = node.getNextNode()
Return count