AndrejHronco/squares — pull request #1 by zspencer (2012-09-06 13:40:21+00:00)
Title: Some feedback

Hey Andre,

Overall it looked pretty simple, which is good. A few things to keep in mind:

1) When reorganizing your code, look for ways to decrease the amount of things any one function has to know about. I.e. Separate DOM manipulation/inspection from normal logic.
2) A comment is generally an indication that your code has too much complexity to be read and understood. This level changes depending on the reader; but I try to write my code so a novice can read, understand, and change with some degree of confidence without the use of comments. An easy way to get more readability is to extract a method and name it something that reveals what/why it exists.
3) Decrease shared state! Variables that are modified within a few different functions are dangerous! This is just a simple < 100 line file, so it's not that big a deal. But it can get to be a big deal if you're not careful!