Comments by "Lawrence D’Oliveiro" (@lawrencedoliveiro9104) on "Computerphile"
channel.
-
1000
-
253
-
139
-
130
-
119
-
101
-
68
-
62
-
56
-
56
-
55
-
49
-
46
-
42
-
40
-
38
-
35
-
29
-
29
-
28
-
27
-
27
-
A couple of significant notational differences between C and Pascal are, when declaring variables, C inherits the Algol syntax of type-spec before variable name: “«type-spec» «var-name»” whereas Pascal invented its own syntax: “«var-name» : «type-spec»”. And also pointer dereferencing: C uses a prefix operator “*«pointer-val»” whereas Pascal has a postfix one: “«pointer-val»^”.
This may seem very tomayto-tomahto, but consider how C++, which inherits C syntax lock stock and barrel, is now trying to deal with newer features involving dependencies between types, for example between the arguments to a function and its result type. It now finds that, in addition to the C syntax of putting the return type before the function name, it also has to add an alternative syntax where the return type comes after the argument list, à la Pascal.
As for the pointer issue, this may not occur very often, but back in my Mac programming days, more than once I had to write an expression like “thePort^^.theGDevice^^.gdPMap^^.pmTable”,
which in C would have had to become “(**(**(**thePort).theGDevice).gdPMap).pmTable”. (These were structures defined for interfacing to the Mac system, not created by me.) Which would you prefer?
27
-
27
-
25
-
24
-
23
-
The three basic objects in Git are blobs, trees and commits. A blob represents the contents of a file, and is identified by the SHA-256 hash of its contents. A tree associates names with blobs, and represents a snapshot of source tree contents at a point in time. A commit holds a pointer to a tree, and to zero or more parent commits, as well as information about who did the commit and when, an explanatory comment etc.
Trees and commits are also represented by SHA-256 hashes of their contents. This is why a commit holds pointers to its parents, not to its children; because once the commit has been created, it cannot be changed (e.g. to add child pointers) without losing its original SHA-256 ID.
Branches and tags are just pointers to particular commits. They have no associated SHA-256 hashes, so they can be added, removed and changed at any time.
23
-
22
-
21
-
20
-
19
-
18
-
17
-
17
-
15
-
15
-
14
-
14
-
14
-
13
-
13
-
12
-
12
-
12
-
12
-
12
-
12
-
12
-
12