Updated Readme for Tetris
Check out the new ski-resorts
README
##PROTIP: README Love
READMEs are AWESOME. They are one of the best things you can add to a repo, (other than quality code), to make it look professional.
- Watch Recursion
- Definitely not.
- Depends on the context. But probably.
- I might recursively call "checkIfRowFull" for each row on the board before calling "clearRow" and "moveBlocksDown" in Tetris ;)
Step One: Watch Writing Testable JavaScript - Rebecca Murphey from Full Frontal 2012 (award for worst conference name ever?)
Consider the four responsibilities that Rebecca lists for client side code (hint: they're color coded).
- I think the overall divide of the list was most surprising: Presentation & Interaction, Data/Server Communication, Application State, Setup. It makes a lot of sense after hearing Rebecca's talk, especially with being cognizant of what you're actually testing.
Do you feel like you mentally split your client side code in IdeaBox and other past projects into these responsibilities?
- Yes - because of how "new" everything was. I think I also intermingled responsibilities on the list.
Step One: Watch Mary Rose Cook Live Codes Space Invaders from Front-Trends. (The second worst conference name ever?)
Watching Mary dream-drive-development gives me confidence in starting Tetris. I think I should follow a similar pattern as hers, moving up in complexity only after that base foundation is in place. I also think it's important to not get caught on little details off the start.
Read Node.js, Require and Exports and Organize Your Code with RequireJS
A way to contain variables/functions/classes and expose them using a module.exports syntax to export everything you specify.
Everying we're dealing with is sorting arrays. Consider Speed vs. Space when deciding what algorithm to use.
Notes:
- Insertion: good for small data sets and sorting in the browser, stable (alex before adam, etc.), doesn't take much space
- Bubble: looks similar to insertion sort, even if array is sorted we're checking through every item (slow)
- Merge: recursively split array to sort then merge (divide & conquer), won't work with a lot of data in the browser (memory constraint)
Pros:
I can explain how the new
keyword changes the way a function behaves.
- Yes
I can explain the implicit steps that happen in my function when I use the new
keyword.
- Kinda
I can explain the difference between an object's prototype and the prototype
property on the constructor function.
- Yes
I understand how to place method on a prototype.
I understand that functions in JavaScript can take any number of arguments.
- Yes, ultimate freedom.
I can describe the similarity between blocks in Ruby and anonymous functions in JavaScript.
- Anonymous functions allow you to pass a block similar to a Ruby enumerable setup.
Where are the methods available to all arrays (e.g. forEach
, map
, etc.) defined?
- Array.prototype