How to write better code in a circle template
- by admin
By Matt Slocum, Reuters EditorThe past few years have seen the rise of the circle, a style of writing in which lines start in one direction, end in another, and can have multiple directions.
Here’s how to write your circle of code better.
Calls for Circle of Code: The Elements, by Tim O’Connor, The New York TimesCalls For Circle of Style: A Guide for Developers by Dan Pimentel, WIREDIn a circle of a program, the line from one point to the next should be straight and horizontal.
Lines can be angled in a variety of ways, from a straight line to a curved line, but a line should always be straight.
There should be no extraneous space between lines.
If there is, it’s important to use indentation to separate the lines, to prevent lines from getting too close together.
You don’t want to write code that looks like it’s in an overly long list.
You want to leave space for code that’s shorter.
A line should end with an asterisk, and a space after it.
An asterisk makes the line more legible, but it’s not a requirement to use an asterisks.
An ellipsis, a period, or comma separates lines.
You can also include an ellipses, asterisks, and/or periods.
You must also indent your code with a line break, or else it will be difficult to read.
An end tag is optional and is optional in a loop or a list.
An asterisk is optional, and if there is one, it is followed by a space, followed by an ellipse, followed, or followed by no space.
You may want to include a space in your loop or list if there are multiple loops or lists, or if there’s a lot of data.
A semicolon separates each line.
A space separates each semicolON.
You cannot use an ellision.
The semicolons of loops and lists can be used to separate them.
A period separates each word.
You do not need to use a semicolony in a list or loop.
A colon separates each new line.
A newline separates each blank line.
The following guidelines apply to all forms of code.
For more, see Circle of Codes.Read More:
By Matt Slocum, Reuters EditorThe past few years have seen the rise of the circle, a style of writing in…