Computer Science Basics


Two types of knowledge: 

  1. Declarative: SQRT(X) = y as y SQR = x and y can be 0. But this does not let us find the answer but gives us method to test.
  2. Imperative: This tells us how to do something. e.g. Guess G, if G sqrd is close to X then stop and return G. else new G = [G+(x/G)]/2 and repeat.
Two types of computers:

  1. Fixed program: e.g. Calculator. Fixed instructions only data is different.
  2. Stored program: e.g interpreter. Both data and instructions can be different.
Programming Languages:
  1. High vs Low
  2. General vs Targeted
  3. Interpreted vs compiled
Each has syntax (legal expressions), static semantics ( is the program meaningful) and semantics( what happens when this program is executed).


Decomposing methods: Each method should

  1. Solve one problem
  2. Must be from 1 – 15 lines
  3. Have good and clear names
  4. Have comments


One thought on “Computer Science Basics

Leave a Reply

Your email address will not be published. Required fields are marked *