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

Tables require sequences of structurally isomorphic operations. Columnized code can work very well for matrix calculations, for example.

But most code that has structural isomorphism should be replaced by a loop or a function composition; repeated structural isomorphism is a redundancy that can be eliminated.

Aligning the initialization of a bunch of unrelated variables is a bit of a mixed case. Sequences of initialization are much more common in older languages, like C, that don't permit delaying the declaration. I don't have a strong opinion either way. If the data being initialized is structural, a tabular format should definitely be used, if it isn't fighting the tool (some IDEs etc. autoformat, or lint complains on unnecessary whitespace). If data is not structural and the variables aren't strongly related to one another, I don't see a good argument in favour of alignment, particularly when variable names can have wildly different lengths, e.g.:

    source                            = 10;
    timeout                           = 20;
    wait_count                        = 30;
    ch                                = 0;
    accumulator                       = 40;
    access_denied_retry_callback_list = [];
I find this substantially harder to read (see name to value and vice versa) than non-tabulated initialization.

    source = 10;
    timeout = 20;
    wait_count = 30;
    ch = 0;
    accumulator = 40;
    access_denied_retry_callback_list = [];


To be fair, the readability problem can be solved like this:

    source      = 10;
    timeout     = 20;
    wait_count  = 30;
    ch          = 0;
    accumulator = 40;
    
    access_denied_retry_callback_list = [];
(Still, it's not tabular data, so it has no business being a table.)




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

Search: