Understanding mindset and Learning Zones

I was wondering if the FCC team had read any of Carol Dweck’s research into learning zones?

I Just got to the module on Counting Cards in the JavaScript tutorial and found myself in what Dweck calls the panic zone. Having never found myself there before in an FCC module I was surprised.

The panic zone is outside both the comfort and the learning zones. In this case it was because I knew I didn’t know how to get two different things out of the same function, which if you read the parameters, it seems to be asking for. Because I knew what was happening I was able to overcome the problem, but wondered if others had felt the same way, and then wondered if this was the kind of thing the team took into consideration in planning and writing the modules.

Just a thought.

Hi @vegasartist !

Thank you for your post!

There are some challenges that will be easy for most users and some that will take longer to understand and solve.

What you are feeling is not uncommon.

The next time you are struggling with a challenge feel free to come and post your question on the forum and we are happy to help. :grinning:

Here are some upcoming challenges that give people the most trouble.
When you come across them, don’t panic because most people struggle with these :grinning:

Record Collection

Profile Lookup

Replace loops with recursion

Use recursion to create a countdown

Use recursion to create a range of numbers

Hope that helps!

#Jwilkins.oboe,

If you, or anyone looks at the challenge it says that you should write A function that does the counting and returns the count with a hold or a bet. Fine except that when I read write A function I made the grammatical assumption that A meant one. Which is how one should interpret this sentence.

My point was not about the logic of the problem but the fact that in the FCC official answer had two functions the second taking the count and giving a hold or bet. So the solution is Two not one function. This matters when you are learning because you are trying to glean any information that will help you solve the problem.

My point about the panic zone is that I panicked because of bad grammar not my inability to comprehend the problem. So my question was do you run these by anyone who checks for grammar that could lead to a misunderstanding. If the answer is ‘no’ I suggest that you consider adding this to your pre-launch protocol.

that is how someone else solved it, and it was added to the guild - the guild is made by user contributions

if there is an “official” solution, is the one in the challenge file freeCodeCamp/counting-cards.md at main · freeCodeCamp/freeCodeCamp · GitHub

it is the perfect to interpret the sentence

What?

None of that made sense to me.

The link you sent also has the same solution I was referring to. And ‘it is the perfect to interpret the sentence’ is incomprehensible.

To repeat what @ieahleen said:

Technically, freeCodeCamp has no “official” solution. That being said, this is the solution we (the devs) use one solution per challenge for testing purposes, which is the linked one:

var count = 0;
function cc(card) {
  switch(card) {
    case 2:
    case 3:
    case 4:
    case 5:
    case 6:
      count++;
      break;
    case 10:
    case 'J':
    case 'Q':
    case 'K':
    case 'A':
      count--;
  }
  if(count > 0) {
    return count + " Bet";
  } else {
    return count + " Hold";
  }
}

This can be considered the official one, as it was likely written by a fCC GitHub member, and is used to pass the challenge.

This is correct. I would interpret the instructions the same way. There are many ways to skin a cat, and same goes for solving challenges.

Summary: There is nothing incorrect about the “official answer”, because there is none.

Hope this clarfies

2 Likes

I must have interpreted wrong, you were talking about more than one function - that solution only includes the cc function, there is not a second one there

Hi again!

You actually don’t need two functions to solve this challenge.

You could solve it this way just using if/else statements.

var count = 0;

function cc(card) {
  // Only change code below this line
  if(card===2 || card===3 || card===4 || card===5 || card===6){
    count++
  }


  if(card===10 || card==='J'||card==='Q'||card==='K'||card==='A'){
    count--
  }

   if (count > 0) {
    return count + " Bet";
  } else {
    return count + " Hold";
  }

  
  // Only change code above this line
}

cc(2); cc(3); cc(7); cc('K'); cc('A');

I do hope that clarifies things.

Are you referring to this if/else statement at the end?

 if(count > 0) {
    return count + " Bet";
  } else {
    return count + " Hold";
  }

Because that is not a new function.

Could you clarify what you meant there?

I am more than happy to admit that I was missing pieces of the puzzle and that I am wrong.

But why am I wrong?

I went back and looked at the individual modules on functions and only found one that had back to back if statements and that was only in a part of the code that was not to be changed per the instructions. Nothing that I could find, and yes I could be wrong here too, has us make multiple if statements to create a function. Nor does anything have us write a switch statement followed by an if statement. In that sense we are looking at a gap in the progression of instruction. I had no idea these were possible.

Since I did not know this was possible, I assumed that the new if statement was a new function.

As to what is official or not. When given an answer via the website I am on that leads me to a video that has the “official” logo of the website I am on I am going to assume it is the “official” answer. Call me crazy.

And to clarify, I do not think official means only. Just correct.

Ok cool, I understand now.

As you move deeper into javascript your functions will become more complex.
It is common to use multiple if/ else statements in the same function.

It sounds like this is the first time you are working with a longer function.
I understand where the confusion is coming from.

Hope that helps!

You were wrong because you did not yet understand what function is and while i dont deny the FCC curriculum can be inconsistent at times, this was not the case. Functions are simply a complicated matter and you are yet to uncover how much more complicated they can become. The counting card challenge itself is a glimpse of what functions can do. There was nowhere in the curriculum(up to this challenge) being stated that you are limited on how much conditions you can put inside a functions body and thats only a limitation you’ve assumed for yourself. If there is a reason up to this point the example functions did not include more complex code is to spare newcomers from having to decipher extended lines of code. For what its worth, you can wrap your whole code in one big function :slight_smile:

@Sylvant, I am always happy to engage in a spirited debate about ideas and willing, as I have proven, to admit when I am wrong.

I am not willing to allow people to “read” my mind and tell me what I do and do not know. I understand what a function is. But computer programming is not an intuitive endeavor, it is a set of rules and procedures. To the degree that I did not realize that you could include multiple if statements one right after another, I was missing a rule, not a concept.

You are right there is no explicit statement about limitations. But I’ll bet you a million dollars that there are some limitations. What I did was to take the tools I had explicitly learned and tried to apply them. If guessing were all that was needed I would not need to go through what has consistently been an excellent course. If this course were riddled with errors or incorrect information I would not have bothered to say anything.

I made another assumption, which is that FCC is interested in closing the gaps, as it were. While I was wrong in my initial post, I still believe there is a gap as I think this issue points out.

Perhaps I am missing something, but I thought you were under the impression that the solutions in the guide post contained multiple functions. If that is what you thought when looking at those solutions, then you have or had a misunderstanding about what a function is.

Misunderstandings about what a function is, or other core programming concepts, are common and nothing to be ashamed or defensive about. We have all been there and had concepts we don’t understand. Everyone on the forum originally knew absolutely nothing about programming. I’m sorry these misunderstandings or frustrations have placed you in a “panic zone”.

Personally, I’ve made the best progress by accepting that I have an incomplete understanding of what was presented to me and asking lots of questions.

We love answering questions here on the forum, so every time you aren’t sure if you fully understand something, please ask!

Happy coding!

1 Like

I know that it’s more time-consuming, but I find it helpful to learn about a concept from multiple sources. The way that one informational source explains a concept can sometimes not be enough. Especially with programming, I try to go outside any one source when learning a new concept. For example, I found there a lot of different possibilities to manage app state cache in React and one learning source may only cover one library. But for your case, functions, go visit a few other sites and see the examples. Not this invalidates the feeling of panic in any way. When started my first front-end developer job, they used a framework called Sencha which I never saw in any tutorial and I was panicking for 2 months wondering if I was going to be able to wrap my head around it while having to develop features while I learned. Luckily. reaching out to others helped me out a lot.

2 Likes

I would have panicked too
There are to many options in front end :laughing:

But I agree with your point about using other sources.

@vegasartist you could look into the Modern JavaScript Tutorial.
It helped me alot when I went through the later sections :grinning:

Also, I feel like the new project based curriculum will help bridge the gap and make learning these concepts better.

The sheer number of cognitive distortions that have gone into the reply’s to my original post are mind numbing.

In referencing the “panic zone” I was talking about a concept created by Carol Dweck in her book “Mindset” . She talks about the three zones of learning 1. the comfort zone 2. the learning zone and 3 the panic zone.

I never said I was panicked. I found myself in the concept of the panic zone without enough information to solve the problem.

When I teach, I am a certified teacher, I now look for signs that a student has crossed over from the learning zone to the panic zone. It is usually because of incomplete information, misunderstanding etc… In children the panic zone often looks like a discipline problem or disengagement. It then becomes my job to get them back to the comfort zone and then encourage them to go into the learning zone better equipped.

Understanding the concept of a function is not the same as knowing everything about it. Children easily understand the concept of multiplication, but they may not remember all the multiplication facts for months or years.

If you look at the penultimate sentence in my original post you can see that what I am talking about is filling in the gaps of FCC, not my personal problems with functions. That is where I had hoped responses would be focused.

How to tell if you have created an educational gap. Easy. If you ask a question and the answer includes something you have not explicitly taught you have a gap. Gaps are like cavities, they are meant to be filled with solid material.

I think the general consensus is that no one thinks there is this gap except from you. I don’t see a need for a specific challenge to explicitly tell you that you can use multiple if statements inside a function especially considering this was shown to you in a previous exercise.

FCC is assuming that you can follow the logic that if you’re told a function wraps around code, and you’ve seen things like multiple variables being declared or a mix of things like variables and if statements in a function. Combined with there actually being a function with two if statements declared inside shown in a prior challenge. Then you can safely assume that you are allowed to use multiple if statements inside a function.

I absolutely understand that everyone interprets things different and learns differently and that’s exactly the purpose of having a forum. Although everyone is taught the same material some get stuck on challenges that others don’t and that’s okay and it’s what the forum is used for the bridge the gap for those who haven’t 100% followed the explanations given in the challenges.

Everyone will have a time where they don’t pick up something the way FCC had expected them to have done but that doesn’t mean we need to re-write a course for the minority, instead you can seek advice on the forums or check the hints.

2 Likes

You’ll find that a lot of us here on the forum are professional teachers ourselves. We are familiar with pedagogy, in theory and in practice.

free Code Camp is not perfect, but it’s pretty good at what it does. We’re constantly updating our lessons.

Learning to code is hard, and like I said, it’s ok that you misunderstood a concept(s). Misunderstanding, feedback, and growth is part of the learning process.

Unfortunately, we can’t cover each the literally infinite number of different ways that the logical components of code can be combined. Fortunately, there are lots of people here on the forum, so whenever you have a question or don’t understand something, you can always ask for help!

3 Likes