Here's a general workflow that you ought to think about while doing homework:
- Read any instructions completely.
- Dive in; don't spend too much time planning. Break the problem into the smallest steps you can think of and get started on the first one.
- Code until you get stuck on something for at least 15 minutes.
Ok, you're stuck. Now what?
Talk it out, ideally to a pair partner, but to a rubber ducky if necessary, starting from step 1. There's always a starting point.
For example, if you are trying to get an element on the page to appear a certain way but it isn't working, step 1 is usually, "What HTML element am I trying to style?"
Then, "Do I have a way to select it?" Then, "Am I actually targeting the element in question with my CSS selector? How can I prove that I am?" (Hint: make an obvious change, like adding a red border or making the font color red). Make the invisible visible.
Or sometimes, even before that, a mistake I often make: am I even working on the right file? Sometimes I have several copies of a project laying around, and I am editing one source code file while refreshing a different one in Chrome, and pulling my hair out over why nothing is changing.
Break it down into the tiniest steps that you can and verify that you what you think is happening is actually happening at each step. Otherwise, isolating the cause of the problem becomes very hard. If you do work in small steps, it becomes easy. Work in small steps.
Okay, so you've started over on the issue, double-checked everything, Googled, asked friends, and you still can't figure out why it isn't working. Everything looks right! What's the problem?!
Once you've struggled for at least 30 minutes (15 minutes of initial getting stuck, 15 minutes of reasoning through it from step 1), it's time to get help. Don't get frustrated!
If the assignment is to re-do what we did in class, it's time to refer to the solution. Most of the code we write together in class will be on GitHub, so you can simply see what we did there; or review the video. However, once you get yourself unstuck, close the solution immediately and struggle on -- until you get stuck for another 15 minutes. Rinse and repeat.
If the solution isn't available or is not enough, post a thread on the forum, or email me (CC all of the coaches too). We're here to help.
When you are posting a question, either here or in an email to me, make sure to include
- a description of the issue with as much detail as possible -- error message, code, screenshot, etc
- a list of things you've tried so far to diagnose and fix the problem, and the results
On the forum, use the code formatting button on the toolbar to make code look nicer.
If you aren't asking us lots of questions, then you're not doing this class right!
Happy coding,
Raghu
P.S. Students have reported the best learning outcomes with the following approach:
- After class each day, sit down at a blank screen and start trying to rebuild what we did. Usually, you get stuck after about 2 minutes, even if what we did in class made perfect sense to you at the time.
- Follow the process above to get unstuck.
- Rinse and repeat until you have rebuilt the in-class application.
Now, start over from scratch again. Rebuild. Hopefully, you should only get stuck once every 10 minutes this time, instead of once every 2 minutes.
Rinse and repeat until you can rebuild the app from scratch without getting stuck at all.