COMPSCI 101L Chapter Notes - Chapter 1-2: Type Conversion, Parsing

51 views3 pages
COMPSCI Reading Notes
Chapter 1-2
Chapter 1
- Most important skill of a computer scientist is problem solving
- Solutions to problems: algorithms, which is a step by step list of instructions
- Programming: taking an algorithm and representing it in a program or notation
o Process of writing and gradually debugging a program until it does what you want
- Low-level v. high-level languages
o Low-level languages can be executed by computers
Can only be run on one computer and must be rewritten to run on another
o High-level languages (e.g., Python, C++, PHP) have to be processed before being
executed
Portable, can run on different kinds of computers
- Interpreters and compilers translate high-level to low-level
o Interpreter reads the program and does what the programs says to do, processes
little by little
o Compiler reads the instructions in the program (source code) and translates it into
the executable or object code, which then can be run by the computer
o Many modern languages use both processes. They are first compiled into a lower
level language, called byte code, and then interpreted by a program called a virtual
machine.
- Two ways to use a Python interpreter shell mode or program mode
o Shell mode input Python expressions into the Python shell and the interpreter
shows the results
Good for testing shorter codes, kind of like scratch paper
>>> is a Python prompt
o Program mode have the interpreter execute the source code as a whole
- Program: sequence of instructions that specifies how to perform a computation
- Bugs: programming errors; debugging: tracking them down and correcting them
o Three kinds of errors:
Syntax errors
Runtime errors
Semantic errors
- Syntax error:
o Syntax: structure of a program and the rules of that structure
o The compiler/interpreter usually finds the syntax errors
- Runtime error: error does not appear until you run the program
o Aka “exceptions”
o Rare
o The compiler/interpreter usually finds the runtime errors
- Semantic errors: the program will run properly, but it will not do the right thing (what
you tell it to do)
o The programmer usually finds the semantic error
- Formal languages: languages designed by people for specific applications
o Programming languages formal languages designed to express computations
find more resources at oneclass.com
find more resources at oneclass.com
Unlock document

This preview shows page 1 of the document.
Unlock all 3 pages and 3 million more documents.

Already have an account? Log in

Document Summary

Most important skill of a computer scientist is problem solving. Solutions to problems: algorithms, which is a step by step list of instructions. Programming: taking an algorithm and representing it in a program or notation: process of writing and gradually debugging a program until it does what you want. They are first compiled into a lower level language, called byte code, and then interpreted by a program called a virtual machine. Program: sequence of instructions that specifies how to perform a computation. Bugs: programming errors; debugging: tracking them down and correcting them: three kinds of errors, syntax errors, runtime errors, semantic errors. Syntax error: syntax: structure of a program and the rules of that structure, the compiler/interpreter usually finds the syntax errors. Runtime error: error does not appear until you run the program: aka exceptions , rare, the compiler/interpreter usually finds the runtime errors.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents