Pages

Showing posts with label cs. Show all posts
Showing posts with label cs. Show all posts

Sunday, May 2, 2010

Elements of Programming, Notes

Here I'll post notes from Elements of Programming (Alexander Stepanov, Paul McJones) that are interesting and insightful, IMO. That takes (will take) a lot of time because I do it in my free time.

here we go,
  • As with other areas of science and engineering, the appropriate foundation of programming is the deductive method. (pg ix)
  • Discovering the architectural principles of the book should be the reader's goal. (pg ix)
  • Starting with a brief taxonomy of ideas, we introduce notions of value, object, type, procedure, and concept that represent different categories of ideas in the computer. (pg 1)
  • A central notion of the book, regularity, is introduced and elaborated. When applied to procedures, regularity means that procedures return equal results for equal arguments. When applied to types, regularity means that types possess the equality operator and equality-preserving copy construction and assignment. (pg 1)
  • Categories of Ideas: Entity, Species, Genus.
  • An abstract entity is an individual thing that is eternal and unchangeable, while a concrete entity is an individual thing that comes into and out of existence in space and time. (pg 1)
  • A function is a rule that associates one or more abstract entities, called arguments, from corresponding species with an abstract entity, called the result, from another species. (pg 2)
  • A datum corresponding to a particular entity is called a representation of the entity; the entity is called the interpretation of the datum. We refer to a datum together with its interpretation as a value. (pg 2)
  • A datum is well formed with respect to a value type if and only if that datum represents an abstract entity. (pg 2)
  • An object is a representation of a concrete entity as a value in memory. An object has a state that is a value of some value type. (pg 4)
  • Values and objects play complementary roles. Values are unchanging and are independent of any particular implementation in the computer. Objects are changeable and have computer-specific implementations. (pg 4)
  • Functional programming deals with values; imperative programming deals with objects. (pg 5)

Sunday, April 25, 2010

What is the role of math in computer science and programming in particular?

In the book Masterminds of Programming, Peter Weinberger gave an answer which,  in my opinion, is a good one.

Peter: My degree is in math, so I'd like to believe that math is fundamental. But there are many parts of computer science, and many kinds of programming, where one can be quite successful without any mathematics at all.
The use (or usefulness) of mathematics comes in layers. People with no feeling for statistics or randomness will be misled over and over again by real-world data. There's mathematics in graphics, there's lots of mathematics in machine learning (which I think statisticians think of as a form of regression), and there's all sorts of number theory in cryptography. Without some mathematics, people are just cut off from understanding large parts of computer science.

Never heard of  Peter Weinberger?
How about the AWK programming language?
Al Aho, Peter Weinberger, Brian Kernighan