3 ms·
I would do the same, but it's unfortunately becoming more common for code formatting to be enforced with plugins, GitHub actions etc. start = getData( 0,
by Symbiote 6y ago
I would do the same, but it's unfortunately becoming more common for code formatting to be enforced with plugins, GitHub actions etc.
start = getData( 0, 0)
middle = getData( 50, -50)
end = getData(100, -100)
I would also exceed the line limit, if the arguments to only 1 of these lines are a bit longer. But apparently we now have to live with this:
start = getData(0, 0, 0, 0)
middle = getData(50000, -50000, 50000, -50000)
end = getData(100000, -100000, 1000000,
-100000)
(I have, completely accidentally, an extra zero in this. It would be easier to spot if it were aligned.)
- deleted 6y ago[deleted]
- Firadeoclus 6y agoThis is a good example. I think the ideal way to support this would be an editor/IDE using tables for alignment. The compiler doesn't need to know about tables, whatever information the editor needs could be encoded entirely in a comment line preceding the table contents (which the editor would hide/replace with the table header unless the user chooses to reveal it). Anyone using another editor would simply see a somewhat cryptic comment line followed by aligned code. And table-supporting editors could use a content hash to detect changes in the table contents and inform the user.
- Symbiote 5y agoElastic Tabstops is similar to what you propose, but using tab characters to form the tables: https://nickgravgaard.com/elastic-tabstops/#solution https://nickgravgaard.com/elastic-tabstops/#solution But it's 15 years since that was proposed.
- Firadeoclus 5y agoSimilar, and I like the idea of Elastic Tabstops. A significant difference is that Elastic Tabstops won't look right in an editor that doesn't support them. What I'm suggesting would use spaces in the file and put metadata in a comment (though it could be stored elsewhere, too).