Google’s C++ style guide caps lines at 80 characters and admits the rule is controversial. Google’s Go style guide says there is no fixed line length. Both come from the same company, and both are defensible. That gap tells you most of what you need to know about style debates. Many settings are choices shaped by a language, a codebase, and a team’s tools, not facts waiting to be discovered.
A few style questions do have real consequences for readers, diffs, or correctness. This article separates what the official guides say, what one controlled experiment measured, and what is editorial judgment, so you can decide where review energy should go.
The one claim every guide agrees on
PEP 8, the Python Software Foundation’s style guide, opens its case with a blunt sentence: “A style guide is about consistency.” Google’s C++ guide makes the same move when it defends its 80-column rule: “We recognize that this rule is controversial, but so much existing code already adheres to it, and we feel that consistency is important.”
Note what these quotes are. They are the guides’ own rationales, not independent empirical findings. They argue that a shared convention lowers the cost of reading someone else’s code. They do not argue that the particular setting is optimal.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →#1 Best Overall
- Careercup, Easy To Read
- Condition : Good
- Compact for travelling
Tabs or spaces, and how wide is an indent?
PEP 8 prefers spaces for Python indentation. It permits tabs only to stay consistent with code that already uses them, and it prohibits mixing the two for indentation, which Python itself disallows. Google’s C++ guide also prescribes spaces, with two-space indentation.
Those are language- and organization-specific rules. None of the sources show that one indentation width is easier for every team. The practical concern is narrower: block structure should look the same in every editor and review tool. Mixed indentation breaks that, and in Python it can break the program. Everything else is a matter of following the language convention and the existing repository.
Is an 80-character line limit useful?
This is the clearest sourced disagreement.
The case for a hard limit
Google’s C++ guide sets a maximum of 80 characters, with exceptions such as unsplittable URLs and certain literals. It says the limit accommodates side-by-side windows and established user expectations.
Rank #2
- New design has wider shelves and supports, increasing stability for wide books. Shelf width is now 14.5".
- Easily holds two large medical coding books.
- Made in the USA - Minor assembly required.
The case against
The C++ guide itself records the objection that modern screens can display wider lines. Google’s Go guide goes further and sets no fixed length. If a line feels too long, it says to consider refactoring, and a long line is acceptable when it is already as short as practical.
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Repair Windows errors before they cause bigger problems3Fix the driver behind crashes, sound loss and screen glitchesHow to decide for your team
- Review setup: if people review diffs side by side or in narrow panes, a limit protects them.
- Wrapping quality: if your formatter wraps well, a numeric limit costs little. If it produces awkward breaks, the limit may be hurting readability.
- String and URL semantics: mechanically splitting a URL or literal can make it harder to search for or change. Any limit needs the exceptions Google lists.
- Refactoring signal: the Go advice is useful on its own. A line that is too long often has too many nested calls, and the fix is naming an intermediate value, not wrapping.
Break before or after a binary operator?
PEP 8 notes that Python code historically broke after binary operators. It recommends the mathematical convention of breaking before them for new code, and it allows either if used consistently locally. Its reasoning is visual: when each operator sits at the start of a line next to its operand, the relationship is easier to scan.
What the experiment found, and what it did not
A 2024 controlled eye-tracking study by Roberto, Gheyi, da Costa, and Ribeiro tested four PEP 8 recommendations with 32 novice Python developers. For the tested operator line-break recommendation, not following it increased eye regression count, meaning re-reading, by 70% on the studied snippet.
Rank #3
The limits matter. The participants were novices, the task was one snippet, and the result does not show that every operator layout is better in every language or for experienced readers. The study also reported mixed results across recommendations: for one of them, the eye metrics went against the standard even though participants preferred the PEP 8 version. Preference and measured reading effort are not the same thing.
The fair reading is that line layout can measurably change how readers move through an expression. That is a stronger reason to care about it than “the guide says so”. It is not proof that PEP 8 is right across the board.
Quotes, closing brackets, and trailing commas
PEP 8 does not choose between single and double quotes for ordinary Python strings: “Pick a rule and stick to it.” It does give rules with a practical effect:
Rank #4
- Keep track of everything from attendance to test scores
- Spiral bound
- Measures 8-1/2" x 11"
- Use the other quote character when that avoids backslash escapes in the string.
- Use double quotes for triple-quoted strings, to match the docstring convention.
- For multiline constructs, closing delimiters may be placed in more than one acceptable way. The guide shows the alternatives.
- Trailing commas are useful in multiline lists and argument sets, because adding an item then changes one line instead of two.
Only the last has a clear review benefit, since it shrinks diffs. Quote style and bracket placement are real equivalents. A formatter should settle them once, and they should not come up in review again.
Naming and comments: where clarity beats uniformity
PEP 8 recommends lowercase words separated by underscores for Python functions and variables. It also says internal consistency wins when an existing library uses a different style. Google’s Go guide says “Naming is more art than science” and favors names that fit their context and avoid needless repetition. A name that repeats the package or type around it is clutter.
On comments, the Go guidance asks you to explain why code does something when the reason is not apparent. It warns that extra commentary can obscure code, restate it, contradict it, or add upkeep. PEP 8 puts the worst case plainly: comments that contradict the code are worse than no comments.
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteBest Value
The rule worth defending is therefore not a comment quota or one naming pattern applied everywhere. It is that a reader should be able to learn intent and surprises from the code and its comments without being misled.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Where review time actually goes
The paper “Learning Natural Coding Conventions” examined code reviews and found that about one third contained feedback on coding conventions. Naming suggestions appeared in almost one quarter of the reviewed code changes. These figures describe that paper’s sample, not a universal rate, but they show how much attention convention feedback can take.
The same authors built a tool, Naturalize. They report 94% top-suggestion accuracy for its naming suggestions, and 14 of 18 generated patches were accepted across five projects. Those are tool evaluation results. They show that conventions can be learned and suggested automatically, not that following them improves software quality.
The available evidence does not establish universal effects of style rules on expert productivity, long-term maintenance cost, or defect rates. Be suspicious of anyone who quotes a number that does.
A test for whether a rule deserves an argument
| Question | If yes | If no |
|---|---|---|
| Does it change how quickly a maintainer sees structure or intent? | Worth discussing on the merits | Pick a default and move on |
| Does the language or repository already have a convention? | Follow it, as PEP 8 does for existing tab-indented code or library naming | Adopt the language’s official guide |
| Can a formatter or linter enforce it? | Automate it and drop it from review | Document it and review it by hand |
| Would mechanical enforcement alter meaning (URLs, literals, generated code)? | Write an explicit exception | Enforce it without exception |
| Would changing it cause repo-wide churn? | Require concrete evidence of benefit | Change it cheaply, ideally in one commit |
| Is the supporting argument a guide’s rationale, a team preference, or a study? | Weigh a study by its population and task, as with the 32-novice experiment | Treat preference as preference |
Putting it into practice
- Start from your language’s official convention or an existing project style, and write down the reason for any deviation.
- Configure a formatter for the mechanical rules: indentation, quotes, wrapping, trailing commas. Run it in CI so style comments disappear from reviews.
- Keep human review for what tools cannot judge: whether a name is accurate, whether a comment explains why, whether a long line signals code that should be split.
- Reopen a settled rule only when something concrete changes, such as a new tool, a measured readability problem, or a rule that causes bugs. A new personal preference is not enough.
The 80-versus-no-limit split shows the right posture. Two competent organizations chose differently and both ship good software. Spend arguments on clarity and correctness, and let tools and defaults settle the rest.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




