[Style] fixes
This commit is contained in:
parent
dcd0fb7134
commit
5ca6038480
|
@ -13,7 +13,6 @@ Code is maintainable.
|
||||||
|
|
||||||
Code is fast.
|
Code is fast.
|
||||||
|
|
||||||
The following suggestions are about creating maintainable and fast
|
This guide is about creating maintainable code and it touches on
|
||||||
code. The production of correct code is a project for life, and depends to
|
correctness and speed on occasion. For the former, formulate test suites;
|
||||||
a high degree on reflection---i.e., thinking about what you are doing and
|
for the latter, start with stress test suites.
|
||||||
not just doing it.
|
|
||||||
|
|
14
collects/scribblings/style/size.scrbl
Normal file
14
collects/scribblings/style/size.scrbl
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
#lang scribble/base
|
||||||
|
|
||||||
|
@(require "shared.rkt")
|
||||||
|
|
||||||
|
@title{Size Matters}
|
||||||
|
|
||||||
|
@; -----------------------------------------------------------------------------
|
||||||
|
@section{Code Units}
|
||||||
|
|
||||||
|
Keep functions small. Keep classes small. Keep units small. Keep modules small.
|
||||||
|
|
||||||
|
Anytime a unit of code looks incomprehensible, it is probably too
|
||||||
|
large. Break it up into smaller units. To bring across what these smaller
|
||||||
|
units compute, implement or serve, use meaningful names.
|
|
@ -22,7 +22,16 @@ This document spells out these criteria, and it is also a call for
|
||||||
meta-code, and the same ideas apply. If you have suggestions, contact the
|
meta-code, and the same ideas apply. If you have suggestions, contact the
|
||||||
authors via email.
|
authors via email.
|
||||||
|
|
||||||
|
@bold{Note} We understand that some of the files in the code base do not
|
||||||
|
live up to these standards. Help us improve these files. If you need to
|
||||||
|
edit and understand a file that fails in some ways, take the time to
|
||||||
|
reorganize it properly as soon as the comprehension step takes longer than
|
||||||
|
a few minutes. Because if understanding takes a lot of time, it is likely
|
||||||
|
that the file isn't maintainable. Whoever touches the file next will be
|
||||||
|
grateful.
|
||||||
|
|
||||||
@; -----------------------------------------------------------------------------
|
@; -----------------------------------------------------------------------------
|
||||||
|
|
||||||
@include-section["correct-maintain-speed.scrbl"]
|
@include-section["correct-maintain-speed.scrbl"]
|
||||||
|
@include-section["size.scrbl"]
|
||||||
@include-section["textual.scrbl"]
|
@include-section["textual.scrbl"]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user