Hacker News new | past | comments | ask | show | jobs | submit login

I think code formatters are a great idea, but they're not quite clever enough for me yet.

For example, if there's a common pattern among a set of lines, I'll often line them up vertically to make the repetition clear and focus attention on the differences rather than the commonalities; for example:

    if (foo  ||
        quux ||
        baz) {
      ....
    }

    let foo  = 10
        quux = foo  * 2
        baz  = quux + 1
     in baz * 2

    fields = ['name', 'address', 'country',
               'dob',  'status',  'salary']
To me, those few extra spaces make it easier to glance over the code than without:

    if (foo ||
        quux ||
        baz) {
      ....
    }

    let foo = 10
        quux = foo * 2
        baz = quux + 1
     in baz * 2

    fields = ['name', 'address', 'country',
              'dob', 'status', 'salary']



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

Search: