Sources
Every sentence quoted on cleancode.in, word for word, with the page it comes from and the day it was read. 110 quotations from 13 pages.
Code is read far more often than it is written.
One of Guido’s key insights is that code is read much more often than it is written.
PEP 8: Style Guide for Python Code, A Foolish Consistency is the Hobgoblin of Little Minds. Python, peps.python.org. Read on 5 December 2026. Cited on python.
Consistency inside a project matters more than consistency with the guide.
A style guide is about consistency. Consistency with this style guide is important. Consistency within a project is more important. Consistency within one module or function is the most important.
PEP 8: Style Guide for Python Code, A Foolish Consistency is the Hobgoblin of Little Minds. Python, peps.python.org. Read on 5 December 2026. Cited on python.
Four spaces a level.
Use 4 spaces per indentation level.
PEP 8: Style Guide for Python Code, Indentation. Python, peps.python.org. Read on 5 December 2026. Cited on python, style-guides.
Lines of 79 characters at most.
Limit all lines to a maximum of 79 characters.
PEP 8: Style Guide for Python Code, Maximum Line Length. Python, peps.python.org. Read on 5 December 2026. Cited on python, style-guides.
A comment that disagrees with the code is worse than none.
Comments that contradict the code are worse than no comments. Always make a priority of keeping the comments up-to-date when the code changes!
PEP 8: Style Guide for Python Code, Comments. Python, peps.python.org. Read on 5 December 2026. Cited on comments, python.
Classes in CapWords.
Class names should normally use the CapWords convention.
PEP 8: Style Guide for Python Code, Class Names. Python, peps.python.org. Read on 5 December 2026. Cited on naming, python.
Functions in lowercase with underscores.
Function names should be lowercase, with words separated by underscores as necessary to improve readability.
PEP 8: Style Guide for Python Code, Function and Variable Names. Python, peps.python.org. Read on 5 December 2026. Cited on naming, python.
Variables like functions.
Variable names follow the same convention as function names.
PEP 8: Style Guide for Python Code, Function and Variable Names. Python, peps.python.org. Read on 5 December 2026. Cited on naming, python.
Constants in capitals with underscores.
Constants are usually defined on a module level and written in all capital letters with underscores separating words.
PEP 8: Style Guide for Python Code, Constants. Python, peps.python.org. Read on 5 December 2026. Cited on naming, python.
The conventions were last revised in 1999 and are kept for the archive.
The last revision to this document was made on April 20, 1999
Code Conventions for the Java Programming Language: Naming Conventions, the note at the top of the page. Oracle, oracle.com (an archived page). Read on 5 December 2026. Cited on java, style-guides.
The page is no longer kept up to date.
This page is not being actively maintained.
Code Conventions for the Java Programming Language: Naming Conventions, the note at the top of the page. Oracle, oracle.com (an archived page). Read on 5 December 2026. Cited on java.
Classes are nouns in mixed case, each word capitalised.
Class names should be nouns, in mixed case with the first letter of each internal word capitalized.
Code Conventions for the Java Programming Language: Naming Conventions, Classes. Oracle, oracle.com (an archived page). Read on 5 December 2026. Cited on java, naming.
Methods are verbs in mixed case, first letter lowercase.
Methods should be verbs, in mixed case with the first letter lowercase, with the first letter of each internal word capitalized.
Code Conventions for the Java Programming Language: Naming Conventions, Methods. Oracle, oracle.com (an archived page). Read on 5 December 2026. Cited on java, naming.
Variables in mixed case with a lowercase first letter.
Except for variables, all instance, class, and class constants are in mixed case with a lowercase first letter. Internal words start with capital letters.
Code Conventions for the Java Programming Language: Naming Conventions, Variables. Oracle, oracle.com (an archived page). Read on 5 December 2026. Cited on java, naming.
Short, meaningful names; one letter only for throwaway variables.
Variable names should be short yet meaningful. […] One-character variable names should be avoided except for temporary "throwaway" variables.
Code Conventions for the Java Programming Language: Naming Conventions, Variables. Oracle, oracle.com (an archived page). Read on 5 December 2026. Cited on java, naming.
Constants in capitals with underscores.
The names of variables declared class constants and of ANSI constants should be all uppercase with words separated by underscores ("_").
Code Conventions for the Java Programming Language: Naming Conventions, Constants. Oracle, oracle.com (an archived page). Read on 5 December 2026. Cited on java, naming.
Four spaces a level.
Four spaces should be used as the unit of indentation.
Code Conventions for the Java Programming Language: Indentation, Indentation. Oracle, oracle.com (an archived page). Read on 5 December 2026. Cited on java, style-guides.
Lines of 80 characters at most.
Avoid lines longer than 80 characters, since they're not handled well by many terminals and tools.
Code Conventions for the Java Programming Language: Indentation, Line Length. Oracle, oracle.com (an archived page). Read on 5 December 2026. Cited on java, style-guides.
These are MDN’s rules for the JavaScript in its examples.
The following guidelines cover writing JavaScript example code for MDN Web Docs.
Guidelines for writing JavaScript code examples, the opening paragraph. MDN Web Docs. Read on 5 December 2026. Cited on javascript, style-guides.
MDN formats its code with Prettier.
On MDN Web Docs, we use Prettier as a code formatter to keep the code style consistent (and to avoid off-topic discussions).
Guidelines for writing JavaScript code examples, Choosing a format. MDN Web Docs. Read on 5 December 2026. Cited on javascript, style-guides.
Functions in camel case, lowercase first.
For function names, use camel case, starting with a lowercase character. Use concise, human-readable, and semantic names where appropriate.
Guidelines for writing JavaScript code examples, Function names. MDN Web Docs. Read on 5 December 2026. Cited on javascript, naming.
Classes in PascalCase, their properties and methods in camelCase.
When defining a class, use PascalCase (starting with a capital letter) for the class name and camelCase (starting with a lowercase letter) for the object property and method names.
Guidelines for writing JavaScript code examples, Classes. MDN Web Docs. Read on 5 December 2026. Cited on javascript, naming.
Variables in camelCase, no underscores.
For primitive values, use camelCase, starting with a lowercase character. Do not use _. Use concise, human-readable, and semantic names where appropriate. For example, use currencyName rather than currency_name.
Guidelines for writing JavaScript code examples, Variable names. MDN Web Docs. Read on 5 December 2026. Cited on javascript, naming.
let and const, never var.
When declaring variables and constants, use the let and const keywords, not var.
Guidelines for writing JavaScript code examples, Variable declarations. MDN Web Docs. Read on 5 December 2026. Cited on javascript.
Triple equals over double.
Prefer the strict equality (triple equals) and inequality operators over the loose equality (double equals) and inequality operators.
Guidelines for writing JavaScript code examples, Strict equality operator. MDN Web Docs. Read on 5 December 2026. Cited on javascript.
Template literals to put values in strings.
For inserting values into strings, use template literals.
Guidelines for writing JavaScript code examples, Template literals. MDN Web Docs. Read on 5 December 2026. Cited on javascript.
Never the boxed types Number, String, Boolean, Symbol, Object.
Don’t ever use the types Number, String, Boolean, Symbol, or Object
Do’s and Don’ts (TypeScript handbook), Number, String, Boolean, Symbol and Object. TypeScript, typescriptlang.org. Read on 5 December 2026. Cited on typescript.
The primitive types number, string, boolean, symbol.
Do use the types number, string, boolean, and symbol.
Do’s and Don’ts (TypeScript handbook), Number, String, Boolean, Symbol and Object. TypeScript, typescriptlang.org. Read on 5 December 2026. Cited on typescript.
No any, except while moving a JavaScript project over.
Don’t use any as a type unless you are in the process of migrating a JavaScript project to TypeScript.
Do’s and Don’ts (TypeScript handbook), any. TypeScript, typescriptlang.org. Read on 5 December 2026. Cited on typescript.
void for callbacks whose value is ignored.
Do use the return type void for callbacks whose value will be ignored:
Do’s and Don’ts (TypeScript handbook), Return Types of Callbacks. TypeScript, typescriptlang.org. Read on 5 December 2026. Cited on typescript.
Optional parameters over extra overloads.
Do use optional parameters whenever possible:
Do’s and Don’ts (TypeScript handbook), Use Optional Parameters. TypeScript, typescriptlang.org. Read on 5 December 2026. Cited on typescript.
Union types over overloads.
Do use union types whenever possible:
Do’s and Don’ts (TypeScript handbook), Use Union Types. TypeScript, typescriptlang.org. Read on 5 December 2026. Cited on typescript.
PascalCase for types, namespaces and public members.
By convention, C# programs use PascalCase for type names, namespaces, and all public members.
C# identifier naming rules and conventions, Naming conventions. Microsoft Learn. Read on 5 December 2026. Cited on csharp, naming.
Meaningful, descriptive names.
Use meaningful and descriptive names for variables, methods, and classes.
C# identifier naming rules and conventions, Naming conventions. Microsoft Learn. Read on 5 December 2026. Cited on csharp.
camelCase for arguments, locals and private fields.
Use camelCase for method arguments, local variables, and private and internal non-constant fields.
C# identifier naming rules and conventions, Naming conventions. Microsoft Learn. Read on 5 December 2026. Cited on csharp, naming.
PascalCase for constants.
To maintain consistency across all access modifiers, use PascalCase for constant names, both fields and local constants, including private and internal constants.
C# identifier naming rules and conventions, Naming conventions. Microsoft Learn. Read on 5 December 2026. Cited on csharp, naming.
No abbreviations but the well known.
Avoid using abbreviations or acronyms in names, except for widely known and accepted abbreviations.
C# identifier naming rules and conventions, Naming conventions. Microsoft Learn. Read on 5 December 2026. Cited on csharp, naming.
Interfaces start with I.
When naming an interface, use pascal casing in addition to prefixing the name with an I.
C# identifier naming rules and conventions, Pascal case. Microsoft Learn. Read on 5 December 2026. Cited on csharp.
Private fields in camel case with a leading underscore.
Use camel casing ("camelCasing") when naming private or internal non-constant fields, and prefix them with _.
C# identifier naming rules and conventions, Camel case. Microsoft Learn. Read on 5 December 2026. Cited on csharp, naming.
Four spaces, no tabs.
Use four spaces for indentation. Don't use tab characters.
Common C# code conventions, Style guidelines. Microsoft Learn. Read on 5 December 2026. Cited on csharp, style-guides.
Braces on their own lines (Allman).
Use the "Allman" style for braces: open and closing brace its own new line.
Common C# code conventions, Style guidelines. Microsoft Learn. Read on 5 December 2026. Cited on csharp.
One statement a line.
Write only one statement per line.
Common C# code conventions, Layout conventions. Microsoft Learn. Read on 5 December 2026. Cited on csharp.
Specific exception types.
Use specific exception types to provide meaningful error messages.
Common C# code conventions, Language guidelines. Microsoft Learn. Read on 5 December 2026. Cited on csharp.
The machine does the formatting.
With Go we take an unusual approach and let the machine take care of most formatting issues.
Effective Go, Formatting. The Go project, go.dev. Read on 5 December 2026. Cited on go, style-guides.
gofmt writes every Go program in one standard layout.
The gofmt program (also available as go fmt, which operates at the package level rather than source file level) reads a Go program and emits the source in a standard style of indentation and vertical alignment, retaining and if necessary reformatting comments.
Effective Go, Formatting. The Go project, go.dev. Read on 5 December 2026. Cited on go, style-guides.
Tabs for indentation.
We use tabs for indentation and gofmt emits them by default.
Effective Go, Formatting. The Go project, go.dev. Read on 5 December 2026. Cited on go, style-guides.
No line length limit.
Go has no line length limit. Don't worry about overflowing a punched card.
Effective Go, Formatting. The Go project, go.dev. Read on 5 December 2026. Cited on go, style-guides.
Package names: lower case, one word.
By convention, packages are given lower case, single-word names; there should be no need for underscores or mixedCaps.
Effective Go, Package names. The Go project, go.dev. Read on 5 December 2026. Cited on go.
MixedCaps, no underscores.
Finally, the convention in Go is to use MixedCaps or mixedCaps rather than underscores to write multiword names.
Effective Go, MixedCaps. The Go project, go.dev. Read on 5 December 2026. Cited on go, naming.
An upper case first letter makes a name visible outside its package.
the visibility of a name outside a package is determined by whether its first character is upper case.
Effective Go, Names. The Go project, go.dev. Read on 5 December 2026. Cited on go, naming.
A getter is called Owner, not GetOwner.
the getter method should be called Owner (upper case, exported), not GetOwner.
Effective Go, Getters. The Go project, go.dev. Read on 5 December 2026. Cited on go.
Handle each error and return early; no else needed.
The code reads well if the successful flow of control runs down the page, eliminating error cases as they arise. Since error cases tend to end in return statements, the resulting code needs no else statements.
Effective Go, If. The Go project, go.dev. Read on 5 December 2026. Cited on clean code, functions, go.
Types in UpperCamelCase.
Types shall be UpperCamelCase,
The Rust Style Guide: Other style advice, Names. The Rust project, doc.rust-lang.org. Read on 5 December 2026. Cited on naming, rust.
Functions and methods in snake_case.
Function and method names shall be snake_case,
The Rust Style Guide: Other style advice, Names. The Rust project, doc.rust-lang.org. Read on 5 December 2026. Cited on naming, rust.
Local variables in snake_case.
Local variables shall be snake_case,
The Rust Style Guide: Other style advice, Names. The Rust project, doc.rust-lang.org. Read on 5 December 2026. Cited on naming, rust.
Constants in SCREAMING_SNAKE_CASE.
Constants (consts and immutable statics) shall be SCREAMING_SNAKE_CASE.
The Rust Style Guide: Other style advice, Names. The Rust project, doc.rust-lang.org. Read on 5 December 2026. Cited on naming, rust.
Use Rust’s expressions.
Prefer to use Rust’s expression oriented nature where possible;
The Rust Style Guide: Other style advice, Expressions. The Rust project, doc.rust-lang.org. Read on 5 December 2026. Cited on functions, rust.
rustfmt follows the guide.
Tools such as rustfmt use the style guide as a reference for the default style.
The Rust Style Guide, Introduction. The Rust project, doc.rust-lang.org. Read on 5 December 2026. Cited on rust, style-guides.
Spaces, not tabs.
Use spaces, not tabs.
The Rust Style Guide, Indentation and line width. The Rust project, doc.rust-lang.org. Read on 5 December 2026. Cited on rust.
Four spaces a level.
Each level of indentation must be 4 spaces
The Rust Style Guide, Indentation and line width. The Rust project, doc.rust-lang.org. Read on 5 December 2026. Cited on rust, style-guides.
Lines of 100 characters at most.
The maximum width for a line is 100 characters.
The Rust Style Guide, Indentation and line width. The Rust project, doc.rust-lang.org. Read on 5 December 2026. Cited on rust, style-guides.
Packages in lowercase, no underscores.
Names of packages are always lowercase and do not use underscores (org.example.project).
Kotlin coding conventions, Naming rules. Kotlin documentation, kotlinlang.org. Read on 5 December 2026. Cited on kotlin.
Classes in upper camel case.
Names of classes and objects use upper camel case:
Kotlin coding conventions, Naming rules. Kotlin documentation, kotlinlang.org. Read on 5 December 2026. Cited on kotlin, naming.
Functions, properties and locals in camel case, lowercase first.
Names of functions, properties, and local variables start with a lowercase letter and use camel case without underscores:
Kotlin coding conventions, Naming rules. Kotlin documentation, kotlinlang.org. Read on 5 December 2026. Cited on kotlin, naming.
Constants in screaming snake case.
Names of constants (properties marked with const, or top-level or object val properties with no custom get function that hold deeply immutable data) should use all uppercase, underscore-separated names following the screaming snake case convention:
Kotlin coding conventions, Names for properties. Kotlin documentation, kotlinlang.org. Read on 5 December 2026. Cited on kotlin, naming.
A method name is a verb saying what it does.
The name of a method is usually a verb or a verb phrase saying what the method does: close, readPersons.
Kotlin coding conventions, Choose good names. Kotlin documentation, kotlinlang.org. Read on 5 December 2026. Cited on kotlin, naming.
No meaningless words like Manager or Wrapper.
The names should make it clear what the purpose of the entity is, so it's best to avoid using meaningless words (Manager, Wrapper) in names.
Kotlin coding conventions, Choose good names. Kotlin documentation, kotlinlang.org. Read on 5 December 2026. Cited on kotlin, naming.
Four spaces, no tabs.
Use four spaces for indentation. Do not use tabs.
Kotlin coding conventions, Indentation. Kotlin documentation, kotlinlang.org. Read on 5 December 2026. Cited on kotlin, style-guides.
val rather than var.
Prefer using immutable data to mutable. Always declare local variables and properties as val rather than var if they are not modified after initialization.
Kotlin coding conventions, Immutability. Kotlin documentation, kotlinlang.org. Read on 5 December 2026. Cited on kotlin.
Types in UpperCamelCase.
DO name types using UpperCamelCase
Effective Dart: Style, Identifiers. Dart, dart.dev. Read on 5 December 2026. Cited on dart, naming.
Packages, folders and files in lowercase_with_underscores.
DO name packages, directories, and source files using lowercase_with_underscores
Effective Dart: Style, Identifiers. Dart, dart.dev. Read on 5 December 2026. Cited on dart.
Other names in lowerCamelCase.
DO name other identifiers using lowerCamelCase
Effective Dart: Style, Identifiers. Dart, dart.dev. Read on 5 December 2026. Cited on dart, naming.
Constants in lowerCamelCase too.
PREFER using lowerCamelCase for constant names
Effective Dart: Style, Identifiers. Dart, dart.dev. Read on 5 December 2026. Cited on dart, naming.
No prefix letters.
DON'T use prefix letters
Effective Dart: Style, Identifiers. Dart, dart.dev. Read on 5 December 2026. Cited on dart.
dart format does the layout.
DO format your code using dart format
Effective Dart: Style, Formatting. Dart, dart.dev. Read on 5 December 2026. Cited on dart, style-guides.
Lines of 80 characters or fewer.
PREFER lines 80 characters or fewer
Effective Dart: Style, Formatting. Dart, dart.dev. Read on 5 December 2026. Cited on dart, style-guides.
Braces on every if, for and while.
DO use curly braces for all flow control statements
Effective Dart: Style, Formatting. Dart, dart.dev. Read on 5 December 2026. Cited on dart.
Clean ABAP adapts Clean Code to ABAP.
This guide is an adoption of Robert C. Martin's Clean Code for ABAP.
Clean ABAP, the opening lines. SAP, on GitHub (SAP/styleguides). Read on 5 December 2026. Cited on clean code, abap.
Names that say what a thing holds and means.
Use names that convey the content and meaning of things.
Clean ABAP, Use descriptive names. SAP, on GitHub (SAP/styleguides). Read on 5 December 2026. Cited on abap.
snake_case everywhere, as ABAP ignores case.
ABAP is case insensitive which is why we recommend following the convention to use
snake_caseconsistently.Clean ABAP, Use snake_case. SAP, on GitHub (SAP/styleguides). Read on 5 December 2026. Cited on abap, naming.
No Hungarian notation, no prefixes.
Avoid encodings, esp. Hungarian notation and prefixes
Clean ABAP, Avoid encodings, esp. Hungarian notation and prefixes. SAP, on GitHub (SAP/styleguides). Read on 5 December 2026. Cited on abap, naming.
Objects over procedures.
Prefer object orientation to procedural programming
Clean ABAP, Prefer object orientation to procedural programming. SAP, on GitHub (SAP/styleguides). Read on 5 December 2026. Cited on abap.
Functional calls over procedural statements.
Prefer functional to procedural language constructs
Clean ABAP, Prefer functional to procedural language constructs. SAP, on GitHub (SAP/styleguides). Read on 5 December 2026. Cited on abap.
Methods under 20 statements, best 3 to 5.
Methods should have less than 20 statements, optimal around 3 to 5 statements.
Clean ABAP, Keep methods small. SAP, on GitHub (SAP/styleguides). Read on 5 December 2026. Cited on abap, functions.
Exceptions over return codes.
Prefer exceptions to return codes
Clean ABAP, Prefer exceptions to return codes. SAP, on GitHub (SAP/styleguides). Read on 5 December 2026. Cited on abap.
Comments say why, not what.
Write comments to explain the why, not the what
Clean ABAP, Write comments to explain the why, not the what. SAP, on GitHub (SAP/styleguides). Read on 5 December 2026. Cited on abap, comments.
Lines of 120 characters at most.
Adhere to a maximum line length of 120 characters.
Clean ABAP, Stick to a reasonable line length. SAP, on GitHub (SAP/styleguides). Read on 5 December 2026. Cited on abap, style-guides.
Write for the reader.
Optimize for reading, not for writing
Clean ABAP, Optimize for reading, not for writing. SAP, on GitHub (SAP/styleguides). Read on 5 December 2026. Cited on abap.
Skip comments that state the obvious.
Inline comments are unnecessary and in fact distracting if they state the obvious.
PEP 8: Style Guide for Python Code, Inline Comments. Python, peps.python.org. Read on 5 December 2026. Cited on comments.
Comments are complete sentences.
Comments should be complete sentences.
PEP 8: Style Guide for Python Code, Comments. Python, peps.python.org. Read on 5 December 2026. Cited on comments.
Comment the intention the code cannot show.
If the purpose or logic of the code isn't obvious, add a comment with your intention
Guidelines for writing JavaScript code examples, Comments. MDN Web Docs. Read on 5 December 2026. Cited on comments.
Do not retell the code in words.
restating the code in prose is not a good use of comments
Guidelines for writing JavaScript code examples, Comments. MDN Web Docs. Read on 5 December 2026. Cited on comments.
A clear function name needs no comment.
Comments are also not necessary when functions have explicit names that describe what they're doing.
Guidelines for writing JavaScript code examples, Comments. MDN Web Docs. Read on 5 December 2026. Cited on comments.
Do not repeat the code in words.
Nobody needs repeating the code in natural language
Clean ABAP, Write comments to explain the why, not the what. SAP, on GitHub (SAP/styleguides). Read on 5 December 2026. Cited on comments.
Rename instead of explaining a name.
Improve your names instead of explaining what they really mean or why you chose bad ones.
Clean ABAP, Comments are no excuse for bad names. SAP, on GitHub (SAP/styleguides). Read on 5 December 2026. Cited on comments.
Delete commented out code; the history keeps it.
Deleted code can be reproduced from the version history later on.
Clean ABAP, Delete code instead of commenting it. SAP, on GitHub (SAP/styleguides). Read on 5 December 2026. Cited on comments.
A comment goes on its own line.
Place the comment on a separate line, not at the end of a line of code.
Common C# code conventions, Comment style. Microsoft Learn. Read on 5 December 2026. Cited on comments.
A capital letter first, a period last.
Begin comment text with an uppercase letter. End comment text with a period.
Common C# code conventions, Comment style. Microsoft Learn. Read on 5 December 2026. Cited on comments.
Line comments rather than block comments.
Prefer line comments (//) to block comments (/* ... */).
The Rust Style Guide, Comments. The Rust project, doc.rust-lang.org. Read on 5 December 2026. Cited on comments.
Complete sentences, capital to period.
Comments should usually be complete sentences. Start with a capital letter, end with a period (.).
The Rust Style Guide, Comments. The Rust project, doc.rust-lang.org. Read on 5 December 2026. Cited on comments.
The comment just above a declaration documents it.
Comments that appear before top-level declarations, with no intervening newlines, are considered to document the declaration itself.
Effective Go, Commentary. The Go project, go.dev. Read on 5 December 2026. Cited on comments.
Describe parameters in the text, not in tags.
Generally, avoid using @param and @return tags. Instead, incorporate the description of parameters and return values directly into the documentation comment, and add links to parameters wherever they are mentioned.
Kotlin coding conventions, Documentation comments. Kotlin documentation, kotlinlang.org. Read on 5 December 2026. Cited on comments.
One job per function.
A method should do one thing, and only one thing. It should do it in the best way possible.
Clean ABAP, Do one thing, do it well, do it only. SAP, on GitHub (SAP/styleguides). Read on 5 December 2026. Cited on functions.
Ideally fewer than three inputs.
Aim for few IMPORTING parameters, at best less than three
Clean ABAP, Aim for few IMPORTING parameters, at best less than three. SAP, on GitHub (SAP/styleguides). Read on 5 December 2026. Cited on functions.
A true or false input often means two jobs.
Boolean input parameters are often an indicator that a method does two things instead of one.
Clean ABAP, Split method instead of Boolean input parameter. SAP, on GitHub (SAP/styleguides). Read on 5 December 2026. Cited on functions.
One result per function.
A good method does one thing, and that should be reflected by the method also returning exactly one thing.
Clean ABAP, RETURN, EXPORT, or CHANGE exactly one parameter. SAP, on GitHub (SAP/styleguides). Read on 5 December 2026. Cited on functions.
Check the inputs first and stop there.
Validate and fail as early as possible
Clean ABAP, Fail fast. SAP, on GitHub (SAP/styleguides). Read on 5 December 2026. Cited on functions.
Return the same way every time.
Be consistent in return statements. Either all return statements in a function should return an expression, or none of them should.
PEP 8: Style Guide for Python Code, Programming Recommendations. Python, peps.python.org. Read on 5 December 2026. Cited on functions.
A one expression function is written as one.
Prefer using an expression body for functions with the body consisting of a single expression.
Kotlin coding conventions, Functions. Kotlin documentation, kotlinlang.org. Read on 5 December 2026. Cited on functions.
Default values rather than overloads.
Prefer declaring functions with default parameter values to declaring overloaded functions.
Kotlin coding conventions, Default parameter values. Kotlin documentation, kotlinlang.org. Read on 5 December 2026. Cited on functions.