afflux/osnxt — pull request #2 by thusoy (2014-01-14 21:00:13+00:00)
Title: Refactored

Some 'slight' refactoring. 'Should' be NO-OP, but there's been a lot of shoulds lately... Pull it down and see if it compiles, this should have less mental overhead and be more readable for externals (ie Ludovic).

Some of the changes:
* Introduce a function stopDriving() to save the slightly harder to interpret Off(OUT_MOVE).
* Add a map and vocabulary, to make sure the reader knows what we're talking about
* Declare and initialize all flags and variables at the top
* Break large functions up in smaller, easily digestible pieces with descriptive names
* Reuse these smaller pieces where possible (like crashAndAlignWithWall in both the wall routine and the opening movie)
* Ensure camelCase on variables and functions
* Remove a couple of redundant statements that became clear after refactoring (like stopping after turning)