|
Why Algebra teachers hate Basic and aren't that fond of CThe statement i=i+1 drives algebra teachers up the wall. It's an invalid assertion. There isn't a number in the world for which the statement i=i+1 is true. In fact if you subtract i from both sides of that equation you get the patently false statement that 0 = 1 . The trick here is that the symbol = does not imply equality. That is reserved for the double equals sign, ==. In almost all programming languages including Java a single equals sign is the assignment operator.The notable exceptions are Pascal (and the Pascal derivatives Modula-2, Modula-3 and Oberon), Ada, and Eiffel where = does in fact mean equality and where := is the assignment operator. Math teachers are very fond of their equal sign and don't like to see it abused. This is one reason why Pascal is still the most popular language for teaching programming, especially in schools where the Computer Science department is composed mainly of math professors. Needless to say math professors hate languages like Basic where, depending on context, = can mean either assignment or equality.
Exercises
|
Bhopal news
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100