A WebBased Introduction to Programming Chapter 01 Introducing
A Web-Based Introduction to Programming Chapter 01 Introducing Computer Programming
Intended Learning Outcomes • • • Explain differences between computers and other machines Describe the purpose of the microprocessor's instruction set List some common tasks that computer programs perform Describe what programmers do Summarize the stages of the software development cycle Explain the importance of writing and communications Distinguish high-level languages from machine language Distinguish between a compiler and an interpreter Distinguish between standalone and network applications Distinguish between programming and markup languages Chapter 1
What is a Computer Program?
What is a Computer Program? • A computer is a programmable machine. • Most machines are hard-wired to perform a single task. • Computers perform different tasks by reading and executing programs. • Each program contains instructions to drive the computer’s hardware. Chapter 1
The Microprocessor • Contains includes the set of basic operations that the computer can execute. • This instruction set constitutes the computer’s machine language. • Different microprocessors contain different instruction sets: a program that executes on one computer may not execute on another. Chapter 1
What do Programs DO?
Common Programming Tasks • Programs use the computer's instruction set to: – Provide a Graphical User Interface (GUI) – Read and write data (input and output) – Resolve logical expressions (make decisions) – Perform numerical calculations – Perform text-processing operations – Communicate with other programs and devices – Control hardware Chapter 1
What do Programmers DO?
What do Programmers DO? Programmers combine logic and creativity to: • • Evaluate requirements Design applications Develop algorithms Code applications Test applications (again, and. . ) Provide user support and training Document and maintain software Chapter 1
Evaluate Requirements • Determine what a program should do: – Read and listen carefully – Ask questions – Document thoroughly • Critical for application development, why? • Skills: read, listen, ask questions, document, communicate effectively Chapter 1
Design Applications • Applications are often broken down into multiple modules. – Each module is developed separately by programmers with most appropriate skills. – Modules are developed concurrently. – Some modules are reusable (can be used by multiple applications). – Each module is individually tested and maintained. Chapter 1
Client/Server Design • Client applications: – Provide an interface for the user. – Call server applications as needed to process user requests. • Server applications: – Receive requests from client applications. – Process each request. – Send back a response to the client application. Chapter 1
Web Applications • A Web application is an example of a client/server application. – Your Web browser (client application) sends a request to a Web server whenever you click a link, submit a form, or type a URL. – The Web server receives and processes the request, then returns the requested page. – Your Web browser displays the Web page. Chapter 1
Client/Server Example Chapter 1
Helpful Design Hints • • • Stay away from the computer at first! Try things out, don’t get too invested. Think outside the box! Use pen and paper, sticky notes, etc. Work with team, ask for advice. Skills: creative thinking, organization, client/server design, object oriented programming, writing, interface design. Chapter 1
Algorithm Development • A design must be developed into algorithms. • An algorithm consists of clear, unambiguous instructions to perform a specific task. • Algorithms are often written in pseudocode, a mix of English and programming language syntax that programmer understand. • Pseudocode can be easily translated into any programming language. • Skills: attention to detail, logic, writing, programming. Chapter 1
Application Coding • The algorithm for each application module is coded into a programming language. • Each module must be carefully tested to ensure that it performs as expected. • Skills: knowledge of programming languages, coding, testing, debugging, writing, patience, thoroughness, attention to detail. Chapter 1
Application Testing • Applications must be tested for correctness. – Testing requires patience, attention to detail, and thoroughness. • Application must also be tested for usability. – A well-written and correct application may still not be easy to understand or use. • Skills: patience, thoroughness, attention to detail, observation, humility! Chapter 1
User Support, Training, Software Maintenance • Online and printed documentation for endusers. • Training materials and workshops. • Software modifications and new versions. • User help desks/feedback/suggestions. • Skills: communication with technical and nontechnical people, ability to listen and explain, patience, sense of humor! Chapter 1
What is the Software Development Cycle?
Software Development Cycle • • • Evaluate requirements Design application Develop algorithms Code application Test application User support and software maintenance Chapter 1
Career Paths • Different steps in the software development cycle can actually be career paths: – Software designer – Interface or graphics designer – Application programmer, Web programmer – Documentation specialist – User support/trainer, usability expert – Software tester Chapter 1
What are Programming Languages?
What are Programming Languages? • A program is a sequence of instructions. • The computer understands it own machine language (ML). – ML is too low-level for programmers to use. • Programmers use high-level programming languages. – Each language consists of special words, symbols and operators. – Examples are: C++, C#, Java, Ruby, BASIC, COBOL, Fortran, Ada, Pascal, PHP, perl. Chapter 1
Compilers and Interpreters • A program written in a programming language is referred to as source code. • The source code is relatively easy to write but cannot be understood by a computer! • To execute, source code must be translated into machine language in one of two ways: – Use a language compiler. – Use a language interpreter. Chapter 1
Compiler-Based Languages • The entire source code is converted and saved as an executable file. • The executable file: – Contains machine language instructions. – Can be distributed to end users for installation. • The source code is not distributed. • Changes to the source code must be recompiled and the new version must be redistributed. Chapter 1
Interpreter-Based Languages • The source code is translated and executed one line at a time: – The source code is required whenever the program is to be executed. • This works well for server-based applications: – The source code does not need to be distributed. – The source code can be changed with no need to recompile. • PHP is an interpreter-based language, often used for server-based Web applications. Chapter 1
Why So Many Languages? • Different languages are designed for different purposes. – Java is designed as an object oriented language. – PHP is designed for Web applications. • New languages incorporate current approaches and are optimized for current hardware. • Many languages share a fairly similar syntax. Chapter 1
What are Standalone and Network Applications?
Standalone Applications • A standalone application provides a complete service on a local computer: – Software is installed locally, usually compiled – No need for a network connection, unless to access data. – Interacts only with the computer’s operating system, local hardware, and other local software. – Examples are: word-processors, spreadsheets, some games, image-processing software. . Chapter 1
Networked Applications • A networked application runs on multiple computers that interact over a network. – Host/terminal applications: a host computer delivers screens and programs to user terminals. – Client/server applications: client programs submit requests for processing by server programs. – Server/server applications: server programs process request from other server programs, usually interpreted. Chapter 1
What are Markup Languages?
Markup Languages • A programming language provides syntax and instructions to process data and run programs. • A markup language provides syntax and instructions to display, describe, or format data. • Markup languages use tags to indicate the intended purpose or appearance of text. • When you select text in a word-processor and mark the text as bold or indented or red, you are using a markup language. Chapter 1
HTML • The markup language of the Web is Hypertext Markup Language (HTML). • We will learn the basics of HTML in order to format our Web-based applications. Chapter 1
HTML and PHP • You will learn basic program syntax, logic and design using a combination of two languages: – HTML markup language to format Web pages and create user interfaces – PHP programming language to process data and generate results • In the process you will develop Web-based client/server applications. Chapter 1
Chapter 1
- Slides: 36