Subclassing to avoid line length

Posted by Super User on Programmers See other posts from Programmers or by Super User
Published on 2013-10-22T20:54:02Z Indexed on 2013/10/22 22:02 UTC
Read the original article Hit count: 349

The standard line length of code is 80 characters per line. This is accepted and followed by the most of programmers.

I working on a state machine of a character and is necessary for me follow this too.

I have four classes who pass this limit.

I can subclass each class in two more and then avoid the line length limit.

class Stand

class Walk

class Punch

class Crouch

The new classes would be StandLeft, StandRight and so on. Stand, Walk, Punch and Crouch would be then abstract classes.

The question if there is a limit for the long of the hierarchies tree or this is depends of the case.

© Programmers or respective owner

Related posts about design-patterns

Related posts about software