4 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... It can still be ar
by eMSF 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...
It can still be argued that it's not worth the trouble, especially with the poor tooling available, but what I can't really understand is how supposedly smart people turn off their inner logic when it comes to such a simple concept.
- 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)
- mlang23 5y agoFeels like the vi vs emacs fight. For some people, it seems easy to only see their side and consider the others "smart but dumb" or similar. The reality is probably somewhere else. Tastes differ, and just because someone is not sharing your view on things doesnt necessarily mean they are doing something wrong.
- giardini 5y agoeMSF says "what I can't really understand is how supposedly smart people turn off their inner logic when it comes to such a simple concept." It's part of our human nature, which sometimes gets out of control. Imagine the following as a programming languages discussion rather than a religious one, and ending (rather abruptly) instead with "Spaces vs Tabs": https://www.theguardian.com/stage/2005/sep/29/comedy.religion https://www.theguardian.com/stage/2005/sep/29/comedy.religio... That's us!