-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a267289
commit 9d907c4
Showing
4 changed files
with
23 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
layout: code_smell | ||
title: Paragraph of Code | ||
source: Emily Bache | ||
wikipedia_source: false | ||
--- | ||
|
||
# Paragraph of Code | ||
|
||
A paragraph is a section of code within a longer function or method that belongs together, does something specific, and might make sense to extract and name as a method. Giving the section of code a name and explicitly stating the arguments, dependencies and return value would almost certainly be easier to read and reason about than an unnamed section of code. | ||
|
||
You can spot code paragraphs without reading the code in any detail, they have one or more of these visual characteristics: | ||
|
||
* begin with a short comment explaining what the next lines of code do | ||
* are in a code block (ie they are between a pair of curly braces or at the same indentation level) | ||
* begin with a for, if, try, switch or while statement | ||
* have a line of whitespace before and after | ||
* a cluster of statements using the same variable name or recurring word | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters