Documentation Source Text

Check-in [4a40995c05]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Soften the criticism of Go because of their decision to omit assert() from the language.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | branch-3.28
Files: files | file ages | folders
SHA3-256: 4a40995c05dc3264584b387c821f0bf8b2411ca6ef6ad16201c8677265416559
User & Date: drh 2019-04-29 15:46:08.430
Context
2019-04-29
19:27
Further clarification to the assert.html document. (check-in: ef3822f76d user: drh tags: branch-3.28)
16:21
Merge changes from the 3.28 branch. (check-in: d220b2f30c user: drh tags: trunk)
15:46
Soften the criticism of Go because of their decision to omit assert() from the language. (check-in: 4a40995c05 user: drh tags: branch-3.28)
2019-04-19
23:40
Clarify the documentation on PRAGMA cache_size to explain that the cache size will go up or down in proportion to a change in page size. (check-in: 184e897473 user: drh tags: trunk)
Changes
Side-by-Side Diff Ignore Whitespace Patch
Changes to pages/assert.in.
67
68
69
70
71
72
73



74

75
76
77
78
79

80
81
82



83
84
85
86
87
88
89
67
68
69
70
71
72
73
74
75
76

77
78
79



80



81
82
83
84
85
86
87
88
89
90







+
+
+
-
+


-
-
-
+
-
-
-
+
+
+







An ALWAYS(X) or NEVER(X) macro, or something similar, should be used in 
those cases because ALWAYS(X) or NEVER(X) will be followed by code to
actually deal with the problem when the programmers reasoning
turns out to be wrong.  Since the code that follows ALWAYS(X) or NEVER(X)
is untested, it should be something very simple, like a "return" statement,
that is easily verified by inspection.

<p>
Because assert() can be and is commonly misused, some programming language
theorists and designers look with disfavor on the whole idea of assert().
<p>The [https://golang.org|Go programming language] omits assert().
For example, the [https://golang.org|Go programming language] omits assert().
The Go developers
[https://golang.org/doc/faq#assertions|recognize this is contentious].
Disallowing assert() is essentially telling developers that they are
not allowed to do run-time verification of invariants.
It is as if the developers of
The SQLite developers agree with those that think the decision to 
Go do not want coders to prove the software is correct.
The SQLite developers believe that the lack of assert() disqualifies
Go as a language for serious development work.
omit assert() from Go is a mistake.
It is true that assert() can be misused.  Antibiotics can be misused
too, but that does not mean we should ban all antibiotics.

<h2>Different Behaviors According To Build Type</h2>

<p>Three separate builds are used to validate the SQLite software.
<ol>
<li> A functionality testing build is used to validate the source code.
<li> A coverage testing build is used to validate the test suite, to confirm