第一课 课程目标,数据类型,运算,变量

2016-09-27

  • 不希望高水平的人来听这门课

  • 不希望学生仅仅因为没经验而觉得自己不够格(we don't want you to feel inadequte when you're simply inexperienced.)

  • Skills:

    • Computational thinking(计算思维)

    • Understand code

    • Understand ablilities and limits

    • map the problems into computation

  • 阅读代码的能力更重要

  • 教你读,教你写,教你知道什么能做什么不能做,更重要的是开启你们如何从别的领域里提炼概念,并研究如何将它们映射到计算机领域的能力

  • 课程使用python教学

  • 笔记即使不看也有利于记忆和学习

  • Think like a computer scientist 像计算机学家一样思考

  • 在计算模式中思考

  • what is computation?

  • What is knowledge?

    • Declarative knowledge(陈述性)

      • 描述一个事实,定义,原理

      • 但不会说出如何计算出来的

      • It tells you how you might test something, but it doesn't tell you how to.

    • Imperative knowledge(程序性)

      • 对推导事实的描述

      • It tells you how to deduce something.

  • 最早的计算机 Fixed-program computers (固定程序计算机) 为特定程序设计的小线路

    • calculators

    • Atanasoff, 1941 - linear eqs. 解决线性方程

    • Turing bombe 破译密码

  • Stored-program computer(存储程序计算机)

    • memory, control unit, arithmetic logic unit, input , output

    • PC 计数器

  • Program is a recipe

    • Fixed set of primitives can program anything.

  • 1936年 Turing 提出 6个基本类型。

  • It says anything you can do in one programming language, you can do in another programming language. It's called Turing compatibility.

  • 你在一种编程语言中能做的事情,在另一种语言中也能做。这叫做图灵兼容性

  • 没有最好的语言。There is no best language.

  • Python 讨论语言的三个纬度

    • High vs. low

    • General vs. targeted

    • Interpreted vs. compiled

  • Syntax -- what are the legal expressions in this language

    • "cat dog boy"

  • Static semantics(静态语义) -- which programs are meaningful.

    • "My desk is Susan."

  • Semantics (Full semantics) -- what dose the program mean? or what's going to happen when I run it?

  • Style

  • Python里的Values

    • Numbers

      • 3 -- Integer

      • 3.14 -- Float

    • String

  • Python里的整除,浮点除法,字符串相加

  • Variables

    • myString =

    • 变量绑定

Last updated