51
Technology in Action Alan Evans Kendall Martin Mary Anne Poatsy Ninth Edition Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall

Chapter 5

  • Upload
    izz

  • View
    216

  • Download
    0

Embed Size (px)

DESCRIPTION

technology in action

Citation preview

Slide 0

Technologyin ActionAlan Evans Kendall MartinMary Anne PoatsyNinth Edition

Copyright 2013 Pearson Education, Inc. Publishing as Prentice Hall

0

Technology in ActionChapter 10Behind the Scenes: Software ProgrammingCopyright 2013 Pearson Education, Inc. Publishing as Prentice Hall

1In this behind-the-scenes chapter, we explore the stages of program development and survey the most popular programming languages.

Chapter TopicsUnderstanding software programmingLife cycle of an information systemLife cycle of a programProgramming languages 2Copyright 2013 Pearson Education, Inc. Publishing as Prentice Hall

2Chapter topics include:Understanding software programmingLife cycle of an information systemLife cycle of a programProgramming languages

Understanding Software ProgrammingTypes of tasks that are candidates for automation:RoutineRepetitiveWork with electronic dataFollow a series of clear stepsWhen existing software cannot be found, programming is mandatory

3Copyright 2013 Pearson Education, Inc. Publishing as Prentice Hall

3Every day we face a wide array of tasks. Some tasks are complex and need a human touch; others require creative thought and higher-level organization. Tasks that are repetitive, work with electronic information, and follow a series of clear steps are candidates for automation with computers.For users who cannot find an existing software product to accomplish a task, programming is mandatory. Even if you are not going to be a programmer, you need to know some programming. Many existing applications allow you to customize and automate various features using miniprograms called macros. By creating macros, you can ask the computer to execute a complicated sequence of steps with a single command.

Life Cycle of an Information SystemSystemA collection of pieces working together to achieve a common goalAn information system includes:DataPeopleProceduresHardwareSoftware4Copyright 2013 Pearson Education, Inc. Publishing as Prentice Hall

4Generally speaking, a system is a collection of pieces working together to achieve a common goal. An information system includes data, people, procedures, hardware, and software.You interact with information systems all the time, whether you are at a grocery store, bank, or restaurant. In any of these instances, the parts of the system work together toward a similar goal.

System Development Life CycleTo create modern software, an entire team is neededPrograms require many phases to completeMust be available for multiple operating systems and work over networksMust be free of errors and well supported5Copyright 2013 Pearson Education, Inc. Publishing as Prentice Hall

To create a modern software package, an entire team of people is needed, and a systematic approach is necessary. Those programs are generally far more complex than the ones you would write yourself, and they require many phases to make the product complete and marketable. They need to be available for multiple operating systems, work over networked environments, and be free of errors and well supported. Therefore, a process often referred to as the system development life cycle (SDLC) is used.

5

Six Steps in the SDLC

Each step must be completed before you can progress to the next step.6Copyright 2013 Pearson Education, Inc. Publishing as Prentice Hall

6Because teams of individuals are required to develop systems, an organized process (or set of steps) needs to be followed to ensure that development proceeds in an orderly fashion.This set of steps is usually referred to as the system development life cycle (SDLC). There are six steps in the SDLC. This system is sometimes referred to as a waterfall system because each step is dependent on the previous step being completed first.

Problem & Opportunity IdentificationDevelopment steering committee formed to evaluate systems development proposalsReviews ideasDecides which projects to take forward based on available resourcesPersonnel and funding

7Copyright 2013 Pearson Education, Inc. Publishing as Prentice Hall

7In the Problem and Opportunity Identification phase, problems or opportunities are defined. Whether solving an existing problem or responding to an opportunity, corporations usually generate more ideas for systems than they have the time and money to implement. Large corporations typically form a steering committee to evaluate system development proposals and decide which projects to take forward. They then document the process, and relevant problems or opportunities are defined.

Analysis Analysts explore problem to be solvedDevelop program specificationsClear statement of goals and objectives of projectFeasibility assessment is performedUser requirements are definedAnalysts recommend a plan of action

8Copyright 2013 Pearson Education, Inc. Publishing as Prentice Hall

8In the Analysis phase, analysts explore the problem to be solved and develop a program specification. The program specification is a clear statement of the goals and objectives of the project at hand.It is also at this stage that the first feasibility assessment is performed. The feasibility assessment determines whether the project should go forward by looking at the needs and resources available and determining whether the project can be completed at all.Assuming the project is feasible, the analysis team studies the current system (if there is one) and defines the user requirements of the proposed system.Finally, the analysts recommend a solution or plan of action, and the process moves to the Design phase.

Design A detailed plan for programmers is developedFlowcharts and data-flow diagrams are used for the current and proposed systemData-flow diagram

9Copyright 2013 Pearson Education, Inc. Publishing as Prentice Hall

9In the Design phase of the SDLC, a detailed plan for programmers to follow is developed.The current and proposed systems are documented using flowcharts and data-flow diagrams. Flowcharts are visual diagrams of a process, including the decisions that need to be made along the way.Data-flow diagrams trace all data in an information system from the point at which data enters the system to the point of its final resting place (storage or output).

Development and DocumentationActual programming takes placeFirst phase of the program development life cycle (PDLC)10Copyright 2013 Pearson Education, Inc. Publishing as Prentice Hall

10It is during this phase that actual programming takes place. This phase is also the first part of the program development life cycle (PDLC), described in detail in the rest of the chapter.

Testing and InstallationProgram is tested to ensure it works properlyProgram is installed for use11Copyright 2013 Pearson Education, Inc. Publishing as Prentice Hall

11The next step in the SDLC is testing the program to ensure it works properly and then installing the program so that it can be used.

Maintenance and EvaluationPerformance of the system is monitoredCorrections and modifications to the program are madeAdditional enhancements that users request are evaluatedAppropriate program modifications are made12Copyright 2013 Pearson Education, Inc. Publishing as Prentice Hall

12Once the system is installed, its performance must be monitored to determine whether it is still meeting the needs of end users.Bugs (errors) that were not detected in the testing phase but that users discover subsequently must be corrected.Additional enhancements that users request are evaluated so that appropriate program modifications can be made.

Joint Application DevelopmentJAD helps designers adapt to changes in program specificationsIncludes customer involvementNo communication delaysAlso referred to as:Accelerated designFacilitated team technique13Copyright 2013 Pearson Education, Inc. Publishing as Prentice Hall

In each phase of the SDLC, a style of interaction named joint application development (JAD) is useful in creating successful, flexible results. JAD is popular because it helps designers adapt quickly to changes in program specifications. In JAD, the customer is involved in the project very closely, right from the beginning. Slow communication and lengthy feedback time are reasons the traditional development process is so time consuming. In JAD workshops, there are no communication delays. Workshops usually include end users, developers, subject experts, observers (such as senior management), and a facilitator. The facilitator enforces the rules of the meeting to make sure all voices are heard and agreement is reached as quickly as possible. Also called accelerated design or facilitated team technique, the goal of JAD is to improve design quality by fostering clear communication. 13

The Life Cycle of a ProgramProgramming is the process of translating a task into a series of commands a computer will use to perform that taskProgramming involves:Identifying the parts of a task the computer can performDescribing tasks in a highly specific and complete mannerTranslating this description into a language understood by the computers CPU14Copyright 2013 Pearson Education, Inc. Publishing as Prentice Hall

14Programming is the process of translating a task into a series of commands a computer will use to perform that task. It involves -Identifying which parts of a task a computer can perform-Describing those tasks in a very specific and complete manner -Translating this description into the language spoken by the computers CPU.

Program Development Life Cycle15Copyright 2013 Pearson Education, Inc. Publishing as Prentice Hall

15Just as an information system has a development life cycle, each programming project follows a number of stages from conception to final deploymentsometimes referred to as the program development life cycle (PDLC).

Step 1: Describing the ProblemProgrammers develop a complete description of problemProblem statement identifies task to be automatedStatement describes how software will behave16Copyright 2013 Pearson Education, Inc. Publishing as Prentice Hall

16Describing the Problem: First, programmers must develop a complete description of the problem. The problem statement identifies the task to be automated and describes how the software program will behave.

Describing the ProblemThe Problem StatementStaring point of programming workClear description of tasks the computer program must accomplishHow the program will execute these tasksHow the program will respond to unusual situations17Copyright 2013 Pearson Education, Inc. Publishing as Prentice Hall

The problem statement is the starting point of programming work. It is a clear description of what tasks the computer program must accomplish and how the program will execute these tasks and respond to unusual situations. Programmers develop problem statements so that they can better understand the goals of their programming efforts.

17

Creating Problem StatementsProgrammers interact with users to describe three relevant things:Data raw input users have at the startInformation result users require Method process of how program converts the inputs to correct outputs18Copyright 2013 Pearson Education, Inc. Publishing as Prentice Hall

Most computer users understand what jobs (or problems) they want to computerize but not the details of the programming process. Therefore, the goal in creating a useful problem statement is to have programmers interact with users to describe three things relevant to creating a useful program: data, information, and method.1. Data is the raw input that users have at the start of the job. It will be fed into the program.2. Information is the result, or output, that the users require at the end of the job. The program produces this information from data.3. Method, described precisely, is the process of how the program converts the inputs into the correct outputs.

18

Program Goal:To compute the total pay for a fixed number of hours worked at a parking garage.Inputs:Number of Hours Worked........................ a positive numberOutputs:Total Pay Earned .................................... a positive numberProcess:The Total Pay Earned is computed as $7.50 per hour for the first eight hours worked each day. Any hours worked beyond the first eight are billed at $11.25 per hour.Error Handling:The input (Number of Hours Worked) must be a positive real number. If it is a negative number or other non-acceptable character, the program will force the user to re-enter the information.Testing Plan:INPUTOUTPUTNOTES88*7.50Testing positive input33*7.50Testing positive input128*7.50 + 4*11.25Testing overtime input6Error message/ask user to re-enter valueHandling error

Parking Garage Example19Copyright 2013 Pearson Education, Inc. Publishing as Prentice Hall

19All problem statements include the same basic components:1. The input that is the data that will be entered. 2. The output that is the information that is expected to be produced.3. The processing that is the rules for transforming the input into output.4. The error handling that is the explanation of how the program will respond if the users enter data that doesnt make sense.5. The testing plan.In this table, we see a problem statement for the Parking Garage example. From here, the programmer can start to write code that satisfies the plan.

Step 2: Making a PlanProblem statement is translated into a set of specific, sequential steps known as an algorithmAlgorithm is written in natural ordinary language such as English

20Copyright 2013 Pearson Education, Inc. Publishing as Prentice Hall

20Making a Plan: The problem statement is next translated into a set of specific, sequential steps that describe exactly what the computer program must do to complete the work. The steps are known as an algorithm. At this stage, the algorithm is written in natural, ordinary language (such as English).

Making a PlanAlgorithm DevelopmentSet of specific sequential stepsDescribe exactly what computer program must do to complete taskUse natural language21Copyright 2013 Pearson Education, Inc. Publishing as Prentice Hall

Once programmers understand exactly what the program must do and have created the final problem statement, they can begin developing a detailed algorithm, a set of specific, sequential steps that describe in natural language exactly what the computer program must do to complete its task. Lets look at some ways in which programmers design and test algorithms.

21

Flowchart

22Copyright 2013 Pearson Education, Inc. Publishing as Prentice Hall

Flowcharts provide a visual representation of the patterns an algorithm follows. Specific shape symbols indicate program behaviors and decision types. For example, diamonds indicate that a binary decision and branching action will be performed, and rectangles indicate a program instruction. 22

PseudocodeBold terms show actions that are common in programming, such as reading data, making decisions, printing, and so on.

1. Ask the user how many hours they worked today2. If the number of hours worked < = 8, compute total pay without overtime otherwise, compute total pay with overtime pay3. Print total payUnderlined words are information items that appear repeatedly in the algorithm.

23Copyright 2013 Pearson Education, Inc. Publishing as Prentice Hall

Pseudocode is a text-based approach to documenting an algorithm. In pseudocode, words describe the actions that the algorithm will take. Pseudocode is organized like an outline, with differing levels of indentation to indicate the flow of actions within the program.

23

Developing the AlgorithmDecision Making and DesignConvert problem statement into list of steps or actionsOnly simplest algorithms execute same series of actions every time they runComplex problems involve choices and include decision points24Copyright 2013 Pearson Education, Inc. Publishing as Prentice Hall

When programmers develop an algorithm, they convert the problem statement into a list of steps (or actions) the program will take. For simple problems, this list is straightforward: The program completes this action first, that action second, another action third, and so on. However, only the simplest algorithms execute the same series of actions every time they run.Problems that are more complex involve choices and, therefore, cannot follow a sequential list of steps to generate the correct output. Instead, the list of steps created for complex problems includes decision points, places where the program must choose from an array of different actions based on the value of its current inputs. For example, a binary decision (shown in a flowchart as a diamond) will have two possible paths that can be taken, depending on the value of the inputs. Programmers convert a problem into an algorithm by listing the sequence of actions that must be taken and recognizing the places where decisions must be made.

24

Top-Down DesignProblem is divided into a series of high-level tasksDetailed subtasks are created from high-level tasks25Copyright 2013 Pearson Education, Inc. Publishing as Prentice Hall

25Top-down design is a systematic approach in which a problem is broken down into a series of high-level tasks. In top-down design, programmers apply the same strategy repeatedly, breaking down each task into successively more detailed subtasks. They continue until they have a sequence of steps that are close to the types of commands allowed by the programming language they will use for coding.

Object-Oriented Analysis

Classes (categories of inputs) are identifiedClasses are defined by information (data) and actions (methods or behaviors)Reusability is key26Copyright 2013 Pearson Education, Inc. Publishing as Prentice Hall

26A very different approach to generating an algorithm is object-oriented analysis. With object-oriented analysis, programmers first identify all of the categories of inputs that are part of the problem the program is trying to solve. These categories are called classes. For example, the classes in our parking garage example might include a TimeCard class and an Employee class.

Step 3: Coding Algorithm is translated into programming codeProgrammers must think in terms of operations that a CPU can perform27Copyright 2013 Pearson Education, Inc. Publishing as Prentice Hall

27Coding: The algorithm is then translated into programming code, a language that is friendlier to humans than the 1s and 0s that the CPU speaks but is still highly structured. By coding the algorithm, programmers must think in terms of the operations that a CPU can perform.

Writing Program CodeProgrammers select best programming language for the problemTranslate the algorithm into that languageTranslation is act of coding

28Copyright 2013 Pearson Education, Inc. Publishing as Prentice Hall

Once programmers create an algorithm, they select the best programming language for the problem and then translate the algorithm into that language.Translating an algorithm into a programming language is the act of coding. Programming languages are (somewhat!) readable by humans but then are translated into patterns of 1s and 0s to be understood by the CPU.

28

Generations of Programming LanguagesLevelGenerationExampleLow1GLMachine2GLAssemblyHigh3GLFORTRAN, BASIC, C, Java4GLSQLNatural5GLPROLOG

29Copyright 2013 Pearson Education, Inc. Publishing as Prentice Hall

29A first-generation language (1GL) is the actual machine language of a CPU, the sequence of bits (1s and 0s) that the CPU understands. A second-generation language (2GL) is also known as an assembly language. Assembly languages allow programmers to write their programs using a set of short, English-like commands that speak directly to the CPU and give the programmer direct control of hardware resources. A third-generation language (3GL) uses symbols and commands to help programmers tell the computer what to do. This makes 3GL languages easier for humans to read and remember. Most programming languages today, including BASIC, FORTRAN, COBOL, C/C++, and Java, are considered third generation.Structured Query Language (SQL) is a database programming language that is an example of a fourth-generation language (4GL). Many other database query languages and report generators are also 4GLs. The following single SQL command would check a huge table of data on the employees and build a new table showing all those employees who worked overtime:Fifth-generation languages are considered the most natural of languages. In a 5GL, a problem is presented as a series of facts or constraints instead of as a specific algorithm. The system of facts can then be queried (asked) questions. PROLOG (PROgramming LOGic) is an example of a 5GL.

CodingSpeaking the Language of the ComputerSyntaxAgreed-upon set of rules of language usedKeywordsSet of words with predefined meaningsData typesDescribe the kind of data being stored in memoryOperatorsCoding symbols that represent fundamental actions30Copyright 2013 Pearson Education, Inc. Publishing as Prentice Hall

Programming languages are evolving constantly. New languages emerge every year, and existing languages change dramatically. Therefore, it would be extremely difficult and time consuming for programmers to learn every programming language. However, all languages have several common elements: rules of syntax, a set of keywords, a group of supported data types, and a set of allowed operators. By learning these four concepts, a programmer will be better equipped to approach any new language.30

Compilation Compilation is the process of converting code into machine languageA compiler reads the source code and translates it into machine languageAfter compilation, programmers have an executable program31Copyright 2013 Pearson Education, Inc. Publishing as Prentice Hall

31Compilation is the process by which code is converted into machine language, the language the CPU can understand. A compiler is a program that understands both the syntax of the programming language and the exact structure of the CPU and its machine language. It can read the source codethe instructions programmers have written in the higher-level languageand translate the source code directly into machine languagethe binary patterns that will execute commands on the CPU.At this stage, programmers finally have produced an executable program, the binary sequence that instructs the CPU to run their code.

InterpreterSome programming languages do not have a compiler, but use an interpreter insteadThe interpreter translates source code into a line-by-line intermediate formEach line is executed before the next line is compiledProgrammers do not have to wait for the entire program to be recompiled each time they make a changeProgrammers can immediately see the results of changes as they are making them32Copyright 2013 Pearson Education, Inc. Publishing as Prentice Hall

32An interpreter translates the source code into an intermediate form, line by line. Each line is then executed as it is translated. The compilation process takes longer than the interpretation process because in compilation, all of the lines of source code are translated into machine language before any lines are executed.The finished compiled program runs faster than an interpreted program because the interpreter is constantly translating and executing as it goes.Programmers can immediately see the results of their program changes as they are making them in the code.

Coding ToolsIntegrated Development EnvironmentDevelopmental tool that helps programmers write, compile, and test programsEvery language has its own specific IDE

33Copyright 2013 Pearson Education, Inc. Publishing as Prentice Hall

Modern programming is supported by a collection of tools that make the writing and testing of software easier. Compiler products feature an integrated development environment (IDE), a developmental tool that helps programmers write, compile, and test their programs. As is the case with compilers, every language has its own specific IDE. 33

Step 4: Debugging Code goes through process of debuggingProgrammers repair any errors found in code34Copyright 2013 Pearson Education, Inc. Publishing as Prentice Hall

34Debugging: The code then goes through a process of debugging in which the programmers repair any errors found in the code.

DebuggingGetting Rid of ErrorsProcess of running program over and overTo find errorsTo make sure the program behaves the way it should

35Copyright 2013 Pearson Education, Inc. Publishing as Prentice Hall

Once the program has compiled without syntax errors, it has met all of the syntax rules of the language. However, this doesnt mean that the program behaves in a logical way or that it appropriately addresses the task the algorithm described. If programmers made errors in the strategy used in the algorithm or in how they translated the algorithm to code, problems will occur. The process of running the program over and over to find errors and to make sure the program behaves in the way it should is termed debugging .35

Step 5: Finishing the ProjectSoftware is testedProgramming teamPeople who will use programResults of entire project are documentedUsers are trained to use program efficiently36Copyright 2013 Pearson Education, Inc. Publishing as Prentice Hall

36Finishing the Project: The software is tested by both the programming team and the people who will use the program. The results of the entire project are documented for the users and the development team. Finally, users are trained so that they can use the program efficiently.

Finishing the ProjectTesting and DocumentationInternal testing a group with the software company uses program in every way possibleExternal testing people like those who will eventually purchase the program work with it

37Copyright 2013 Pearson Education, Inc. Publishing as Prentice Hall

Once debugging has detected all of the runtime errors in the code, it is time for users to test the program. This process is called internal testing. In internal testing, a group within the software company uses the program in every way it can imagineincluding how it was intended to be used and in ways only new users may think up. The internal testing group makes sure the program behaves as described in the original testing plan. Any differences in how the program responds are reported back to the programming team, which makes the final revisions and updates to the code.The next round of testing is external testing. In this testing round, people like the ones that eventually will purchase and use the software must work with it to determine whether it matches their original vision.

37

Programming LanguagesMany languages for many projectsCreate a solution to meet several competing objectivesSoftware must run quickly and reliablySimple to expand when demands changeCompleted on time for minimal costUse smallest amount of system resources38Copyright 2013 Pearson Education, Inc. Publishing as Prentice Hall

In any programming endeavor, programmers want to create a solution that meets several competing objectives. They want the software to run quickly and reliably and to be simple to expand later when the demands on the system change. They also want it to be completed on time and for the minimum possible cost, and to use the smallest amount of system resources possible.Because it will always be difficult to balance these conflicting goals, a wide variety of programming languages has been developed. Earlier in the chapter, you learned about the five main categories (generations) of programming languages. In this section, we discuss the specific programming languages that are members of these different generations. Although programming languages often share many common characteristics, each language has specific traits that allow it to be the best fit for certain types of projects. 38

Selecting the Right LanguageProgramming team considers several factorsSpace availableSpeed requiredOrganizational resources availableType of target application39Copyright 2013 Pearson Education, Inc. Publishing as Prentice Hall

39A programming team considers several factors before selecting the language it will use for a specific project.Space available: Not all languages produce code that takes up the same amount of space. Therefore, the target language should be well matched to the amount of space available for the final program. For example, if the program will be embedded in a chip for use in a cell phone, then it is important for the language to create space-efficient programs.Speed required: Although poorly written code executes inefficiently in any language, some languages can execute more quickly than others can. Some projects require a focus on speed rather than size. These projects require a language that produces code that executes in the fastest possible time.Organizational resources available: Another consideration is the resources available in a managers group or organization. Selecting a language that is easy to use and will be easy to maintain if there is a turnover in programmers is an important consideration. Managers also may factor in the existing pool of talent available for the project. Having to train five programmers to tackle a project in a new language would have significant disadvantages over allowing them to work in a familiar language.Type of target application: Certain languages are customized to support a specific environment (UNIX or Windows, for instance). Knowing which languages are most commonly used for which environments can be helpful.

Visual Basic 2010Visual Basic 2010 is the current versionBuilds object-oriented applications for:WindowsThe WebMobile DevicesEasy to drag and drop entire programming components into application

40Copyright 2013 Pearson Education, Inc. Publishing as Prentice Hall

40Visual Basic 2010 is the current version of Visual Basic and is designed for building object-oriented applications for Windows, the Web, and mobile devices. Interface of Visual Basic makes it easy to drag and drop entire programming components into an application. Visual Basic 2010 provides a multitude of features that are new or an improvement on the previous versions. These changes make development with Visual Basic easier and produce more efficient code than with any earlier version. Visual Basic 2010 and the .NET Framework are both part of Visual Studio 2010, which provides a complete set of developer tools.

C and C++CDeveloped for system programmersProvides higher-level programming featuresif statements and for loopsC++Uses same symbols and keywords as CBetter securitySupport for reuse of existing codeIncludes object-oriented design41Copyright 2013 Pearson Education, Inc. Publishing as Prentice Hall

41C was originally developed for system programmers. It provides higher-level programming language features (such as if statements and for loops) but still allows programmers to manipulate the system memory and CPU registers directly. This mix of high- and low-level access makes C very attractive to power programmers. Most modern operating systems (including Windows Vista, Windows 7, Mac OS X, and Linux) are written in C.C++ uses all of the same symbols and keywords as C, but extends the language with additional keywords, better security, and more support for the reuse of existing code through object-oriented design.Programmers often choose to learn C/C++ because their basic components (operators, data types, and keywords) are common to many other languages.

Java and C#JavaObject-oriented featuresLarge set of existing classesArchitecture neutralJava applets: Small Java-based programsC#Completing program released by Microsoft

42Copyright 2013 Pearson Education, Inc. Publishing as Prentice Hall

42Javas object-oriented model enables Java programmers to benefit from its large set of existing classes. An attractive feature of Java is that it is architecture neutral. This means that Java code needs to be compiled only once, and it can run on many CPUs. The Java program does not care what CPU, OS, or user interface is running on the machine where it lands.This is possible because the target computer runs a Java Virtual Machine (VM), software that can explain to the Java program how to function on any specific system. A Java VM installed with Microsoft Internet Explorer, for example, allows Internet Explorer to execute any Java applets (small Java-based programs) it encounters on the Internet. Microsoft has released a language named C# (pronounced see sharp) that competes with Java.

Objective CLanguage most often used to program applications to run under Mac OS XObject-oriented languageSuperset of the C languageOften used with library called Cocoa43Copyright 2013 Pearson Education, Inc. Publishing as Prentice Hall

Objective C is the language most often used to program applications to run under Mac OS X. It is an object-oriented style of language, a superset of the C language so it includes all of the keywords of C and then adds more keywords and features. It is often used together with a library called Cocoa. The Cocoa library, or framework, lets users program for the Mac OS X graphical user interface. The Cocoa Touch extension introduces a framework of methods that support gesture recognition for touch devices like the iPhone or iPad. Many different IDE tools support Objective C, but OS X ships with a tool named Xcode, that is often used to develop Objective C applications for OS X. The version 4 release of Xcode, is a paid application that can be purchased and downloaded from the online Mac App Store.

43

Building Web ApplicationsHTML/XHTML HyperText Markup Language/eXtensible HyperText Markup LanguageNot a true programming languageUses special symbols (tags) to control how Web pages are viewed44Copyright 2013 Pearson Education, Inc. Publishing as Prentice Hall

44HTML/XHTML is not a programming language. Rather, HTML/XHTML is a series of tags that modify the display of text. HTML was the original standard defining these tags. XHTML is a newer standard that corrects some of the problems found in HTML.

Scripting Languages for the WebSimple programming language limited to performing a set of specialized tasksScripts allow decisions to be made and calculations to be performedJavaScript, VBScript, and PHP work well with HTML45Copyright 2013 Pearson Education, Inc. Publishing as Prentice Hall

To make their Web pages more visually appealing and interactive, programmers use scripting languages to add more power and flexibility to their HTML code. A scripting language is a simple programming language that is limited to performing a set of specialized tasks. Scripts allow decisions to be made and calculations to be performed. Several popular scripting languages work well with HTML, including JavaScript, VBScript, and PHP (Hypertext Preprocessor).

45

ASP, JSP, and PHPUsed by programmers to build Web sites with interactive capabilitiesUser supplies information that is translated into a request.Scripting code controls automatic writing of the custom page returned to users computer46Copyright 2013 Pearson Education, Inc. Publishing as Prentice Hall

To build Web sites with interactive capabilities, programmers use Active Server Pages (ASP), JavaServer Pages (JSP), or the scripting language PHP (Hypertext Preprocessor) to adapt the HTML or XHTML page to the users selections. The user supplies information that is translated into a request by the main computer at the company that owns the Web site, often using a database query language such as SQL. Scripting code in ASP, JSP, or PHP controls the automatic writing of the custom HTML/XHTML page that is returned to the users computer.46

Flash and XMLAdobe FlashUsed to develop Web-based multimediaIncludes its own scripting language, ActionScriptXML (eXtensible Markup Language)Enables designers to define data-based tagsMakes it easier for Web site to transfer key information on its page to another site47Copyright 2013 Pearson Education, Inc. Publishing as Prentice Hall

Adobe Flash is a software product used for developing Web-based multimedia. Flash includes its own programming language, ActionScript, which is very similar to JavaScript in its selection of keywords, operators, and classes.Microsoft has a competing product named Silverlight that supports the development of rich multimedia and interactive Web applications. XML (eXtensible Markup Language) enables designers to define their own data-based tags, making it much easier for a Web site to transfer the key information on its page to another site.

47

AJAXAsynchronous JavaScript And XMLAllows creation of Web applications that can update information without requiring a page refresh Uses existing technologies to do more processing in the browserUsers have a more responsive experience48Copyright 2013 Pearson Education, Inc. Publishing as Prentice Hall

Other advances, like the collection of technologies referred to as AJAX (Asynchronous JavaScript And XML), and the continued evolution of HTML5 allow the creation of Web applications that can update information on a page without requiring the user to do a page refresh or leave the page. By using existing technologies to do more processing in the browser, users have a more responsive experience.48

Building Mobile ApplicationsSpecial languages and supporting tools help speed development of applications for mobile devices like smart phones and tabletsSpecific features include GPS capability, software keyboards, and touch-sensitive screensUser interface must take smaller screen size into account

49Copyright 2013 Pearson Education, Inc. Publishing as Prentice Hall

Special languages and supporting tools are helping speed the development of applications for mobile devices like smartphones and tablets. Programmers need to be able to take advantage of specific features like GPS capability, a compass, software keyboards, and touch-sensitive screens. In addition, the user interface has to take the smaller screen size into account.

49

The Next Great LanguageNever easy to predict which language will become the next great languageExperts predict that as projects grow in size, time to compile will also growInterpreted languages could become more important because they have virtually no compile timePython, Ruby, and Smalltalk50Copyright 2013 Pearson Education, Inc. Publishing as Prentice Hall

50It is never easy to predict which language will become the next great language. Software experts predict that as software projects continue to grow in size, the amount of time needed to compile a completed project will also grow. It is not uncommon for a large project to require 30 minutes or more to compile. Interpreted languages, however, have virtually no compile time because compilation occurs while the code is being edited. As projects get larger, the capability to be compiled instantaneously will become even more important. Thus, interpreted languages such as Python, Ruby, and Smalltalk could become more important in the coming years.