Introduction to Computer Science
- Browse through the course webpage
- What to expect:
- Basic ideas of how computers work
- Understand what they can do
- No computer background required at all
- Computers are powerful:
- Look through masses of data
- Billions of "operations" per second
- Computers are stupid:
- Operations are simple and mechanical
- Write a set of rules/instructions and see the computer obey them.
- Example set of rules: high-school mathematics.
- Nothing like "insight" or "understanding"
- Recent research efforts are often aimed at trying to simulate insight.
- As an aside:
- Many other machines can also be called a computer because they also obey a set of rules/instructions:
- Think about your car, ceiling fan, microphone, speaker, calculator, etc.
- The types of rules that can be specified in a "computer" are much more general
- This makes them much more powerful than other machines that we know
- High level - how does a computer work?
- A computer is driven by "code" instructions
- Instructions simple mechanical, e.g., add two numbers, then compare these two, etc.
- The computer "runs" a long series of instructions. Draw a picture showing a list of instructions and a computer running through them.
- Run through the instructions is purely mechanical
- If the computer can only do such simple things, how do they accomplish such complex tasks?
- Programmers make it happen!
- The simple mechanical operations are rich enough to express a variety of different kinds of applications
- Some examples: take input from keyboard and display the typed character on the screen, encode and decode bits transmitted over communication channels such as network wires, wireless medium, etc., graphical user interfaces, decode bits in an MP3 file and send signals to a speaker which can translate it into sound waves, search engines, image processing (e.g. face detection), and we have only begun!
-
- How do programmers do it:
- Think of a useful feature.
- Creativity, insight about problems, insight about computers. Certainly haven't been able to solve all problems!
- Programmer thinks through the solution.
- "Algorithm" - steps to accomplish.
- Breaking it down and writing code (instructions) for the computer.
- Dumbing it down for the computer. Human instructions may be richer than what the computer can understand. e.g., a compiler can translate human-readable instructions to machine-readable instructions.
- This is computer programming.
- Every useful feature you have ever used has this pattern.
- COL101: understand code and algorithms.
Code Writing
- Needs patience. Think through the algorithm, start writing the instructions, may be able to see the final result only after writing a *lot* of instructions. Often, can keep checking smaller windows of instructions to check if they are doing what is expected.
- How much patience are we talking about? Many common programs that we use, such as operating systems, compilers, search engines, etc., have tens of millions of lines of code. Of course, humans cannot handle this level of complexity, so they break a large system into subsystems and code and test each subsystem independently. That is typically what you will do in this course too.
- A bit like Lego bricks/blocks : individual blocks are very simple. Eventually build up great combinations. But need to start small.