2012-01-06

JavaScript高级程序设计读书摘要(一)

前七章:语言基础
  • JavaScript完整的实现: ECMAScript、DOM(Document Object Model)、BOM(Browser Object Model)
  • 数据类型:null、undefined、boolean、string、number、object、function
  • 字符串是值类型,且不可变
  • 函数参数:实际上为一数组,可通过 arguments 进行访问;函数调用时传参与函数声明无关;arguments.callee 指向当前的函数对象
  • JavaScript没有块级作用域,变量作用域最低层次为函数,故在两大括号代码段内声明的变量在该函数后续代码内仍可访问。
  • 数据的length属性不是只读的,可以通过设置该属性调整数组长度
  • 数组支持 push、pop、shift 等方法,从而可轻易实现栈和队列
  • Function 实际上是对象,函数名就是指向函数对象的指针,也可以理解为一变量
  • this 引用的是函数据以执行操作的对象,如果是在全局作用域下执行,则引用的是 window
  • 函数是对象,所以有属性(length、prototype、caller)和方法(apply、call)
  • 基本类型对应的包装类型:Boolean、Number、String
  • 在调用基本类型的方法或属性时,会创建基本类型对应的引用类型,然后销毁
  • 两个全局内置对象: Global、Math
  • JavaScript没有类和接口,但是支持OOP
  • JavaScript面向对象编程实际上就是利用Function是对象的特性而展开的
  • 对象的prototype相当于类的元信息,很重要,是实现继承的关键
  • 匿名函数
  • 闭包,指有权访问另一个函数作用域中的变量的函数。




2012-01-03

English Writing[1]: Prewriting

Prewriting Steps:
  1. Considering your assignment
  2. Thinking about your audiences
  3. Identifying your purpose
  4. Gathering your ideas (brainstorming)

(1) How to chose a good topic?
    broad subject -> narrow topic
    find a good topic

(2) Audience Analysis
  1. Who is your primary audience? And secondary audience? 
  2. What's their age?
  3. What's their gender?
  4. Why are they reading your writing?
  5. How much do they have known about your topic?
  6. How do they feel about your topic? Are they receptive, hostile, or somewhere in between?
 (3) Audience determines everything of your writing task
  • Your topic
  • The level of interest
  • The level of knowledge
  • The words, jargon, or specialized language you used
  • The length and types of sentences you write
  • The length of your documents
  • Your style - your figures of speech
  • The tone - your attitude toward your materials
  (4) The four purposes of writing
  • To describe
  • To persuade
  • To narrate
  • To explain
  (5) Brainstorming Techniques
  1. Listing ideas: free association
  2. Webbing: clustering, mapping, or mind mapping
  3. Charting
    • Venn diagram -- especially helpful for a comparison/contrast essay  ( two circles )
    • Storyboard -- shows the events of a story in chronological order
    • Two-column chart -- very useful when writing about two related people, places, things, or ideas
  4. Freewriting: simple start just writing, don't do any planning, just let your brain roam
  5. Asking questions: Who? What? When? Where? Why? How?

Resource Links: