3 ms·
> If it doesn't show up in the syntax tree, it doesn't have meaning. Why did you use paragraphs to write your comment then? People read the code thats written.
by tayo42 5y ago
> If it doesn't show up in the syntax tree, it doesn't have meaning.
Why did you use paragraphs to write your comment then? People read the code thats written.
- solarmist 5y agoAuto formatters support paragraphs, but they don't support I'm going to give this paragraph 2 blank lines because it's particularly important/complicated/blah.
- tayo42 5y agoOh interesting thanks! I couldn't find it in the docs before
- solarmist 5y agoYeah, I don't think it's mentioned because it feels like supporting spaces between words, I’d guess. Just so fundamental a functionality it's assumed.
- mumblemumble 5y agoTypographic standards typically don't, either. Fortunately, there's more than one way to convey emphasis. Also, single functions that are long enough to contain something analogous to paragraphs are arguably not Pythonic in the first place.
- solarmist 5y agoFor paragraph I just mean a series of 1 or more lines separated by a blank line vs no blank lines.
- Mawr 5y agoAre there two blank lines between these parts of the code for a reason or did the person who wrote this code make a mistake? If that part of the code is special for whatever reason, add a comment saying why.
- Qub3d 5y agoI think the argument is not that structure should be dispensed, or that it doesn't matter, rather that a given style convention is fungible, and we should probably all just pick something good enough and get on with it, because the code will execute regardless of whether we use " or ' around our strings. Spend some time considering the language standards, but then ship it for god's sake. See also from Peter Norvig[0]: * Get involved in a language standardization effort. It could be the ANSI C++ committee, or it could be deciding if your local coding style will have 2 or 4 space indentation levels. Either way, you learn about what other people like in a language, how deeply they feel so, and perhaps even a little about why they feel so. * Have the good sense to get off the language standardization effort as quickly as possible. [0]:https://www.norvig.com/21-days.html https://www.norvig.com/21-days.html
- tayo42 5y agoI actually had this formatter thing happen at work. We have code that generates more python code. Now the quotes are changed and we need escapes because a rule it being applied. Escapes are harder to read and look messier.