Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Let this sink in though:

    [ 'apple'
    , 'banana'
    , 'orange'
    ]


That makes prepending an element a special case.


It makes it easier to read though because the least important parts are most easily ignored. The reader can focus on the contents of the list.


I don't really know why we even need commas for lists of things. Just use the white space.


I find it jarring compared to commas after the words, making the commas unnecessarily prominent.


In Clojure, commas are treated as whitespace and are thus completely optional.


This is so clearly superior. Delimiters are prefixes.

But the scale of technical debt this insight has revealed is depressing.


Saying this is clearly superior means you don’t keep your lists sorted. A sorted list is as likely to add something to the beginning as the end, where this solution has the same problem.


I just reverse the sort order when that case happens.


The only correct syntax/format

    [
      , a
      , b
      , c
    ]
If only there existed a language designer intelligent enough to support it


You want yaml

    key:
      - a
      - b
      - c


Lisp:

  (
    a
    b
    c
  )


Thank you for the humor!

I'm just suddenly slightly terrified someone's going to see this and think it's genuinely a good idea and make it part of the next popular scripting language, where lists are defined by starting commas or something :S




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: