logoalt Hacker News

airbreathertoday at 3:34 AM0 repliesview on HN

I would suggest that the 1000 line switch statement implies a state machine that has suffered from the "state explosion".

This usually results from an inadequate system-subsystem decomposition and/or not considering modes, both of which lead to hierarchal state machines instead of one big flat one.

This aspect of architecture is difficult to teach, it is one of the "black arts" that comes from experience and is difficult to codify.

Just one example why, is that often it might require the synthesis of state machines not directly evident as needed from the functionality, eg to perform a one to many or many to one functionality.