* remove "\r" nonsense
[mascara-docs.git] / C / the.ansi.c.programming.language / notes.accompany.ansi.c / sx4i.html
blob7ff50b2781b68e4c42b127efe793bcf4b1a553a9
1 <!DOCTYPE HTML PUBLIC "-//W3O//DTD W3 HTML 2.0//EN">
2 <!-- This collection of hypertext pages is Copyright 1995, 1996 by Steve Summit. -->
3 <!-- This material may be freely redistributed and used -->
4 <!-- but may not be republished or sold without permission. -->
5 <html>
6 <head>
7 <link rev="owner" href="mailto:scs@eskimo.com">
8 <link rev="made" href="mailto:scs@eskimo.com">
9 <title>section 1.5.4: Word Counting</title>
10 <link href="sx4h.html" rev=precedes>
11 <link href="sx4j.html" rel=precedes>
12 <link href="sx4.html" rev=subdocument>
13 </head>
14 <body>
15 <H2>section 1.5.4: Word Counting</H2>
17 page 21
18 <p>Deep sentence:
19 <blockquote>In a program as tiny as this,
20 it makes little difference,
21 but in larger programs,
22 the increase in clarity is well worth the modest extra effort
23 to write it this way from the beginning.
24 </blockquote>I agree with this.
25 Some people complain that symbolic constants make a program
26 harder to read,
27 because you always have to look them up to see what they mean.
28 As long as you choose appropriate names for symbolic
29 constants and use them consistently
30 (i.e. even if APPLE and ORANGE happen to have the same value,
31 don't use one when you mean the other),
32 no one will have this complaint about your programs.
33 </p>
34 <p>Note that there's no direct way to simplify
35 the condition
36 <pre> if (c == ' ' || c == '\n' || c == '\t')
37 </pre>In particular, something like
38 <pre> if (c == (' ' || '\n' || '\t'))
39 </pre>would <em>not</em> work.
40 (What would it do?)
41 </p><hr>
42 <p>
43 Read sequentially:
44 <a href="sx4h.html" rev=precedes>prev</a>
45 <a href="sx4j.html" rel=precedes>next</a>
46 <a href="sx4.html" rev=subdocument>up</a>
47 <a href="top.html">top</a>
48 </p>
49 <p>
50 This page by <a href="http://www.eskimo.com/~scs/">Steve Summit</a>
51 // <a href="copyright.html">Copyright</a> 1995, 1996
52 // <a href="mailto:scs@eskimo.com">mail feedback</a>
53 </p>
54 </body>
55 </html>