計算機科學及程式設計導論在 MIT 的課程編号是 6.00.1,是計算機科學及工程學院的經典課程。之前,課程一直使用 Scheme 作為教學語言,不過由于 Python 簡單、易學等原因,近年來已經改用 Python 作為教學語言了。更多介紹
最初知道這個課程的時候大概是在 2014 年,對于做事拖沓的我,這門課程已經從低清随堂錄制變成了 edX 平台的一門 高清的 MOOC,轉眼間已經大三,希望自己能夠完成自己曾經定下的計劃。以下是在我在學習本課程時的一些筆記,在此與大家共享、共勉。
What does a computer do?
Fundamentally a computer:
Performs some calculations
Remembers results
What calculations?
Built in primitives
Creating our own methods of calculating
Simple calculations are not enough, so good algorithm design also needed to accomplish a task.
Despite its speed and storage, a computer does have limitations
Some problems still too complex
Some problems are fundamentally impossible to computer (e.g. Turing's Halting Problem)
Knowledge
Declarative
Imperative (likes a recipe, "how-to")
Computers
Fixed-program computers (earliest computers)
To solve specific problems
Atanasoff (1941) - linear equations
Turing bombe
Stored-program computers
Program is a recipe. Each programming language provides a set of primitive operations.
Given a fixed set of primitives, a good programmer can program anything.
Anything you can do with a language, you can do with another.
About python
High(√) vs. Low
General(√) vs. Targetted
Interpreted(√) vs. Compiled
Aspects of languages & Common Errors
Aspects
Description
Primitive constructs
numbers, strings, simple operators
Syntax
which strings of charactres and symbols are well-formed
Static semantics
which syntactically valid strings have a meaning
Full semantics
what is the meaning associated with a syntactically correct string of symbols with no static semantic errors
文法用來描述語言中,什麼表述是合法的。
靜态語義表示什麼程式是有意義的,哪種表達是有意義的。
完整語義即程式想達到什麼目的,運作程式會産生什麼效果。
Goal
Learn the syntax and semantics of a programming language.
Learn how to use those elements to translate “recipes” for solving a problem into a form that the computer can use to do the work for us.
Computational modes of thought enable us to use a suite of methods to solve problems.
References