强撸MIT之6.005

强撸MIT之6.005

6.005: Software Construction

MIT的EECS学院的CS foundation包括6.004,6.005,6.006


资料

  • 在线学生资源
    不过现在MIT的很多学生资源都要美帝学生证才能访问,所以我趁现在可以访问,克隆到了这里以防万一

  • OCW
    这门课并没有视频🙂

  • 前置课程
    6.S092或者6.178
    一个月快速入门JAVA(IAP课程


Goal

Safe from bugs

Easy to understand

Ready for change

Key

Immutability

Immutability (immunity from change) is a major design principle in this course. Immutable types are types whose values can never change once they have been created. (At least not in a way that’s visible to the outside world – there are some subtleties there that we’ll talk more about in a future class about immutability.)

Test-first Programming

  1. Write a specification for the function.

  2. Write tests that exercise the specification.

  3. Write the actual code. Once your code passes the tests you wrote, you’re done.

Writing tests first is a good way to understand the specification. The specification can be buggy, too — incorrect, incomplete, ambiguous, missing corner cases. Trying to write tests can uncover these problems early, before you’ve wasted time writing an implementation of a buggy spec.


未完待续ORZ…

Leave a Reply