THE STATE HOOK lesson is poorly designed

At the beginning of this lesson we are told this:

Classes, however, are not simple. They:

  • are difficult to reuse between components
  • are tricky and time-consuming to test
  • have confused many developers and caused lots of bugs

…With Hooks, we can use simple function components to do lots of the fancy things that we could only do with class components in the past.

Yet after that lesson, here I am sitting without any idea of what I’ve learned, to such point that I couldn’t do the lesson review exercise.
Hooks are supposed to make everything simple yet Codecademy made this into one of the most difficult subjects.

I don’t know why this lesson was made in this way (without any clear explanation or even one single hint), but it surely made everything worse.

I was very excited to learn Hooks since they are the new feature that many use but right now, I actually find class components easier to understand. I know it’s optional to use whatever method one’s comfortable with but that isn’t an excuse.

If you think I’m overreacting just look at this part from this exercise:
The step says this:

Add an onFirstQuestion variable with a boolean value then use that value to toggle the disabled attribute of the “Go Back” button on and off.

The solution is this:

const onFirstQuestion = questionIndex === 0;
............
<button disabled={onFirstQuestion} onClick={goBack}>

Now just tell me how can someone learning through these lessons get to that code by just reading that step (without any hint!)?

As of now, I’m very disappointed with Codecademy and am sure others going through this part feel the same way.

I really hope Codecademy fixes their lessons so that we can actually learn stuff and not just gain this false confidence from copying/pasting stuff.

P.S. My advice to you who’s reading this is to find another more clear and comprehensive source for learning React Hooks until Codecademy fixes this poorly designed lesson.

UPDATE:

It seem that Codecademy has provided the lessons of useState() and useEffect() with hints for each step.
It’s really nice to see them improving their exercises by listening to our feedback.

Thank you very much for this, Codecademy!

1 Like

I’m glad I’m not the only one who feels this way. I learned a lot and I feel like I understand the lesson material but the projects are ridiculous. First they cut everything into baby sized chunks like they are afraid to let you try to code it on your own. For instance they will just have you put in the default value for a useState() variable declaration. Then out of nowhere when you have almost no experience with the .filter method which they barely brushed over in the JavaScript course they want you to use it inside a state setter function which is inside an event handler and give you no clues on what you are supposed to do when they never even brought up a filter function before that.

This poster is right the end project equally absurd. Could you imagine your first day on a job where your boss goes. “Hey rewrite this whole section with Hooks instead of class components and oh yeah use this code editor where you can’t see any errors that pop up and by the way even if your code works and gives the desired effect we are still going to say your code is wrong and you can’t continue to a new ticket!”

1 Like