Introduction to Computer Science
Computer Programming
Lecture a
This material (Comp 4 Unit 4) was developed by Oregon Health & Science University, funded by the Department
of Health and Human Services, Office of the National Coordinator for Health Information Technology under
Award Number 90WT0001.
This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International
License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/4.0/.
Computer Programming
Learning Objectives - 1
• Define the purpose of programming
languages (Lecture a)
• Differentiate between the different types of
programming languages and list
commonly used ones (Lecture a)
• Explain the compiling and interpreting
process for computer programs
(Lecture b)
2
Computer Programming
Learning Objectives - 2
• Learn basic programming concepts
including variable declarations,
assignment statements, expressions,
conditional statements and loops
(Lectures c, d)
• Describe advanced programming
concepts including objects and modularity
(Lecture e)
3
Programming Languages
• All software that runs on a computer is a
program
– Written using a programming language
– Many different languages available
• Similar to natural languages
– Syntax
– Keywords
– Punctuation
4
Software Development Stages
5
Prototyping
• Prototypes are initial versions of program
used to collect feedback
– Paper
– Electronic, but not functional program
– Functional program, but limited
• Created in initial development phase
• Tool for keeping stakeholders involved
6
Software Development
Methodology/Frameworks
• Frameworks describe process and
structure of development
– May include prototyping
• Development team follows one particular
methodology for development
• Some examples
– Waterfall method (Royce, 1971)
– Spiral model (Boehm, 1986)
– Rapid application development (Martin, 1991)
7
Algorithms
• Set of operations that define how a task is
to be performed
• Any computer program implements an
algorithm
• Algorithm development started long before
computers were invented
8
Algorithm Example - 1
Making a peanut butter and jelly sandwich
(PB&J)
1. Get ingredients and tools
2. Spread peanut butter on
one slice
3. Spread jelly on other
slice
4. Place two slices together
(Amos, 2010, PD-US)
9
Algorithm Example - 2
Making a peanut butter and jelly sandwich
(PB&J)
1. Get the ingredients and tools
• Two slices of bread
• Peanut butter (PB)
• Jelly
• Knife
2. Spread peanut butter on one slice
• Dip knife into PB
• Remove knife, bringing
PB with it
• Place knife PB side down
on bread
• Swirl knife to spread PB
3. Spread jelly on other slice
4. Place two slices together
10
Algorithm Uses
• Describes problem solution without the
programming syntax
– Pseudocode
– Flowcharts
• Plan solution before programming
• Can determine/prove
– Correctness
– Execution time
– Required memory and storage
11
Coding
• Programs/programming statements are
generically called code
• Writing programs is called coding
• Choices for programming languages:
– Functionality of program
– On what platform it will run
– What is available
12
Programming Language
Categories
• Low-level
– First Generation
o Machine code (1s
and 0s)
– Second Generation
o Assembly language
o Words to describe
commands
• High-level
– Third Generation
o FORTRAN, BASIC,
C, Java
– Fourth Generation
o SQL
o Powerful, complex
commands
– Fifth Generation
o Prolog, visual
programming 13
First-Generation Machine Code
• Each computer has an instruction set
– Tasks the computer can do
– Unique sequence of 0s and 1s
• Applications are groups of instructions
• Programmers used to program in 0s and
1s
– Switches
– Punched cards
14
Second-Generation
Assembly Language
• Use words to
represent
instructions
• Translate assembly
code into machine
code
• Computer-specific,
just as machine
code is
15
Third-Generation Languages
• The next generation of languages added
operations
– No longer unique to a computer system
– Programs more portable
• Modern programming languages are third
generation
– FORTRAN, COBOL, C, C++, C#, Java,
VB.Net
16
Programming Paradigms
• Procedural
– BASIC, COBOL, FORTRAN, C
• Functional
– LISP, Scheme
• Object-oriented languages
– C++, C#, Java, Ruby
• Others
– Declarative, event-driven, domain-specific,
logic
17
Scripting Languages
• Languages that control other applications
– Batch control – shell scripts
– Web browsers – JavaScript
– Text processing – Perl
• Some have evolved for general application
development
– Perl, Python
18
Some Languages Specifically
Designated for Health Care
• Massachusetts General Hospital Utility Multi-
Programming System, MUMPS; Neil Pappalardo
first developed in 1960s, standardized in 1977
• Meditech Interpretive Information System, MIIS
Proprietary implementation of MUMPS, 1969
• Multitype Automation Group In Cooperation,
MAGIC MEDITECH Corp – founder Neil
Pappalardo, 1982
19
Computer Programming
Summary – 1 – Lecture a
• Programming languages consist of
commands computers understand, which
are used for coding
• There are methodologies designed for
software development
• An algorithm is a sequence of operations
that defines how a task is to be performed
20
Computer Programming
Summary – 2 – Lecture a
• Programming languages vary in structure
and proximity to natural languages
• Procedural, functional, and object-oriented
are a few common programming
paradigms
• There are specialized programming
languages developed specifically for
health care
21
Computer Programming
References – 1 – Lecture a
References
Boehm, B. (1986). A spiral model of software development and enhancement. ACM
SIGSOFT Software Engineering Notes, 11(4), 14-24.
Meditech. [webpage]. Medical Information Technology, Inc. Retrieved from
https://ehr.meditech.com/.
MIIS. (2011). In Wikipedia. Retrieved November 13, 2011, from
http://en.wikipedia.org/wiki/MIIS_%28programming_language%29.
Morley, D., & Parker, C.S. (2010). Chapter 13: Program Development and Programming
Languages. In Understanding Computers Today and Tomorrow, 12th Edition
introductory. Boston: Course Technology.
MUMPS. (2011). In Wikipedia. Retrieved March 1, 2011, from
http://en.wikipedia.org/wiki/MUMPS.
Parsons, J.J., & Oja, D. (2010). Chapter 12: Computer Programming. In New
Perspectives on Computer Concepts 2011: Comprehensive. 13th ed. Boston: Course
Technology.
Programming Languages. (2011). In Wikipedia. Retrieved March 17, 2011, from
http://en.wikipedia.org/wiki/Programming_languages.
22
Computer Programming
References – 2 – Lecture a
References, continued
Programming Paradigms. (2011). In Wikipedia. Retrieved March 17, 2011, from
http://en.wikipedia.org/wiki/Programming_paradigms .
Rapid Application Development. (2011). In Wikipedia. Retrieved November 13, 2011,
from http://en.wikipedia.org/wiki/Rapid_application_development.
Scripting Languages. (2011). In Wikipedia. Retrieved March 11, 2011, from
http://en.wikipedia.org/wiki/Scripting_languages.
Software Development Methodology. (2011). In Wikipedia. Retrieved November 13, 2011,
from http://en.wikipedia.org/wiki/Software_development_methodology.
Waterfall Model. (2011). In Wikipedia. Retrieved November 13, 2011, from
http://en.wikipedia.org/wiki/Waterfall_model.
Images
Slide 9: Peanut Butter and Jelly Sandwich. [image on the Internet]. Amos, E. (2010,
November 11). Retrieved January 2012, from http://en.wikipedia.org/wiki/File:Peanut-
Butter-Jelly-Sandwich.jpg. This file has been released into the Public Domain.
23
Introduction to Computer Science
Computer Programming
Lecture a
This material was developed by Oregon
Health & Science University, funded by the
Department of Health and Human Services,
Office of the National Coordinator for Health
Information Technology under Award
Number 90WT0001.
24

Computer Programming - Lecture A

  • 1.
    Introduction to ComputerScience Computer Programming Lecture a This material (Comp 4 Unit 4) was developed by Oregon Health & Science University, funded by the Department of Health and Human Services, Office of the National Coordinator for Health Information Technology under Award Number 90WT0001. This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/4.0/.
  • 2.
    Computer Programming Learning Objectives- 1 • Define the purpose of programming languages (Lecture a) • Differentiate between the different types of programming languages and list commonly used ones (Lecture a) • Explain the compiling and interpreting process for computer programs (Lecture b) 2
  • 3.
    Computer Programming Learning Objectives- 2 • Learn basic programming concepts including variable declarations, assignment statements, expressions, conditional statements and loops (Lectures c, d) • Describe advanced programming concepts including objects and modularity (Lecture e) 3
  • 4.
    Programming Languages • Allsoftware that runs on a computer is a program – Written using a programming language – Many different languages available • Similar to natural languages – Syntax – Keywords – Punctuation 4
  • 5.
  • 6.
    Prototyping • Prototypes areinitial versions of program used to collect feedback – Paper – Electronic, but not functional program – Functional program, but limited • Created in initial development phase • Tool for keeping stakeholders involved 6
  • 7.
    Software Development Methodology/Frameworks • Frameworksdescribe process and structure of development – May include prototyping • Development team follows one particular methodology for development • Some examples – Waterfall method (Royce, 1971) – Spiral model (Boehm, 1986) – Rapid application development (Martin, 1991) 7
  • 8.
    Algorithms • Set ofoperations that define how a task is to be performed • Any computer program implements an algorithm • Algorithm development started long before computers were invented 8
  • 9.
    Algorithm Example -1 Making a peanut butter and jelly sandwich (PB&J) 1. Get ingredients and tools 2. Spread peanut butter on one slice 3. Spread jelly on other slice 4. Place two slices together (Amos, 2010, PD-US) 9
  • 10.
    Algorithm Example -2 Making a peanut butter and jelly sandwich (PB&J) 1. Get the ingredients and tools • Two slices of bread • Peanut butter (PB) • Jelly • Knife 2. Spread peanut butter on one slice • Dip knife into PB • Remove knife, bringing PB with it • Place knife PB side down on bread • Swirl knife to spread PB 3. Spread jelly on other slice 4. Place two slices together 10
  • 11.
    Algorithm Uses • Describesproblem solution without the programming syntax – Pseudocode – Flowcharts • Plan solution before programming • Can determine/prove – Correctness – Execution time – Required memory and storage 11
  • 12.
    Coding • Programs/programming statementsare generically called code • Writing programs is called coding • Choices for programming languages: – Functionality of program – On what platform it will run – What is available 12
  • 13.
    Programming Language Categories • Low-level –First Generation o Machine code (1s and 0s) – Second Generation o Assembly language o Words to describe commands • High-level – Third Generation o FORTRAN, BASIC, C, Java – Fourth Generation o SQL o Powerful, complex commands – Fifth Generation o Prolog, visual programming 13
  • 14.
    First-Generation Machine Code •Each computer has an instruction set – Tasks the computer can do – Unique sequence of 0s and 1s • Applications are groups of instructions • Programmers used to program in 0s and 1s – Switches – Punched cards 14
  • 15.
    Second-Generation Assembly Language • Usewords to represent instructions • Translate assembly code into machine code • Computer-specific, just as machine code is 15
  • 16.
    Third-Generation Languages • Thenext generation of languages added operations – No longer unique to a computer system – Programs more portable • Modern programming languages are third generation – FORTRAN, COBOL, C, C++, C#, Java, VB.Net 16
  • 17.
    Programming Paradigms • Procedural –BASIC, COBOL, FORTRAN, C • Functional – LISP, Scheme • Object-oriented languages – C++, C#, Java, Ruby • Others – Declarative, event-driven, domain-specific, logic 17
  • 18.
    Scripting Languages • Languagesthat control other applications – Batch control – shell scripts – Web browsers – JavaScript – Text processing – Perl • Some have evolved for general application development – Perl, Python 18
  • 19.
    Some Languages Specifically Designatedfor Health Care • Massachusetts General Hospital Utility Multi- Programming System, MUMPS; Neil Pappalardo first developed in 1960s, standardized in 1977 • Meditech Interpretive Information System, MIIS Proprietary implementation of MUMPS, 1969 • Multitype Automation Group In Cooperation, MAGIC MEDITECH Corp – founder Neil Pappalardo, 1982 19
  • 20.
    Computer Programming Summary –1 – Lecture a • Programming languages consist of commands computers understand, which are used for coding • There are methodologies designed for software development • An algorithm is a sequence of operations that defines how a task is to be performed 20
  • 21.
    Computer Programming Summary –2 – Lecture a • Programming languages vary in structure and proximity to natural languages • Procedural, functional, and object-oriented are a few common programming paradigms • There are specialized programming languages developed specifically for health care 21
  • 22.
    Computer Programming References –1 – Lecture a References Boehm, B. (1986). A spiral model of software development and enhancement. ACM SIGSOFT Software Engineering Notes, 11(4), 14-24. Meditech. [webpage]. Medical Information Technology, Inc. Retrieved from https://ehr.meditech.com/. MIIS. (2011). In Wikipedia. Retrieved November 13, 2011, from http://en.wikipedia.org/wiki/MIIS_%28programming_language%29. Morley, D., & Parker, C.S. (2010). Chapter 13: Program Development and Programming Languages. In Understanding Computers Today and Tomorrow, 12th Edition introductory. Boston: Course Technology. MUMPS. (2011). In Wikipedia. Retrieved March 1, 2011, from http://en.wikipedia.org/wiki/MUMPS. Parsons, J.J., & Oja, D. (2010). Chapter 12: Computer Programming. In New Perspectives on Computer Concepts 2011: Comprehensive. 13th ed. Boston: Course Technology. Programming Languages. (2011). In Wikipedia. Retrieved March 17, 2011, from http://en.wikipedia.org/wiki/Programming_languages. 22
  • 23.
    Computer Programming References –2 – Lecture a References, continued Programming Paradigms. (2011). In Wikipedia. Retrieved March 17, 2011, from http://en.wikipedia.org/wiki/Programming_paradigms . Rapid Application Development. (2011). In Wikipedia. Retrieved November 13, 2011, from http://en.wikipedia.org/wiki/Rapid_application_development. Scripting Languages. (2011). In Wikipedia. Retrieved March 11, 2011, from http://en.wikipedia.org/wiki/Scripting_languages. Software Development Methodology. (2011). In Wikipedia. Retrieved November 13, 2011, from http://en.wikipedia.org/wiki/Software_development_methodology. Waterfall Model. (2011). In Wikipedia. Retrieved November 13, 2011, from http://en.wikipedia.org/wiki/Waterfall_model. Images Slide 9: Peanut Butter and Jelly Sandwich. [image on the Internet]. Amos, E. (2010, November 11). Retrieved January 2012, from http://en.wikipedia.org/wiki/File:Peanut- Butter-Jelly-Sandwich.jpg. This file has been released into the Public Domain. 23
  • 24.
    Introduction to ComputerScience Computer Programming Lecture a This material was developed by Oregon Health & Science University, funded by the Department of Health and Human Services, Office of the National Coordinator for Health Information Technology under Award Number 90WT0001. 24

Editor's Notes

  • #2 Welcome to Introduction to Computer Science: Computer Programming. This is lecture a. This component, Introduction to Computer Science, provides a basic overview of computer architecture; data organization, representation, and structure; structure of programming languages; networking, and data communication. It also includes the basic terminology of computing.
  • #3 The learning objectives for this unit, Computer Programming, are to: Define the purpose of programming languages Differentiate between the different types of programming languages and list commonly used ones Explain the compiling and interpreting process for computer programs
  • #4  Learn basic programming concepts including variable declarations, assignment statements, expressions, conditional statements, and loops And describe advanced programming concepts including objects and modularity
  • #5 Any software that runs on a computer is a program, meaning that it is a set of instructions that tell a computer what to do. Every program is written in some sort of programming language. That includes everything from operating systems to word processing programs to small, simple utilities. There are many different languages available; we will discuss them in detail later in this lecture. Like natural languages, programming languages have a syntax—a set of specific commands and statements with rules as to how these statements can be used and combined. There are keywords that are used in the statements, and punctuation is used for combining and defining the statements.
  • #6 The process of creating software is complex and time consuming. Ultimately, the end product is the program, but much more goes into the process than just writing the many different programming statements that comprise the software. The planning/exploratory stage involves exploration of the need for new software, market analysis, formulation of specific requirements, and formulation of initial design specifications. Requirements gathering determines exactly what the software must do to be useful, along with who the stakeholders are. Stakeholders are all the people affected by the software, which includes users, management, executives, and external collaborators, among others. Specifications are high-level descriptions of each module of the future software. The implementation phase involves the actual programming, also referred to as code writing. As the software development is in progress, each completed module is tested thoroughly to make sure it functions correctly, properly interfaces with other parts of the program, and meets the formulated requirements. When all modules are completed and tested, the entire program undergoes extensive testing. Finally the software is deployed. As long as the software has users, there must be ongoing support and maintenance for the product, and this often includes further development.
  • #7 Prototypes are initial versions of a program that are not fully functional. During any of the first stages of development, prototypes can be used for getting feedback and testing design. They can be as simple as sketches drawn on paper, or electronic prototypes that are not functional, but represent what the program will look like and how it will function. They can even be functional programs, but not yet fully implemented. In any case, the prototypes help the designers and developers communicate their thoughts to the stakeholders. The stakeholders can provide feedback about the prototype that can help refine the design. It can be helpful to have several iterations of prototyping and soliciting stakeholder feedback. This is a good way for stakeholders to stay involved with the design process without having to wait until the program has been implemented.
  • #9 8
  • #10 9
  • #11 10
  • #12 11
  • #13 12
  • #14 Here is a list of five generations of programming languages and some examples of each. In some ways, this list represents the progression of programming languages over time, but not in all cases, for example, some third-generation languages are newer than some fifth-generation languages. The first-generation languages were machine code, which is the sequence of 1s and 0s that the computer can understand and execute. Needless to say, programming in 1s and 0s isn't easy, so future generations of languages were developed to make programs more understandable to humans. The second generation of languages were assembly languages that translated those 1s and 0s into words. This was a better approach but still somewhat limited, particularly since assembly languages were unique to each type of computer. Third-generation languages added operations to the commands to make the programs more general; now programming languages were no longer tied to a particular computer. This third generation of languages includes older languages such as FORTRAN, BASIC, and C, but also newer languages like Java.  Fourth-generation languages use powerful, complex commands that result in fewer programming statements. Database querying languages such as Structured Query Language, or SQL, are good examples of this. Database querying languages will be covered in depth in Unit 5. Fifth-generation languages attempt to come even closer to natural languages, which is what Prolog was developed to do. Other experts consider programming using visual, interactive environments to be fifth-generation programming. First- and second-generation languages are considered to be low-level languages; that is, they are closer to the actual machine code that the computer understands. Third-generation and up are considered to be high-level languages; they are closer to natural language than they are to machine code. We will discuss first- through third-generation languages on the next slides. Fourth and fifth generations are beyond the scope of this unit.
  • #15 14
  • #16 15
  • #17 16
  • #18 17
  • #19 18
  • #20 Special-purpose languages for health care include MUMPS; MIIS; and MAGIC, which were all developed by Neil Pappalardo, founder of Meditech. Many electronic health record systems are written at least in part using a language from this family of languages.
  • #23 References slide. No audio.
  • #24 References slide. No audio.
  • #25 No audio.