Comparison By Language
Not all languages have the same numbers of reserved words. For example, Java (and other C derivatives) has a rather sparse complement of reserved words—approximately 50 – whereas COBOL has approximately 400. At the other end of the spectrum, pure Prolog has none at all.
The number of reserved words in a language has little to do with how “powerful” a language is. COBOL was designed in the 1950s as a business language and was made to be self-documenting using English-like structural elements such as verbs, clauses, sentences, sections and divisions. C, on the other hand, was written to be very terse (syntactically) and to get more text on the screen. For example, compare the equivalent blocks of code from C and COBOL to calculate weekly earnings:
// Calculation in C: if (salaried) amount = 40 * payrate; else amount = hours * payrate; * Calculation in COBOL: IF Salaried THEN MULTIPLY Payrate BY 40 GIVING Amount ELSE MULTIPLY Payrate BY Hours GIVING Amount END-IF. * Other example of calculation in COBOL: IF Salaried COMPUTE Amount = Payrate * 40 ELSE COMPUTE Amount = hours * payrate END-IF.Pure Prolog logic is expressed in terms of relations, and execution is triggered by running queries over these relations. Constructs such as loops are implemented using recursive relationships.
All three of these languages can solve the same types of “problems” even though they have differing numbers of reserved words. This “power” relates to their belonging to the set of Turing-complete languages.
Read more about this topic: Reserved Word
Famous quotes containing the words comparison and/or language:
“I have travelled a good deal in Concord; and everywhere, in shops, and offices, and fields, the inhabitants have appeared to me to be doing penance in a thousand remarkable ways.... The twelve labors of Hercules were trifling in comparison with those which my neighbors have undertaken; for they were only twelve, and had an end; but I could never see that these men slew or captured any monster or finished any labor.”
—Henry David Thoreau (18171862)
“If when a businessman speaks of minority employment, or air pollution, or poverty, he speaks in the language of a certified public accountant analyzing a corporate balance sheet, who is to know that he understands the human problems behind the statistical ones? If the businessman would stop talking like a computer printout or a page from the corporate annual report, other people would stop thinking he had a cash register for a heart. It is as simple as thatbut that isnt simple.”
—Louis B. Lundborg (19061981)