Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Record Collection challenge has incorrect JSON syntax #8955

Closed
aleksgorbenko opened this Issue Jun 4, 2016 · 8 comments

Comments

Projects
None yet
6 participants
@aleksgorbenko
Copy link

aleksgorbenko commented Jun 4, 2016

The task says: "You are given a JSON object representing..."

Start of the example code given at the start:

var collection = {
    2548: {
      album: "Slippery When Wet",
      artist: "Bon Jovi",
      tracks: [ 
        "Let It Rock", 
        "You Give Love a Bad Name" 

Quote on JSON objects from MDN:

JSON permits only property definition using "property": value syntax. The property name must be double-quoted, and the definition cannot be a shorthand.

Source: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Object_initializer#Object_literal_notation_vs_JSON

Hence, the statement that it is a JSON object is wrong - it is JS object as properties are not written as strings. Personally, it made me confused because there is another task:
https://www.freecodecamp.com/challenges/profile-lookup
Where properties are written correctly with quotes. As a result, it made me think that both options are the correct declaration of JSOn objects.

I hope that can be fixed.

Thanks,
Aleks

@erictleung

This comment has been minimized.

Copy link
Member

erictleung commented Jun 5, 2016

@aleksgorbenko thanks for the feedback. And you are correct. This is also related to #7767.

@karel1980

This comment has been minimized.

Copy link
Contributor

karel1980 commented Jun 5, 2016

I would like to work on this

@karel1980

This comment has been minimized.

Copy link
Contributor

karel1980 commented Jun 5, 2016

I'm a bit conflicted about the best approach here. We could simply state that it is a "Javascript object" instead of a JSON object (i.e. leave out the term JSON), or change the javascript so that object keys are quoted.
I actually prefer the former, because there is no JSON here. JSON is just a representation format which looks a lot like javascript. Sure, with proper quotes a particular part of the source code could be interpreted as JSON, but in the given context it's still javascript.
WDYT?

@aleksgorbenko

This comment has been minimized.

Copy link
Author

aleksgorbenko commented Jun 8, 2016

@erictleung - you are right about the other post, missed that one.
@karel1980 - I think the best would be just to put quotes around the properties and then the description matches the code + code will be consistent with the other challenge - https://www.freecodecamp.com/challenges/profile-lookup , therefore causing less confusion.

@keevkeev

This comment has been minimized.

Copy link
Contributor

keevkeev commented Jun 10, 2016

hello, I would like to help with this issue, however I have never submitted to an issue before. Do I need to retrieve the specific file for Record Collection challenge or do I simply fork the repo, add the changes to a new branch and then submit a pull request? I'm a little lost so I apologize if the answer is straight forward and it's just going over my head

@ghost

This comment has been minimized.

Copy link

ghost commented Jun 10, 2016

@andmckvr13

do I simply fork the repo, add the changes to a new branch and then submit a pull request?

Correct

Please, check our Guidelines for Contributing and if you need any assistance reach out to the Contributors Chat room.

@karel1980

This comment has been minimized.

Copy link
Contributor

karel1980 commented Jun 10, 2016

You should fork the repo, make changes in a branch an submit a pull request.
I have already made the changes locally, I just never got around to testing
them. I'm committing them now so you can work from there if you like.
Here you go:
https://github.com/karel1980/FreeCodeCamp/tree/feature/correct-json-syntax

Here is some more information about the process:
https://github.com/FreeCodeCamp/FreeCodeCamp/wiki/Pull-Request-Contribute

On Fri, 10 Jun 2016 at 16:15 Andrew McKeever notifications@github.com
wrote:

hello, I would like to help with this issue, however I have never
submitted to an issue before. Do I need to retrieve the specific file for
Record Collection challenge or do I simply fork the repo, add the changes
to a new branch and then submit a pull request? I'm a little lost so I
apologize if the answer is straight forward and it's just going over my head


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#8955 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAJVvRBTi6TlOCSn3oNcCAPvlqiR5hEFks5qKXFxgaJpZM4IuJYV
.

@LindsayDenotes

This comment has been minimized.

Copy link
Contributor

LindsayDenotes commented Jun 11, 2016

+1 @aleksgorbenko, @erictleung, @karel1980, @andmckvr13 @andmckvr13, @aleksgorbenko @atjonathan
I am relieved that you all have addressed that the Record Collection problem https://www.freecodecamp.com/challenges/record-collection does not contain valid JSON syntax. I would also like to address that the instructions contain vague wording; i.e., the word "property" is being used to refer to the more specific and more accurate word "key." For example, "Write a function which takes an id, a property (prop), and a value."

The ECMAScript 2015 standard defines a property as the part of an object that associates a key (either a String value or a Symbol value) and a value (source: http://www.ecma-international.org/ecma-262/6.0/#sec-property). So, a property consists of a key - value pair. (source: http://spacetelescope.github.io/understanding-json-schema/reference/object.html#properties). The vague word choice in the Record Collection problem's instructions causes confusion for campers who are already familiar with the definition of property; further, instructions should provide a definition for important terminology for that lesson; in this case, the word "property," which is an important aspect of the JSON schema.

I plan on rewriting the instructions and making a pull request this weekend (June 11-12, 2016).

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.