instructed by Ana Bell and John V. Guttag; very first class; getting started
term-knowledge- declarative knowledge
- imperative knowledge
- fixed program
- stored program
odd as this may sound, both the program and the data it manipulates reside in memory< flow of control, like testing and jumping, is essential to allowing us to write programs that perform complex tasks computers can be annoyingly literal detail the computation as a sequence of instructions a finite of instructions>>describe a computation that will proceed through and eventually produce an output when executed on an input<
include some tests for deciding whether the process is complete, for jumping to a specific instruction returning to the recipe metaphor, given a fixed set of ingredients a good chef can make an unbounded number of tasty dishes by combining them in diff. ways>>similarly, given a small fixed set of primitive features a good programmer can produce an unbounded number of useful programs to create a recipe, programming language is needed to describe it and give the computer its marching orders some things may be easiler to program in a particular language; whatever set of primitives one has, and whatever methods one has for using them, the best and worst thing about programming are the same: the computer will do exactly what you tell it to do.>>make it do all sorts of fun, useful and boring things. MATLAB is a good laguage for manipulating matrices is good general-purpose language primitive constructs in Python include literals and infix operators judge whether a string of primitive constructs is syntactically valid static semantics>>1.2/a isn't valid the semantics of a language associte a meaning with each syntactically correct string of symbols that has no static semantic errors Python does do a considerable amount of semantic checking while running a program however, a sentence has semantcis is not sure to have the same semantics that its creator intended it to have primitive constructs are words syntax describes which strings of words constitute well-formed sentences static semantics defines which sentences are meaningful semantics defines the meaning of those sentences whenever possible, programs should be written in such a way that when they don't work properly, it is self-evident. this book, we use Python. However, this book is not about python. It will certainly help reader learn Python, and that's a good thing. what's much more important, however, is that careful readers will learn something about how to write programs that solve problems. This skill can be transferred to any programming language weak static semantic checking>>Python isn't optimal for programs that have high reliability constraints or that is built and maintained by many people over a long period of time is designed to be interpreted>>provide the kind of runtime feedback that's especially helpful to novice programmers a living language>> those are common to almost all programming language, though not necessary in detail the language is presented in dribs and drabs(三三两两,好喜欢这个描述), as needed for this ulterior(隐秘的) purpose Python program/script>>instructions>>definitions and commands experienced programmers will confirm that they spend a great deal of time reading programs in an attempt to understand why they behave as they do>>it's therefore of critical importance to write programs in a way that they are easy to read>>apt恰当的choice of variable names play an important role in enchancing readability there is no a priori reason to suspect that anything is amiss不恰当的 prompt us to be suspicious that something is wrong straight-line programs are downright boring彻头彻尾无趣 indentation>.it ensures that the visual structure of a program is an accurate representation of the semantic structure of that program ASCII>>a standard for the internal representation of 128 characters, not enough to cover the characters and accents appearing in all the world's languages in recent years, there has been a shift to Unicode>>120,000 different characters>>can be implemented using different internal chracter encodings # -*- coding: utf-8 -*- the most frequently used character encoding for World Wide Web pages we have now covered pretty much everything about Python that we need to know to start writing interesting programs
Into the world of python
though each programming language is different, there are some dimensions along which they can be related



