Relative Content

Tag Archive for anti-patterns

Preventing a parser from turning into a (seemingly) god-sized object

So I have a program whose purpose is to take text files and parse them into a binary format that an embedded system understands. However, the text format I’ve inherited that I need to parse is sufficiently complex enough that after refactoring the main parse routine I’m left with a class with more than 50 methods that almost all look something like parseChannel, parseWCommand, parseVCommand, parsePCommand, parseLoop, parseHex, parseInt, etc. etc. etc.