+ 3
There is an actual objective reason of choosing tab or spaces to indent?
I saw many discussions on why one should be used instead of the other, but they don't usually have a good argument.
7 Antworten
+ 14
Tab. Reason: laziness.
OK, that's not really objective. But laziness is a wide spread disease among coders. So, it might be something like common sense.
But I'm looking forward for better reasons like... indentation in Python?
+ 6
@Baptiste Eclipse here, auto format save action (or Ctrl+i) -> tabs.
+ 4
1 TAB saves you 6 SPACES!
+ 3
@Tashi N, on some IDE (emacs is the one I know, and yes, emacs can become an IDE :p), you can press tab in the middle of a line to have it correctly indented, and pressing tab just add spaces and not the '\t' character
+ 3
in Python it is crucial. if you mix spaces and "real" tabs the code will not work. I said "real" because many text editors and IDLE do substitute tabs for spaces.
+ 3
Thanks for your responses. I am actually in favor of tabs to prevent the mistyping of spaces, it secures quality in your indentation, so my purpose was to know the benefits of using spaces. I like to see every perspective.
+ 2
Tabs for the indentation, spaces to align. That said, tabs are a very good option, first because of the size (1 tab = 1 byte, and 4 spaces = 4 bytes), second because it makes the code more flexible to any editor configured with a specific tab size (some people use 2 spaces width, others use 6, I prefer 4).