Primitive JavaScript (BYOSP Part 7)
Posted by: K. Scott Allen,
on 28 Feb 2012 |
View original | Bookmarked: 0 time(s)
When starting into the animations I decided it was time to refactor. One problem was the little "updateState" calls floating around inside conditional logic always a bad sign. A second problem was the sheer number of strings and CSS selectors in the code. I've become more sensitive to primitive obsession in JavaScript. Some code I see is nothing but strings and numbers. I think the obsession hurts readability and maintainability. The selectors scattered in the slide presenter code do one of three...