Cs101 Lec45
Cs101 Lec45
Lecture 45
Review & Wrap-Up
1
readable program?
A program that is easy to read & understand, and therefore, easy to maintain & enhance
3
Design Guidelines
Break your code down into short and simple functions (e.g. take the 3 swap statements out from the last example and put them into a function of their own) Do not use global variables
Coding Guidelines
Indent blocks of code (2 to 5 spaces) Always use semicolons to end statements
Identifiers:
Use the camelBack scheme Make them descriptive but concise Variables: nouns Functions: verbs
Comment liberally
No: Get it
Else assume it. State it explicitly 3. Do the design 4. Write test cases
Another pair of eyeballs may not have the same problem, especially if they are were not involved in building the design or code 8
Types of Errors
Syntax errors Semantic errors Run-time errors
10
11
Course Objectives
1. 2. 3.
To build an appreciation for the fundamental concepts in computing To achieve a beginners proficiency in Web page development
What value do
computers bring?
13
fast bored
storage
14
15
2. Electro-mechanical
3. Vacuum tube 4. Transistor (the current state-of the-art) 5. Quantum computing
16
Quantum Computers
Quantum computers may one day be millions of times more efficient than the current state-ofthe-art computers
as their quantum mechanical nature will allow them to examine all possible answers to a question, simultaneously
17
18
19
From the users point view, Internet a collection of interconnected networks looks like a single, unified network 20
IP routes these packets through the Internet to get them to their destination When the packets reach the destination computer, TCP reassembles them into the original message 21
Instant Messaging
eMail: Slow response times eMail: No way of knowing if the person we are sending eMail to is there to read it eMail: The process of having a conversation through eMail by exchanging several short messages is too cumbersome
22 Instant messaging (IM) solves these problems
23
Ways of Enhancing A uP
Increase the clock frequency Increase the word-width Improve the effectiveness of the caching algorithm Add more functional units (e.g. ALUs, FPUs, Vector/SIMD units, etc.)
25
Language Scientific Business Productivity Entertainment Utility Translator Apps. Apps. Apps. Apps.
26
The Role of An OS
Manages the HW and SW resources of the computer system, often invisibly. These include the processor, memory, disk drives, etc.
Provides a simple, consistent way for applications to interact with the HW without having to know all the details of the HW
27
28
4th-generation languages
High-level languages Assembly languages Machine languages
29
Interpreters:
Immediate response, but execute code slowly
Compilers:
Compiling takes time, but super-fast execution
30
Can a single language have all the good bits of all other languages?
31
Software Lifecycle
Test
Test
Test
Test
Algorithm
1st Definition: Sequence of steps that is taken to solve a problem
Better Definition: A precise sequence of a limited number of unambiguous, executable steps that terminates in the form of a solution
33
Pseudo Code
Quite suitable for SW development as it is closer in form to real code One can write the pseudo code, then use it as a starting point or outline for writing real code Many developers write the pseudo code first and then incrementally convert each line into real code
34
Heuristic
Common sense lesson drawn from experience
35
Caution! Caution!
Heuristics dont always lead to the best results
At times they even lead to the wrong ones, but mostly to results that are good-enough
36
Dont just remove the defect; correct the process that caused it
37
is a heuristic, an algorithm?
38
When I look at a Web page it should be self-evident, obvious, self-explanatory I should be able to get it - what it is & how to use it - without expending any effort thinking about it
excerpt from Steve Krugs book Dont Make Me Think
39
41
Database
A collection of data organized in such a fashion that the computer can quickly search for a desired data item
All data items in it are generally related to each other and share a single domain
43
Relational Databases
Databases consisting of two or more related tables are called relational databases A relational database stores all its data inside tables, and nowhere else All operations on data are done on those tables or those that are generated by table operations
44
After that system processes, indexes and restructures the info in those artifacts, it will be possible to have a conversation in plain English (or some other language) with that system
46
48
Course Objectives
1. 2. 3.
49
Why JavaScript?
HTML is great for static Web pages; however, supports only rudimentary interactivity through forms and hyperlinks
JavaScript can be used (along with HTML) to develop interactive content for the Web
50
Create graphics (although, it does have the ability to format pages through HTML including the placement of graphics)
Any network programming bar one function: the ability to download a file to the browser 51 specified through an arbitrary URL
Reduced network traffic as the forms data is sent only once instead of many tos and fros
52
prop 1 prop 2
prop 3
prop 4
prop 5
method 3
53
method 1
Functions
A named group of statements that is put together once and then used (by reference) repeatedly on a Web page Code becomes easier to read, understand and maintain
54
55
Image Preloading
The Image object can be used to download an image into the cache before it is actually needed for display
This technique can be used to create smooth animations or to display one of several images based on the requirement
56
Course Objectives
1. 2. 3.
Productivity SW
The lectures and assignments were designed to give a brief introduction, and no more All we desired was for you to become able to open the package and perform some trivial tasks With time, you will find more and more use for these packages, and gradually develop an expertise that later will become very useful in your career 58
Course Objectives
1. 2. 3.
To build an appreciation for the fundamental concepts in computing To achieve a beginners proficiency in Web page development
How successful were we in helping you achieve those objectives? Please do let us know so that we can modify the future offerings of this course accordingly. I will be most grateful
60
I have enjoyed doing this course with you very much Hope it was enjoyable & useful for you as well I thank you for your attention and especially for your eMail & discussion board messages A good number of those messages were quite informative and I thank you for sharing that info with me Until the next time when we meet
61