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

> For example, clang-format at $day_job doesn't understand semantically that I want my 4x4 matrix constant to be formatted as 4 rows with 4 numbers each

Comments can be a low-key forced line break:

    int matrix[16] = {
        0x0, 0x1, 0x2, 0x3, //
        0x4, 0x5, 0x6, 0x7, //
        0x8, 0x9, 0xA, 0xB, //
        0xC, 0xD, 0xE, 0xF, //
    };



Usually in cases like these I prefer to add the magic “formatter off” comment around the block: it’s self-documenting.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: