Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
Skip to content
World desk6 min

The Code Style Rules Worth Arguing About

Google's C++ guide caps lines at 80 characters; its Go guide sets no limit. Here is which style rules affect readers, which are preference, and how to stop arguing about the latter.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
Cracking the Coding Interview: 189 Programming Questions and Solutions
  • 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
SKLaserDesign Two-Sided Medical Coding Carousel Rotating Book Stand - Made in the USA
  • 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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How 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.

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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
Teacher Record Book
  • 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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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.Support on Ko-Fi

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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

  1. Start from your language’s official convention or an existing project style, and write down the reason for any deviation.
  2. Configure a formatter for the mechanical rules: indentation, quotes, wrapping, trailing commas. Run it in CI so style comments disappear from reviews.
  3. 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.
  4. 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

SaleBestseller No. 1
Cracking the Coding Interview: 189 Programming Questions and Solutions
Cracking the Coding Interview: 189 Programming Questions and Solutions
Careercup, Easy To Read; Condition : Good; Compact for travelling
$25.79
Bestseller No. 2
SKLaserDesign Two-Sided Medical Coding Carousel Rotating Book Stand - Made in the USA
SKLaserDesign Two-Sided Medical Coding Carousel Rotating Book Stand - Made in the USA
Easily holds two large medical coding books.; Made in the USA - Minor assembly required.
$89.99
Bestseller No. 4
Teacher Record Book
Teacher Record Book
Keep track of everything from attendance to test scores; Spiral bound; Measures 8-1/2" x 11"
$4.89

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.