Mindset of the FCC course

As I am going through the course I am finding that each subsequent challenge incorporates aspects of programming that were not included in the previous challenges/lessons. Obviously computer programming requires a high level of problem-solving and one cannot rely simply on some concept or “structure” that they already know. You need to be critical, analyze problems, break them down and sometimes find unconventional(your conventions) solutions to the challenges.

Now, I do not want to look at the videos when I encounter a roadblock and because of that I spent 4 hours on a challenge the other day and I’m still only 90% sure “why” it worked.

I have had to research specific syntax and methods used in the challenge examples on the web because they hadn’t been covered previously ex: constr(basically a variable declaration) and unshift( opposite of push).

My questions are:

  1. When you hit a roadblock and do not want to look at the solution, what actions do you take to get the ball rolling again? (Online research? Mind Maps? Forum? Keep plugging in syntax until it works?)

  2. Is there a specific mindset that you adopt?

  3. Out of all the js challenges, which one did you spend the most time on (So far mine has been recursion. This is mostly because I didn’t understand the stack and had to do a lot of research on how the stack functions to know why (n - 1) can increment values rather than decrementing them in recursive functions)?

From what I can tell, my struggles are mostly related to mindset (algorithmic thinking). I am willing to but do not really want to spend 4 hours on a challenge. Is this normal?

Thanks again for all your support. You guys have been ace!

All the best,

Dave

Yes.

You are not alone. This is a particularly difficult concept for most beginners.

I sometimes spend 4 hours a day just thinking about what I am going to do before I actually officially do it. Programming is just as much about thinking and learning as it is about typing. You’ll get better with practice, but if you like to challenge yourself then there will always be new stuff to learn. If you don’t have the patience and desire to devote a lot of time to learning then you will not go far as a programmer.

  1. Yes. Online research. If everything else fails, try changing the syntax. Bruteforce approach more often than not works than most people want to admit.

  2. Depends on the situation. Sometimes, I look for other programming language solution of the same problem. That worked for me.

About recursion, I most likely won’t fully understand it until I can visualize the expansion stack.

For example, in Scheme (example taken from SICP) -

factorial

(define (factorial n)
  (if (= n 1)
    1
    (* n (factorial (- n 1)))))

Output (expansion)

(factorial 6)  ; basically, factorial(6); in JS

(* 6 (factorial 5))
(* 6 (* 5 (factorial 4))
(* 6 (* 5 (* 4 (factorial 3)))
(* 6 (* 5 (* 4 (* 3 (factorial 2))))
(* 6 (* 5 (* 4 (* 3 (* 2 (factorial 1)))))

;; after it has been expanded above
;; it's time to deduce it
;; below
(* 6 (* 5 (* 4 (* 3 (* 2 1))))
(* 6 (* 5 (* 4 (* 3 2)))
(* 6 (* 5 (* 4 6))
(* 6 (* 5 24)
(* 6 120)


720