Search results
- Dictionaryindentation/ˌɪndɛnˈteɪʃn/
noun
- 1. the action of indenting or the state of being indented: "paragraphs are marked off by indentation"
- 2. a deep recess or notch on the edge or surface of something: "coastal indentations"
Powered by Oxford Dictionaries
I know that #defines, etc. are normally never indented. Why? I'm working in some code at the moment which has a horrible mixture of #defines, #ifdefs, #elses, #endifs, etc. All these often mixed in with normal C code. The non-indenting of the #defines makes them hard to read. And the mixture of indented code with non-indented #defines is a ...
Dec 9, 2015 · Setting the indentation in preferences isn't allways the solution. Most of the time the indentation is right except you happen to copy some code code from other sources or your collegue make something for you and has different settings. Then you want to just quickly convert the indentation from 2 to 4 or the other way round.
See How to fix Python indentation for more tools and techniques to clean up indentation to conform to standards (even if it already "works"). Keep in mind that tools cannot automatically fix errors for you ; they can only help with editing, or apply cosmetic changes that don't affect the meaning.
# Basically, same indentation forms a natural paragraph. ) # Indentation here. Same idea as the long dict case. the_next_line_of_code() # By the way, now you see how I prefer inline comment to document the very line. # I think this inline style is more compact. # Otherwise you will need extra blank line to split the comment and its code from others. some_normal_code() # hi this function is ...
Dec 6, 2009 · I don't like the first style at all - I think of #define as being a preprocessor instruction, even though really of course it isn't, it's a # followed by the preprocessor instruction define. But since I do think of it that way, it seems wrong to separate them. I expect text editors written by people who advocate that style will have a block indent/un-indent that works on code written in that ...
Jan 14, 2021 · There are, I think, fundamentally two different questions here: one about how the code should be indented, and one about the actual process of typing the code in order to get that indentation (that is: at the REPL, to unindent, just hit the Backspace key to remove the automatically-inserted indentation). Each of these questions, however, is better dealt with somewhere else.
1 level of indentation is... 1. It is completely illogical to have to agree on using N spaces when you could all use a single tab. Which, by the way, is exactly meant to do that. Indent. Once. 1 level of indentation = 1 single character, i.e. 1 single tab. And they are more handy because each coder may chose freely how to visualize it. Using ...
Aug 29, 2014 · However, because using 4 spaces for indentation instead of tabs has started to become something of a standard, many text editors will default to using 4 spaces as the method of auto-indentation, which is what results in a mixture of tab characters (ones that you hit the tab key for), and 4 spaces (ones that the editor put in for you). Python ...
Feb 15, 2017 · @iono In YAML, the line - - a can define the indentation of both the outer sequence (first -), the inner sequence (second -) and the scalar (a). Subsequent items of the inner sequence must be on the same level as the second -with only indentation preceding. You can't do this in a portable way with tabs, so the quoted text is indeed rational.
The textwrap.dedent function allows one to start with correct indentation in the source, and then strip it from the text before use. The trade-off, as noted by some others, is that this is an extra function call on the literal; take this into account when deciding where to place these literals in your code.