My accomplishments in the last two days:
Now, this week is over. Instead of thinking forward on my next steps for the project, I kept thinking what I would do differently if I had the chance to start over. The one thing that stood up in my mind is debugging.
I noticed that I have developed a bad habit of going too fast in my project whenever my web app is not working or showing the way it should show. I would jump into my codes blindly, yet thinking I can find and fix the errors.
So, I will train and improve my debugging skills with rules I roughly came up with:
Before I go, I want to share my new favorite quote to all Hackbrighters in my cohort. I <3 you all!
- Delete a task
- Delete all completed tasks
- Actually established 3-way data binding with $bind from AngularFire (before it was just 2-way, not 3-way, duh)
- Move ($add & $remove) a task back and forth between Uncompleted and Completed lists in my Firebase
- Create a timestamp using .setPriority with negative priority (so, the array is reversed, showing the new item at the top instead of bottom)
- Fixed the web loading issues with promise and .then, so Firebase "promises" to give Angular the data before the web can proceed. Once Firebase completes its promise, .then the web can load happily.
- What I learned with Angular: ngClass, ngClick, ngRepeat, ngSwitch, ngCloak (the Harry-Potter-fan in me loves this one!)
Now, this week is over. Instead of thinking forward on my next steps for the project, I kept thinking what I would do differently if I had the chance to start over. The one thing that stood up in my mind is debugging.
I noticed that I have developed a bad habit of going too fast in my project whenever my web app is not working or showing the way it should show. I would jump into my codes blindly, yet thinking I can find and fix the errors.
So, I will train and improve my debugging skills with rules I roughly came up with:
- .............................................................Slow down...................................................................... Seriously, maybe drinking a beer might do me right.
- Don't spazzzz out like a mental woman every time you see RED. @.@
- Check the console in Chrome for any errors in your JavaScript or whatever clues you get.
- If error shows, then you know it's your JavaScript.
- If no error, then you know it's possibly somewhere in your HTML.
- If no error shows in HTML, then it's probably a typo problem. Check and make sure words match or looking for loose ends.
- If nothing shows up, use "debugger;" in Sublime Text or debug in the web console to help you narrow down where the error could be.
- If nothing absolutely shows up, maybe it's time for a short break and take a mind-breather. Come back to it later.
- As your last resort if nothing is working, ask someone to take a look at your codes.
- If you finally fix your error, give yourself a pat in the back. If your pair helps, endlessly thank him or her profusely!!!
Before I go, I want to share my new favorite quote to all Hackbrighters in my cohort. I <3 you all!
"Shoot for the moon. Even if you miss, you'll land among the stars."
Norman Vincent Peale