The Torrance Learning xAPI Cohort only has a few weeks left! I took a bit of an xAPI break this weekend, though, to finish up my next Free Code Camp project: a Simon game.
Back to Basics
That plan was really, really helpful when thinking about the functions I needed to create. However, one thing I think I may need to work on is actually crafting my functions. I’ve been reading a few articles about functional programming and realizing that I rely a lot on global variables and changing those variables throughout the program. It definitely works, but I take the point that all of these global variables being changed between functions could make it a bit hard to track down a problem in the future. I think it might be good practice to focus more on creating more self-contained functions with fewer or no side effects. That sounds hard… I definitely thought about it during this project, but opted for done rather than trying to refactor. Still, I think I’ll give it a try in the future and maybe even refactor this code for a more functional approach. Any other newbs out there feeling a little sloppy? What are you doing to create more self-contained functions?
Play the Game
Take a few minutes and try to beat Simone: http://codepen.io/anthkris/full/WGGAQz/ Let me know what you think!