Skip to content
Ben Forrest edited this page Jul 20, 2015 · 2 revisions

Not modelling the rules

One of the commonest problems in the bowling challenge is not understanding and/or modelling the rules! Check that the code correctly handles spares, strikes and - as an added bonus - the final frame!

Reliance on implementation details.

It's common to see objects relying on the internals of other objects or their implementation of low-level types (particularly arrays)

Little or no testing of edge cases

Many solutions rely on a 'virtuous consumer' - i.e. they do not validate inputs or check for out of range values etc.

Poor function naming

Function names should ideally start with a verb so it's clear that they do something to something else.

For example, a function that calculates the score should be named calculateScore. A function named score should probably only return a score that was already calculated.