3 ms·
> So that anyone viewing the code can choose the indentation width according to their own preference? It really can't be that hard to grasp... but viewing that
by jcelerier 5y ago
> So that anyone viewing the code can choose the indentation width according to their own preference? It really can't be that hard to grasp...
but viewing that code with anything other than the tab length it was written for breaks it !
here are some screenshots:
- I wrote the code with ts=4 and it looks as it must look:
https://imgur.com/Bgr6Pvl https://imgur.com/Bgr6Pvl
- if your editor is configured for two spaces tabs ? broken !
https://imgur.com/oxj2If7 https://imgur.com/oxj2If7
- if your editor is configured for eight spaces tabs ? broken !
https://imgur.com/puCqdL8 https://imgur.com/puCqdL8
- eMSF 5y agoWhy are you writing this to me? You already commented on (another) comment of mine which explained what is meant by indentation with tabs and alignment with spaces. A function call has an indentation level (depending on where it resides in the code); if for whatever reason you split the call on multiple lines, all the lines should have an equal amount of leading tabs to signal that level of indentation – different arguments in a function call do not have different indentation levels. If you choose to align the contents on the lines, for example to the opening parenthesis, you do so by using spaces. In your own words, this is "all those shenanigans" but you can't possibly try to convince me it is that hard to understand or would not work. Of course it does.
- jcelerier 5y ago> Why are you writing this to me? I just reply to the comment text > what is meant by indentation with tabs and alignment with spaces. but I said at the beginning that this was not good: > So instead you can introduce spaces for alignment ; now that you have spaces needed for alignment, why not just use spaces for everything instead of two characters ?? In my experience, allowing both tabs and spaces just leads to that kind of mess, consistently: https://github.com/gcc-mirror/gcc/blob/master/libstdc%2B%2B-v3/include/std/any?ts https://github.com/gcc-mirror/gcc/blob/master/libstdc%2B%2B-... and for zero good reason as alignment is a semantic thing, and tools cannot understand the semantics of your code (at a human level, not a "pl semantic" level)