Coder Social home page Coder Social logo

Comments (7)

lasjorg avatar lasjorg commented on June 2, 2024 1

I agree, it seems like an odd choice.

Unreachable code and variable scope should be taught separately.

from freecodecamp.

jdwilkin4 avatar jdwilkin4 commented on June 2, 2024 1

@naomi-lgbt or @Ksound22 ?

Are either of you free to make these updates?

I don't want to open a PR right before I go on vacation.

Thanks 👍

from freecodecamp.

hbar1st avatar hbar1st commented on June 2, 2024

ugh, I just saw step 52. I don't understand why step 51 would -implicitly- suggest that a person should create a new variable after the return only to point it out as wrong in the next step. step 51 should show us that a 'correct' declaration of the variable in a local scope will result in a ref. error when the variable is referenced beyond that scope.

As for teaching people not to put code after the return, that should be a -separate- and -unrelated- step in this case.

on the other hand, step 51 could -explicitly- tell people to put the new line of code after the return only to point out it is incorrect in step 52. At least this way, if a person knows enough to type it in correctly, step 51 could fail and make them type it into the wrong spot? (or just scratch this and take my original suggestion of fixing step 51 and teaching about not writing code after returns separately)

from freecodecamp.

Ksound22 avatar Ksound22 commented on June 2, 2024

@naomi-lgbt or @Ksound22 ?

Are either of you free to make these updates?

I don't want to open a PR right before I go on vacation.

Thanks 👍

Can we open it up for contribution?

from freecodecamp.

naomi-lgbt avatar naomi-lgbt commented on June 2, 2024

I'd prefer to see the instructions updated to specify putting the variable after the return - I think it's valuable information to teach.

from freecodecamp.

lasjorg avatar lasjorg commented on June 2, 2024

This is the first time campers will be taught about variable scope. They may have coded for less than half a day.

Adding unreachable code as part of teaching variable scope can muddy the water for the learner, where they may end up making a correlation between the two that doesn't exist.

I would suggest we split it up into separate steps that focus on each topic.

from freecodecamp.

naomi-lgbt avatar naomi-lgbt commented on June 2, 2024

I could work with that, yes

from freecodecamp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.