160 likes | 175 Views
CS3 Fall 2005. Lecture week 15. Administrivia. The final survey will be up tomorrow: you NEED to do this to receive a grade on your project! Final: Saturday, Dec 17 th , 8-11 a.m. 155 Dwinelle Practice final in reader Study help:
E N D
CS3 Fall 2005 Lecture week 15
Administrivia • The final survey will be up tomorrow: • you NEED to do this to receive a grade on your project! • Final: • Saturday, Dec 17th, 8-11 a.m. • 155 Dwinelle • Practice final in reader • Study help: • Final review session: Thursday, Dec. 15th, 8 pm – 11 pm. • Wozniak Room, 430 Soda Hall • Check the course portal announcements for additional office hours the week before the final. • Send questions to Bobak, James, or Nate.
The project • Checkoff #3 is the next lab. The TA will run your code. • Project is due at midnight on the day of your lab, this Thursday/Friday. • Any questions about anything?
So, what have we done in CS3? • Consider the handout of topics • Common topics • Pre-recursion • Recursion • Higher order procedures • Lists • Case studies • Working with large programs
Another list… • Functional programming • Functions as data • Recursion • Abstraction • Managing large programs
Another list continued • Functional Programming • All that can matter to a procedure is what it returns. • Small functions can be easily tested (isolated) • In other languages, you typically: • Perform several actions in a sequence • Set the value of a global or local variable. • Print, write files, draw pictures, connect to the internet, etc. • Other "paradigms": sequential, object-oriented, declarative
Another list continued 2) Functions as data • Higher order procedures will take functions as parameters. • It is useful to return functions • Lambda is quite useful
Another list continued 3) Recursion • Linear (simple) to quite advanced • In contrast to iteration and looping (where counters or state define looping constraints) • Knowledge of recursion will help these simpler cases.
Another list continued 4) Abstraction • The big idea that is related to everything! • A design practice that makes it possible to carve up a problem, and therefore focus on only part of it. • Makes working collaboratively more efficient
Another list continued 5) Managing large programs • Style: commenting, naming conventions, etc. • Abstraction: for maintenance and collaboration • Iterative testing • Reading the specifications, and communicating often with colleagues
The language Scheme • Scheme allows you to ignore tedium and focus on core concepts • The core concepts are what we are teaching! • Other languages: • Generally imperative, sequential • Lots and lots of syntactic structure (built in commands) • Object-oriented is very "popular" now
CS3 concepts out in the world • Scheme/lisp does show up: scripting languages inside applications (emacs, autocad, Flash, etc.) • Scheme/Lisp is used as a "prototyping" language • to quickly create working solutions for brainstorming, testing, to fine tune in other languages, etc. • Recursion isn't used directly (often), but recursive ideas show up everywhere
Java and PHP • Java is a very popular programming language • Designed for LARGE programs • Very nice tools for development • Gobs of libraries (previous solutions) to help solve problems that you might want solved • PHP • Popular course for web development (combined with a web-server and database) • Lots of features, but little overall "sense" • Because programs in PHP execute behind a web-server and create, on the fly, programs in other languages, debugging can be onerous.
SQL (structured query language for databases) resembles HOFs • query: “Tell me the names of all the lecturers who have been at UCB longer than I have.” select name from lecturers where date_of_hire < (select date_of_hire from lecturers where name = 'titteton'); • query: “Tell me the names of all the faculty who are older than the faculty member who has been here the longest.” select L1.name from lecturers as L1 where L1.age > (select L2.age from lecturers as L2 where L2.date_of_hire = (select min(date_of_hire) from lecturers) );