A modest proposal

                                                       PROPOSED STANDARD
                                                            Errata Exist

Internet Engineering Task Force (IETF)                   Adam Williamson
Request for Comments: 9999                                       Red Hat
Updates: 7159                                             September 2017
Category: Standards Track
ISSN: 9999-9999

     Let Me Put a Fucking Comma There, Goddamnit, JSON


   Seriously, JSON, for the love of all that is fucking holy, let me
   end a series of items with a fucking comma.

7 Responses

  1. Michael
    Michael September 9, 2017 at 6:37 am | | Reply

    A better solution is to make items seperable by white space and treat a , like any other form of white space

  2. Almjz
    Almjz September 9, 2017 at 6:46 am | | Reply

    Yeah, like just get rid of : and {} i mean who needs them all we need is good indenting and we are golden. Lets piss off pythonors while we are at it as well.

  3. Zamicol
    Zamicol September 9, 2017 at 3:12 pm | | Reply

    There’s json5 for that.

    json5 is the solution to this problem.

  4. Przemek Klosowski
    Przemek Klosowski September 11, 2017 at 10:49 am | | Reply

    Is this about generating JSON? Because if so, the right idiom is join(‘,’,@list). If you do not have a complete list (e.g. because it is too long, or because you’re creating it on the fly), append(‘,’,item) instead of append (item,’,’). It does require special-casing the first element (if (is_empty(list)) list = element.

    Trailing comma just looks weird; also, {item,} is different from {item, ”} now?

  5. Przemek Klosowski
    Przemek Klosowski September 12, 2017 at 7:34 am | | Reply

    “Trailing comma just looks weird” You are, of course, free not to use one.

    “also, {item,} is different from {item, ”} now?” Of course it is. Those are two very different things

    Right—I meant that when I am looking at your trailing comma I don’t know if it’s the end of the list or if it has a null last element. ‘WTF, Python’ has some examples of the surprising results when 0, ”, nil, false, {} etc are being operated against each other. Perl is also famous for ‘seven forms of FALSE’.

Leave a Reply to Zamicol Cancel reply

Your email address will not be published. Required fields are marked *